The mailbox sync (Microsoft Graph and IMAP), its Claude classifier, the /email routes and the Settings page's email section are taken out while the pipeline is unused. The last commit with it is tagged email-pipeline-last; reverting this commit brings it back. The status rules the capture path shares (statusOrder, StatusAdvances, NormalizeStatus) move to job_status.go with their tests. ProcessedEmail stays in the migration, marked dormant, so its history survives for a restored pipeline. golang.org/x/oauth2 is no longer needed. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2.4 KiB
2.4 KiB
CLAUDE.md
Guidance for Claude Code in this repository. README.md has the full picture (routes, auth, deployment, cutover).
Commands
make check # go vet ./... && go test ./..., then a vite build of web/ into a temp dir
make generate # gqlgen, after editing internal/graph/schema/*.graphql
make dev # docker compose up --build: tracker + Postgres, seeded, AUTH_MODE=dev
cd web && npm run dev # SPA hot reload; proxies /jobs/api to localhost:8080
Architecture
One Go binary (cmd/jobtracker) that serves a GraphQL API, a few REST routes and the built Vue SPA, all under /jobs. It is deployed as one container inside the web_server stack, behind its nginx, on its Postgres.
- Auth is borrowed.
internal/authforwards cookies to the site backend's/auth/validate-admin. GraphQL is guarded only by@adminon every field.internal/graph/directives_test.gofails if a Query or Mutation field lacks it. The REST admin routes useauth.Require. - Claude calls live in
internal/claude. They are ported from the site's Python service and keep its prompts and per-model request shaping. There are three error kinds:*ReadError(safe to show the user),ErrNotConfigured, and a wrapped context error. Callers branch on them; keep that contract. The services take small interfaces (LeadScorer,PostingExtractor), so tests use fakes. - GraphQL types bind directly to GORM models (
gqlgen.yml).ID uintbinds throughgraphql.UintID. - The SPA is served from disk (
STATIC_DIR,/app/staticin the image) byhandlers.SPA. It is gin'sNoRoutehandler, so history-mode paths fall back toindex.html.
Conventions
- Comments explain why, not what. Preserve them; update them when behaviour changes.
- Resolver commentary lives inside function bodies. gqlgen strips or moves anything above a resolver's signature.
- Schema files use
#comments, not"""descriptions. - Models are soft-deleted except
ProcessedEmailandJobLead, whose dedup must see history, and the single-rowJobSearchProfile.ProcessedEmailis dormant: the email pipeline was removed (tagemail-pipeline-last), but the table is still migrated so its history survives. - Job status: see "Things that are easy to get wrong" in README.md for the copies that must be edited by hand.
- The userscript: bump
@versioninweb/public/job-capture.user.json every edit.