CodeIssuesDiscussionsWikiPull RequestsProjectsCommitsActionsReleasesContributorsPulse● GatesSecuritySettingsDeploymentsPipelineInsightsAgents✨ Explain✨ Ask AI✨ Workspace✨ Spec✨ Tests▓ Debt Map✨ NL Search🏛 Archaeology
Blame · Line-by-line history
CLAUDE.md
Each line is annotated with the commit that last touched it. Click any SHA to jump to that commit and see the surrounding change.
| fc1817a | 1 | # gluecron |
| 2 | ||
| 3 | AI-native code intelligence platform — git hosting, automated CI, and green ecosystem enforcement. | |
| 4 | ||
| 9ab6971 | 5 | ## READ FIRST — every session |
| 6 | ||
| 7 | **`BUILD_BIBLE.md` is mandatory reading for every Claude agent before any code changes.** | |
| 8 | ||
| 9 | It contains: | |
| 10 | - Agent policy (do-not-undo rule, continuous-build rule) | |
| 11 | - GitHub parity scorecard (what's shipped vs missing) | |
| 12 | - Numbered build plan (Blocks A–H) | |
| 13 | - Locked components that cannot be altered without owner permission | |
| 14 | - Session workflow | |
| 15 | ||
| 16 | Do not skip it. Do not refactor locked files. Do not stop mid-block. | |
| 17 | ||
| fc1817a | 18 | ## Stack |
| 19 | ||
| 20 | - **Runtime:** Bun | |
| 21 | - **Framework:** Hono (with JSX for server-rendered views) | |
| 22 | - **Database:** Drizzle ORM + Neon (PostgreSQL) | |
| 23 | - **Git:** Smart HTTP protocol via git CLI subprocesses | |
| 24 | ||
| 25 | ## Development | |
| 26 | ||
| 27 | ```bash | |
| 28 | bun install # install dependencies | |
| 29 | bun dev # start dev server (hot reload) | |
| 30 | bun test # run tests | |
| 31 | bun run db:migrate # run database migrations | |
| 32 | ``` | |
| 33 | ||
| 34 | ## Architecture | |
| 35 | ||
| 36 | ``` | |
| 37 | src/ | |
| 43de941 | 38 | index.ts Entry point (Bun server) |
| 39 | app.tsx Hono app composition + error handlers | |
| 40 | lib/ | |
| 41 | config.ts Environment config (getters, reads env at access time) | |
| 42 | auth.ts Password hashing (bcrypt), session tokens | |
| 43 | highlight.ts Syntax highlighting (highlight.js, 40+ languages) | |
| 44 | markdown.ts Markdown rendering (GFM + syntax highlighting) | |
| fc1817a | 45 | db/ |
| 43de941 | 46 | schema.ts Drizzle schema (all tables) |
| 47 | index.ts Lazy DB connection (proxy pattern) | |
| 48 | migrate.ts Migration runner | |
| fc1817a | 49 | git/ |
| 43de941 | 50 | repository.ts Git operations (tree, blob, commits, diff, branches, blame, search, raw) |
| 51 | protocol.ts Smart HTTP protocol (pkt-line, service RPC) | |
| fc1817a | 52 | hooks/ |
| 43de941 | 53 | post-receive.ts GateTest + Crontech webhooks on push |
| 54 | middleware/ | |
| 55 | auth.ts softAuth + requireAuth middleware | |
| fc1817a | 56 | routes/ |
| 43de941 | 57 | git.ts Git HTTP endpoints (clone/push) |
| 58 | api.ts REST API (repo CRUD, setup) | |
| 59 | auth.tsx Register, login, logout (web + API) | |
| 60 | web.tsx Web UI (file browser, commits, diffs, search, blame, raw) | |
| 61 | issues.tsx Issue tracker (CRUD, comments, close/reopen) | |
| 62 | pulls.tsx Pull requests (create, review, merge, close) | |
| 63 | editor.tsx Web file editor (create/edit via git plumbing) | |
| 64 | compare.tsx Branch comparison (diff + commit list) | |
| 65 | settings.tsx User settings (profile, SSH keys) | |
| 66 | repo-settings.tsx Repository settings (description, visibility, delete) | |
| 67 | webhooks.tsx Webhook management + delivery engine | |
| 68 | fork.ts Repository forking | |
| 69 | explore.tsx Explore/discover public repos | |
| 70 | tokens.tsx Personal access tokens | |
| 71 | contributors.tsx Contributor list + commit activity graph | |
| fc1817a | 72 | views/ |
| 43de941 | 73 | layout.tsx HTML shell + CSS (dark theme) + auth-aware nav |
| 74 | components.tsx UI components (file table, commit list, diff viewer, etc.) | |
| fc1817a | 75 | ``` |
| 76 | ||
| 43de941 | 77 | ## Database Schema |
| 78 | ||
| 79 | - `users` — accounts with bcrypt password hashing | |
| 80 | - `sessions` — cookie-based auth sessions (30 day expiry) | |
| 81 | - `repositories` — repos with fork tracking, star/fork/issue counts | |
| 82 | - `stars` — user-repo star relationships | |
| 83 | - `issues` — issue tracker with open/closed state | |
| 84 | - `issue_comments` — threaded comments on issues | |
| 85 | - `labels` + `issue_labels` — issue categorization | |
| 86 | - `pull_requests` — PRs with base/head branches, open/closed/merged state | |
| 87 | - `pr_comments` — PR comments with AI review flag + file/line annotations | |
| 88 | - `activity_feed` — event log for repos | |
| 89 | - `webhooks` — registered webhook URLs with HMAC secret + event filtering | |
| 90 | - `api_tokens` — personal access tokens with SHA-256 hashing | |
| 91 | - `repo_topics` — repository tags for discoverability | |
| 92 | - `ssh_keys` — user SSH public keys | |
| 93 | ||
| fc1817a | 94 | ## Integrations |
| 95 | ||
| a4e1564 | 96 | - **GateTest:** POST `https://gatetest.ai/api/events/push` on every `git push` |
| fc1817a | 97 | - **Crontech:** POST `https://crontech.ai/api/trpc/tenant.deploy` on push to main |
| 43de941 | 98 | - **Webhooks:** POST to registered URLs on push/issue/PR/star events with HMAC signatures |
| fc1817a | 99 | |
| 100 | ## Environment Variables | |
| 101 | ||
| 102 | See `.env.example` for required variables. Key ones: | |
| 103 | - `DATABASE_URL` — Neon PostgreSQL connection string | |
| 104 | - `GIT_REPOS_PATH` — directory for bare git repos (default: `./repos`) | |
| 105 | - `PORT` — HTTP port (default: 3000) | |
| fc0785e | 106 | |
| 107 | ## Deployment | |
| 108 | ||
| 109 | - **Deployed via Crontech** — Crontech is the deployment platform (NOT Vercel, NOT Hetzner) | |
| 110 | - **Database:** Neon PostgreSQL (direct, NOT via Vercel integration) | |
| 111 | - **The green ecosystem:** Crontech deploys gluecron, gluecron hosts code, GateTest scans pushes | |
| 112 | - **NEVER suggest Hetzner** — it is not part of our infrastructure | |
| 113 | - See DEPLOY.md for full deployment instructions |