Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
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.

CLAUDE.mdBlame105 lines · 1 contributor
fc1817aClaude1# gluecron
2
3AI-native code intelligence platform — git hosting, automated CI, and green ecosystem enforcement.
4
9ab6971Claude5## READ FIRST — every session
6
7**`BUILD_BIBLE.md` is mandatory reading for every Claude agent before any code changes.**
8
9It 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
16Do not skip it. Do not refactor locked files. Do not stop mid-block.
17
fc1817aClaude18## 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
28bun install # install dependencies
29bun dev # start dev server (hot reload)
30bun test # run tests
31bun run db:migrate # run database migrations
32```
33
34## Architecture
35
36```
37src/
43de941Claude38 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)
fc1817aClaude45 db/
43de941Claude46 schema.ts Drizzle schema (all tables)
47 index.ts Lazy DB connection (proxy pattern)
48 migrate.ts Migration runner
fc1817aClaude49 git/
43de941Claude50 repository.ts Git operations (tree, blob, commits, diff, branches, blame, search, raw)
51 protocol.ts Smart HTTP protocol (pkt-line, service RPC)
fc1817aClaude52 hooks/
43de941Claude53 post-receive.ts GateTest + Crontech webhooks on push
54 middleware/
55 auth.ts softAuth + requireAuth middleware
fc1817aClaude56 routes/
43de941Claude57 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
fc1817aClaude72 views/
43de941Claude73 layout.tsx HTML shell + CSS (dark theme) + auth-aware nav
74 components.tsx UI components (file table, commit list, diff viewer, etc.)
fc1817aClaude75```
76
43de941Claude77## 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
fc1817aClaude94## Integrations
95
96- **GateTest:** POST `https://gatetest.ai/api/scan/run` on every `git push`
97- **Crontech:** POST `https://crontech.ai/api/trpc/tenant.deploy` on push to main
43de941Claude98- **Webhooks:** POST to registered URLs on push/issue/PR/star events with HMAC signatures
fc1817aClaude99
100## Environment Variables
101
102See `.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)