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 | ||
| 5 | ## Stack | |
| 6 | ||
| 7 | - **Runtime:** Bun | |
| 8 | - **Framework:** Hono (with JSX for server-rendered views) | |
| 9 | - **Database:** Drizzle ORM + Neon (PostgreSQL) | |
| 10 | - **Git:** Smart HTTP protocol via git CLI subprocesses | |
| 11 | ||
| 12 | ## Development | |
| 13 | ||
| 14 | ```bash | |
| 15 | bun install # install dependencies | |
| 16 | bun dev # start dev server (hot reload) | |
| 17 | bun test # run tests | |
| 18 | bun run db:migrate # run database migrations | |
| 19 | ``` | |
| 20 | ||
| 21 | ## Architecture | |
| 22 | ||
| 23 | ``` | |
| 24 | src/ | |
| 43de941 | 25 | index.ts Entry point (Bun server) |
| 26 | app.tsx Hono app composition + error handlers | |
| 27 | lib/ | |
| 28 | config.ts Environment config (getters, reads env at access time) | |
| 29 | auth.ts Password hashing (bcrypt), session tokens | |
| 30 | highlight.ts Syntax highlighting (highlight.js, 40+ languages) | |
| 31 | markdown.ts Markdown rendering (GFM + syntax highlighting) | |
| fc1817a | 32 | db/ |
| 43de941 | 33 | schema.ts Drizzle schema (all tables) |
| 34 | index.ts Lazy DB connection (proxy pattern) | |
| 35 | migrate.ts Migration runner | |
| fc1817a | 36 | git/ |
| 43de941 | 37 | repository.ts Git operations (tree, blob, commits, diff, branches, blame, search, raw) |
| 38 | protocol.ts Smart HTTP protocol (pkt-line, service RPC) | |
| fc1817a | 39 | hooks/ |
| 43de941 | 40 | post-receive.ts GateTest + Crontech webhooks on push |
| 41 | middleware/ | |
| 42 | auth.ts softAuth + requireAuth middleware | |
| fc1817a | 43 | routes/ |
| 43de941 | 44 | git.ts Git HTTP endpoints (clone/push) |
| 45 | api.ts REST API (repo CRUD, setup) | |
| 46 | auth.tsx Register, login, logout (web + API) | |
| 47 | web.tsx Web UI (file browser, commits, diffs, search, blame, raw) | |
| 48 | issues.tsx Issue tracker (CRUD, comments, close/reopen) | |
| 49 | pulls.tsx Pull requests (create, review, merge, close) | |
| 50 | editor.tsx Web file editor (create/edit via git plumbing) | |
| 51 | compare.tsx Branch comparison (diff + commit list) | |
| 52 | settings.tsx User settings (profile, SSH keys) | |
| 53 | repo-settings.tsx Repository settings (description, visibility, delete) | |
| 54 | webhooks.tsx Webhook management + delivery engine | |
| 55 | fork.ts Repository forking | |
| 56 | explore.tsx Explore/discover public repos | |
| 57 | tokens.tsx Personal access tokens | |
| 58 | contributors.tsx Contributor list + commit activity graph | |
| fc1817a | 59 | views/ |
| 43de941 | 60 | layout.tsx HTML shell + CSS (dark theme) + auth-aware nav |
| 61 | components.tsx UI components (file table, commit list, diff viewer, etc.) | |
| fc1817a | 62 | ``` |
| 63 | ||
| 43de941 | 64 | ## Database Schema |
| 65 | ||
| 66 | - `users` — accounts with bcrypt password hashing | |
| 67 | - `sessions` — cookie-based auth sessions (30 day expiry) | |
| 68 | - `repositories` — repos with fork tracking, star/fork/issue counts | |
| 69 | - `stars` — user-repo star relationships | |
| 70 | - `issues` — issue tracker with open/closed state | |
| 71 | - `issue_comments` — threaded comments on issues | |
| 72 | - `labels` + `issue_labels` — issue categorization | |
| 73 | - `pull_requests` — PRs with base/head branches, open/closed/merged state | |
| 74 | - `pr_comments` — PR comments with AI review flag + file/line annotations | |
| 75 | - `activity_feed` — event log for repos | |
| 76 | - `webhooks` — registered webhook URLs with HMAC secret + event filtering | |
| 77 | - `api_tokens` — personal access tokens with SHA-256 hashing | |
| 78 | - `repo_topics` — repository tags for discoverability | |
| 79 | - `ssh_keys` — user SSH public keys | |
| 80 | ||
| fc1817a | 81 | ## Integrations |
| 82 | ||
| 83 | - **GateTest:** POST `https://gatetest.ai/api/scan/run` on every `git push` | |
| 84 | - **Crontech:** POST `https://crontech.ai/api/trpc/tenant.deploy` on push to main | |
| 43de941 | 85 | - **Webhooks:** POST to registered URLs on push/issue/PR/star events with HMAC signatures |
| fc1817a | 86 | |
| 87 | ## Environment Variables | |
| 88 | ||
| 89 | See `.env.example` for required variables. Key ones: | |
| 90 | - `DATABASE_URL` — Neon PostgreSQL connection string | |
| 91 | - `GIT_REPOS_PATH` — directory for bare git repos (default: `./repos`) | |
| 92 | - `PORT` — HTTP port (default: 3000) |