The tracker recorded applications but could not find jobs. A new pipeline (services/job_leads.go, job_sources.go) polls a watch list of sources on a timer or on request, files unseen postings as leads, marks which pass a keyword and location pre-filter, and has Claude score those against a single search profile through a fourth internal Python route, /internal/jobs/score. Sources are Greenhouse, Lever and Ashby company boards (public JSON) and Adzuna and Reed keyword searches (API keys). The two search fetchers are written from the providers' documentation and tested only against stubs. Leads are their own table, not a job status, and are not soft deleted: the (source_kind, external_id) index is the dedup, so a dismissed lead has to remain a row. A lead reaches the tracker only by promotion, which goes through UpsertJobApplication. That upsert moves from the capture handler into services so promotion and the fetcher can share it; the capture endpoint's behaviour is unchanged. /cv/leads is the page: inbox, watch list and profile form. The timer is off unless JOB_LEADS_ENABLED=true and never runs at start-up, so a deploy spends no Claude calls. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Backend
The Go API for adam-french.co.uk. It is one process behind nginx, serving a GraphQL endpoint, a handful of REST endpoints, and the chat WebSocket, backed by PostgreSQL and a few third-party APIs (Spotify, Steam, Gitea). Anything that needs Claude is asked of the Python service, not called from here.
Nginx strips the /api prefix before proxying, so a browser request to
/api/graphql arrives here as /graphql. Every path below is as this service
sees it.
Layout
main.go wiring: env -> services -> Store -> routes
models/models.go GORM entities, which are ALSO the GraphQL object types
handlers/ REST endpoints + the shared Store dependency container
store.go Store: DB, service handles, and the third-party caches
handle_*.go one file per domain
services/ stateful collaborators (DB, auth, chat hub, API clients)
graph/ GraphQL layer
schema/*.graphql source of truth for the schema, including who may call what
*.resolvers.go resolver implementations, one per schema file
*_helpers.go hand-written mapping helpers (never regenerated)
directives.go @admin / @signedIn: the authorisation checks, written once
directives_test.go fails when a mutation is added without one
context.go reading identity out of the resolver context
middleware.go putting it in
doc.go package overview — read this before touching resolvers
generated.go GENERATED, do not edit
model/models_gen.go GENERATED, do not edit
Request lifecycle
- Nginx terminates TLS, applies its own rate limits, strips
/api, and proxies to this service. - Gin routes the request.
SetTrustedProxiespins the Docker network CIDR so thatClientIP()— which the login rate limiter keys on — cannot be spoofed viaX-Forwarded-For. - REST: the route's middleware chain runs.
AuthMiddlewearrequires a valid access token and stashes the claims in the Gin context;AdminMiddlewarethen requiresadmin: truein those claims. A handler reached through theadmingroup can assume both. - GraphQL: there is no guarding middleware.
AuthContextMiddlewareonly annotates the request context with the Gin context and, if a valid access token is present, the JWT claims — and then lets everything through. A field is guarded by a directive on it in the schema,@adminor@signedIn, which runs before the resolver. A field with neither is public. See GraphQL authorisation. - Handlers and resolvers both reach the database and the caches through the
single
handlers.Storebuilt inmain.
Auth
POST /auth/login(or theloginmutation) checks a bcrypt hash and sets two cookies, bothHttpOnly+Secure+SameSite=Lax:access_token(7 days) carriesid,username,admin, so ordinary requests authorise without a database hit;refresh_token(365 days) carries onlyid.
POST /auth/refresh(or therefreshTokenmutation) exchanges the refresh token for a new pair, re-reading the user — and therefore the admin flag — from the database.GET /auth/validate-adminanswers with a bare status code (200 / 403 / 401) and will transparently refresh, so returning admins are recognised without a visible re-login.- Tokens are stateless. Logout only clears the browser's cookies; nothing is revoked server-side, and a token that has already been issued stays valid until it expires. The same is true of demoting an admin: it takes effect on their next refresh, not immediately.
The two implementations (REST in handlers/handle_auth.go, GraphQL in
graph/auth.resolvers.go) are parallel by design, since the front end uses
both. They share services.Auth and the rate limiter, but each has its own
cookie-writing helper — change one and you must change the other.
GraphQL authorisation
Who may call a field is written in the schema, on the field:
extend type Query {
bookmarks: [Bookmark!]! # public
places: [Place!]! @signedIn # any signed-in user
users: [User!]! @admin # admins only
}
| directive | passes when | error otherwise |
|---|---|---|
@admin |
the access token's admin claim is true |
admin access required |
@signedIn |
there is a valid access token at all | authentication required |
| (none) | always | — |
Both are declared in graph/schema/schema.graphql, implemented once in
graph/directives.go, and handed to gqlgen in main.go
(graph.Config{Directives: graph.Directives()}). gqlgen calls the directive
before the resolver; on an error the resolver never runs and the client gets
that message for the field. The two strings are shown as-is by the front end,
so they are part of the API. If the Directives line were ever dropped from
main.go the guarded fields would all fail (directive admin is not implemented), not open.
This replaced an if !IsAdminFromCtx(ctx) { return ... } that was pasted into
the top of every guarded resolver, where leaving it out was invisible. Now a
guarded resolver has no check in it, and the absence of a guard is something a
test can see.
What is guarded. Queries are public and mutations are @admin, except:
login,logout,refreshToken— public; they are how a session starts and ends.createPlace,updatePlace,deletePlaceand theplacesquery —@signedIn. Places are a shared list with no per-user ownership.users,user,jobApplications,jobApplication,jobAppReferences— queries, but@admin: private data.
What a directive cannot say stays in the resolver, using IsAdminFromCtx /
UserIDFromCtx from graph/context.go:
updatePost/deletePostare@adminand require the caller to be the post's author;setUserAdminrefuses to change the caller's own flag.mehas no directive: it returns its ownunauthorizederror.messageshas no directive: it filters private messages out for non-admins instead of refusing.spotifyNeedsReauthhas no directive: it isfalsefor non-admins.
The safety net is graph/directives_test.go, which walks the parsed
schema:
- every
Mutationfield must carry@adminor@signedIn, unless it is in thepublicMutationslist in that file (the three above). A new mutation with no directive fails the build's tests until one or the other is done; - the
@signedInmutations and the guarded queries are pinned by name, so loosening@adminto@signedIn, or dropping a guard from a private query, has to be done in the test as well; - the directive functions are unit-tested, and a handful of operations are run through the real executable schema to pin the messages on the wire.
One caveat: the test reads the .graphql files, but enforcement is in
generated.go. Adding a directive to an existing field does nothing until
gqlgen is re-run.
Adding an entity
- Model — add the struct to
models/models.gowithID uint(gorm:"primarykey") and agorm.DeletedAt, and list it inAutoMigrateinservices/database.go. There are no migration files. - Schema — add
graph/schema/<name>.graphqlwith the type, its inputs, andextend type Query/extend type Mutation. Put@adminor@signedInon every mutation, and on any query that is not for the public. Use#comments, not"""descriptions. - Binding — map the type onto the model in
gqlgen.yml, withdeletedAt: resolver: false. Without the entry gqlgen generates a second, unrelated struct ingraph/model/. - Generate —
go run github.com/99designs/gqlgen generate(below). This createsgraph/<name>.resolvers.gowith a stub per query and mutation. - Resolvers — fill the stubs in. Do not write an auth check; the
directive has run. Do not write an
IDresolver;ID uintbinds by itself (see IDs). Put commentary inside the function bodies, since gqlgen rewrites what is above the signature. A delete should load the row first and return an error for a missing id, as the existing ones do. - Test —
go test ./....directives_test.gowill tell you if a mutation was left unguarded; if you added a guarded query, add it to the pinned list there.
GraphQL vs REST
GraphQL is the default and covers essentially all the site's data. REST exists for the things GraphQL cannot do:
| REST endpoint | why it is not GraphQL |
|---|---|
/auth/* |
cookie handling and the status-code-only admin probe |
/spotify/callback, /email/callback |
OAuth providers redirect a browser here |
/messages/upload, /radio/upload, /rowing (POST) |
multipart file uploads |
/notes/*path |
streams a file download, not JSON |
/ws |
WebSocket upgrade |
/rowing (GET), /spotify/listening, /spotify/recent |
predate the equivalent queries; kept working |
/admin/env, /admin/logs, /admin/capture-token |
process environment and files on disk, not the data model |
/jobs/capture, /jobs/capture/status, /jobs/capture/extract |
called by a userscript on other sites' origins, where the SameSite=Lax auth cookies are never sent; they take a bearer token instead |
Environment tab
handlers/handle_env.go and services/env_manager.go let the admin panel
change .env on the Pi without SSH. The backend never reads or writes the
file and has no Docker access: it validates an edit and leaves it for the
host, which is the part trusted to act.
services/env_registry.jsonlists every variable in.env.examplewith its group, kind, whether it is editable, and the compose services that read it. It is embedded in the binary and read from the checkout by the host script, so one file decides what the panel offers and what the host accepts. A test fails if it and.env.exampledisagree.- The
pythonservice is a third place. It is the one container given an explicitenvironment:list indocker-compose.ymlinstead of the whole.env, so that it never holds the database password or the JWT secret. A new Python variable therefore goes in the registry (withpythonin itsservices), in.env.example, and in that list.TestEnvRegistryMatchesComposePythonEnvironmentreads the compose file and fails if a variable the registry says python reads is not passed to it, or if an editable variable passed to it does not listpython. Locked variables carry noservicesand are exempt (PYTHON_PORTis one). GET /admin/env— the registry plus state from this process's own environment. A secret's value is never sent, only "set" and, for values of 12+ characters, the last four.PUT /admin/env—{"set": {NAME: value}, "generate": [NAME]};""clears. The whole batch is validated first. Control characters are refused because.envis line oriented: a newline would let an edit to an allowed variable write a second, arbitrary one. Generated values (32 random bytes, hex) are returned once.- The change is written to
/backend/env-apply/request.json(./env-apply/runon the host),0600and chowned to that directory's owner so the unprivileged host user can read it.env-apply/apply.pyclaims it, rewrites.env, recreates the affected services and writesstatus.json. GET /admin/env/status—idle,pending,applying,appliedorfailed.watcher: falsemeans a request has sat unclaimed for 15 seconds, i.e. nothing on the host is watching.DELETE /admin/env/pendingwithdraws an unclaimed request.
The backend is always among the recreated services, because the values the panel shows are the ones this process started with.
Job capture
handlers/handle_job_capture.go is the server half of the browser userscript
(vue/public/job-capture.user.js, installed from the tracker page) that adds
the posting open in the browser to the job tracker.
- Auth is
Authorization: Bearer <token>, checked byCaptureTokenMiddleware. The token opens these three routes and nothing else — it cannot read the tracker or reach GraphQL. With no token generated the routes are off (503); that never means "no auth". - The token is generated in the admin panel, not set in
.env(services/capture_token.go;GET/POST/DELETE /admin/capture-token, cookie-authenticated like the rest of the admin group). It is 32 random bytes, shown once; only its SHA-256 is kept, in/backend/token/job_capture_token.jsonbeside the OAuth tokens, so it survives restarts and rebuilds. There is one token at a time: generating again replaces it, which is how a leaked one is rotated. GET /jobs/capture/status?url=— is this posting already tracked, and at what status. Drives the script's badge.POST /jobs/capture/extract— page text in,{jobTitle, company, location, notes}out, read by Claude through the Python service (/internal/jobs/extract, see Calling the Python service). Stores nothing.POST /jobs/capture— an upsert. A posting is matched by its canonical URL (services.CanonicalJobURLstrips tracking parameters and folds LinkedIn's several URL shapes into one), then by(company, job title)the way the email pipeline matches (services.UpsertJobApplication, shared with lead promotion). A repeat capture only ever adds: status moves forwards, empty fields are filled, nothing is overwritten.
The upsert is what keeps this and the email pipeline from making two rows for one application. It is not watertight: the pipeline still matches on the exact title, so a posting captured as "Senior Engineer" whose confirmation email says "Senior Engineer (Platform)" becomes a second row.
Job leads
Where the tracker records applications, this finds postings. It is GraphQL
throughout (graph/schema/job_lead.graphql, all @admin) with the work in
services/job_leads.go and services/job_sources.go; the page is /cv/leads.
- Three tables.
JobSourceis one thing to poll: a company's board on Greenhouse, Lever or Ashby (public JSON, no key), or a keyword search on Adzuna or Reed (keys in.env).JobLeadis one posting found. It is not soft deleted, likeProcessedEmail: the unique index on(source_kind, external_id)is the dedup, and it only keeps a dismissed lead dismissed if that lead is still a row.JobSearchProfileis a single row: the profile text, three keyword lists and a minimum score. - A run (
JobLeadService.Run) is fetch → store → pre-filter → score. Every enabled source is polled; one failing records its error on the source and the rest carry on. Postings not seen before become leads; ones already known only havelast_seen_atmoved. A posting whose canonical URL is already in the tracker is filed aspromoted, linked to that application, so the inbox never offers it. - The pre-filter is keywords on the title and location, no Claude. It
exists because a company board is mostly irrelevant, and it decides which
leads are shown and which cost a call.
matchedis recomputed for every inbox lead on each run, so editing the keywords applies to old leads too. - Scoring sends each matched, unscored lead and the profile text to the
Python service's
/internal/jobs/score. At most 40 a run, newest first; a lead Claude cannot score is retried on three runs and then left. With an empty profile nothing is scored. If scoring is unavailable (no API key, Python down) the run stops scoring without spending an attempt on any lead. - When it runs.
JOB_LEADS_ENABLED=truestarts a timer (JOB_LEADS_INTERVAL, default6h); it does not run at start-up, so a deploy spends nothing. TherunJobLeadSyncmutation starts a run in a goroutine and returns at once, whether or not the timer is on, andjobLeadSyncStatusreports on it — a run can take minutes, so unlikePOST /email/syncit does not hold the request open. The status is in memory and resets on restart. - Promotion (
promoteJobLead) is the only way a lead reaches the tracker. It callsservices.UpsertJobApplicationwith statussaved, the lead's text and a notes line carrying the score — the same upsert as the capture endpoint, so a posting captured from the browser in the meantime is linked to, not duplicated.
The Adzuna and Reed response structs were written from the providers'
documentation, not against live responses (they need keys). If one of those
sources reports a decode error or zero results, compare its struct in
job_sources.go with a real reply first. Adzuna only returns a snippet of
each description, so its leads are scored on less text.
Most of this needs Postgres and has no unit test: what is tested is the fetchers (against stub servers), the pre-filter, how a fetched posting becomes a row, and the scoring call.
Calling the Python service
Every Claude call the site makes lives in the Python service; this backend has
no Anthropic client and does not read CLAUDE_API_KEY. It reaches four
internal routes directly over the Docker network
(http://$PYTHON_HOST:$PYTHON_PORT, default python:8000), never through
nginx, which answers 404 for /py/internal/:
| route | caller | sends | gets back |
|---|---|---|---|
/internal/rowing/read |
POST /rowing (handlers/handle_rowing.go) |
{media_type, data} (image, base64) |
{timeMinutes, timeSeconds, distance} |
/internal/jobs/extract |
POST /jobs/capture/extract (handlers/handle_job_capture.go) |
{url, title, text} |
{jobTitle, company, location, notes} |
/internal/jobs/score |
the lead pipeline (services/job_leads.go) |
{profile, jobTitle, company, location, description} |
{score, reasons} |
/internal/email/classify |
the email pipeline (services/email_sync.go) |
{message} |
EmailAnalysis (below) |
All four go through one function, services.CallPython[T] in
services/python_call.go: marshal the body, POST it, decode a 200 into T.
It has the one HTTP client (two-minute timeout, above the Python side's own
worst case of a retried Claude call) and the one rule for failures:
- a 502 whose
detailis a string is a message the route wrote for a person ("failed to parse image data"). It comes back as a*services.PythonError, and the two HTTP handlers relay it to the browser; - anything else — connection refused, a 422 (its
detailis a list), a 503 for an unsetCLAUDE_API_KEY, a reply that will not decode — is an ordinary error. Callers log it and show something generic.
It lives in services because both handlers and services need it and
handlers already imports services. A new internal route needs only a
request struct, a reply struct and a one-line call.
Services
Everything is constructed in main from environment variables and handed to
handlers.Store. Nothing here fails start-up: a missing Spotify token, an
unconfigured mailbox or an absent Steam key all just leave that feature
dormant, which is why callers nil-check Store.SpotifyClient and friends.
-
database.go — Postgres via GORM. There are no migration files:
AutoMigrateis the whole schema story, so it adds tables/columns but never drops or renames, and a new model must be listed there to get a table. -
auth.go — HS256 JWT minting and verification.
-
ratelimit.go — in-memory per-IP sliding window (5 logins/minute). Process-local and never evicts keys.
-
websocket.go — the chat hub. A package-level singleton: one connection set, one mutex, one DB handle. Public, with admin connections additionally able to see/send private messages and delete.
-
spotify.go, steam.go, gitea.go — third-party reads. Results are cached on
Storewith TTLs of 1 min (Spotify recent, Gitea) and 5 min (Steam). -
email_sync.go / email_imap.go — the job-application pipeline: fetch recent mail (Microsoft Graph or a hand-rolled IMAP client), keyword-filter it, have each survivor classified, create or advance a
JobApplication. Runs on a timer and can be triggered by an admin.The classification is the Python service's
/internal/email/classify, which owns the prompt, the Claude call and the parsing of the model's reply. Go sends one string —Subject:,From:andDate:lines, a blank line, the cleaned body (capped at 4,000 bytes; the whole message at the 200,000 characters Python accepts) — and gets backEmailAnalysis:isJobEmail,action,company,jobTitle,status, and the nullablelocation,url,appliedAt,notes. Everything either side of that call is unchanged and still here: the pre-filter, dedup, retry accounting, matching on (company, job title), and the forward-only status rule. Any failure of the call, whatever its status code, is a failed attempt at that email. -
job_leads.go / job_sources.go — the job-lead pipeline. See Job leads.
-
job_upsert.go —
UpsertJobApplication, the one way a posting is added to the tracker without duplicating a row: used by the capture endpoint and by promoting a lead. -
python_call.go —
CallPython, the one way to reach the Python service's internal routes. See Calling the Python service. -
job_status.go — how the
JobStatusGraphQL enum is read and written. See Job status. -
notes.go — path-traversal-safe file lookup for the notes directory.
-
seed.go — dev-only test data. Creates an admin with the password
password, so it must never run in production (SEED_DB=trueis set only indocker-compose.dev.yml).
Job status
A job application's status is one of eight lowercase strings: saved,
applied, screening, assessment, interviewing, offer, rejected,
withdrawn. The list is statusOrder in services/email_sync.go, which also
ranks them — the email pipeline and the capture endpoint only ever move a row
forwards through it (services.StatusAdvances).
GraphQL knows the same list as enum JobStatus
(graph/schema/job_application.graphql), used for JobApplication.status and
both inputs. TestJobStatusEnumMatchesStatusOrder in
services/job_status_test.go parses the schema file and fails unless the enum
and the map hold the same statuses in the same order, so adding a status means
editing both. (The classifier prompt in the Python service, the tracker page
and the userscript list them too, and nothing checks those.)
The enum is bound in gqlgen.yml to services.MarshalJobStatus /
UnmarshalJobStatus instead of a generated Go type, for two reasons:
- The column stays a
string.models.JobApplication.Statusbinds as it is; there is no migration and no conversion in the pipeline. - Input is strict, output is lenient. A mutation with a status outside the
list is refused (
"hired" is not a valid JobStatus) — nothing is coerced toappliedany more. But a row already holding something else, such as the Title Case values the tracker once wrote, must not break reads:statusis non-null, so a serialisation error on one row would null the entirejobApplicationslist. On the way out a value that matches once trimmed and lowercased is sent in its canonical form, and anything else is sent exactly as stored for the tracker to display and correct.
On the wire nothing changed from when the field was a String: the client
sends "applied" as a JSON string variable and reads back "applied". (An
enum does differ for a status written inline in a query document, which must
now be status: applied, unquoted. The front end only uses variables.)
services.NormalizeStatus, which trims, lowercases and falls back to
applied, is still what the email pipeline and POST /jobs/capture use on
values that do not come through GraphQL.
Regenerating gqlgen
The .graphql files are the source of truth.
cd backend && go run github.com/99designs/gqlgen generate
If that stops with missing go.sum entry ... urfave/cli, the generator's own
dependencies are not in go.sum. go get github.com/99designs/gqlgen@<the version in go.mod> adds them.
This rewrites graph/generated.go and graph/model/models_gen.go and adds
stubs for new fields to the matching *.resolvers.go. Existing resolver bodies
are preserved, but hand-written code in a regenerated file can be relocated to
the end of it — which is why shared helpers live in *_helpers.go instead.
gqlgen.yml maps most GraphQL object types directly onto the GORM structs in
models/, so graph/model/ holds only input and payload types. Adding a type
to the schema without a corresponding entry in gqlgen.yml gets you a fresh
generated struct rather than the model you expected.
Two scalar-level bindings in gqlgen.yml are worth knowing about: ID lists
both graphql.IntID and graphql.UintID (see IDs under Gotchas), and
JobStatus points at the hand-written marshaller described above.
If you delete a field or stop needing a resolver, delete the resolver function by hand before regenerating; otherwise gqlgen keeps it, commented out, in a warning block at the end of the file.
Gotchas
- Soft delete everywhere. Every model except
ProcessedEmailhas agorm.DeletedAt, soDeletesets a timestamp and later queries filter the row out. Rows are never actually removed, and auniqueIndexstill collides with deleted rows — a soft-deleted username cannot be reused. Preloadis not lazy.Post.Authoris nil unless the query preloads it; there is no error to tell you why the field came back null.- IDs. Models use
uint; the schema usesID.gqlgen.ymlbindsIDtographql.IntIDandgraphql.UintID, so a model'sID uintfield is served directly — there are noIDresolvers, and a new type does not need one.IntIDis listed first, which is why resolver arguments are stillid int. Both write an id as a quoted decimal string ("12") and accept a string or a number, so the wire format is the same either way. Other unsigned fields are not IDs and still have resolvers:Message.authorId,Rowing.time,Rowing.distance. - Deletes error on a missing id. Every delete mutation loads the row
first.
deleteJobApplicationanddeleteJobAppReferencereturnBoolean!rather than the row, so the only value they ever return istrue; a wrong id is arecord not founderror, notfalse. Message.AuthorIDis not a user id. It is a per-process counter handed out by the chat hub on connect, meaningless across restarts.- The chat table is capped. Every insert soft-deletes all but the newest 50 messages.
- Store's caches are unsynchronised and shared by all requests. The races are benign (at worst a duplicate upstream fetch), but do not add a field there that would be unsafe to tear.
- Claude's output is never parsed here. Prompts, the markdown-fence stripping and the JSON parsing are all in the Python service; this side receives typed JSON or an error (see Calling the Python service).
- The email pipeline retries a failure up to
maxEmailAttempts(3) times. A failed email is recorded with action"error"and an attempt counter; while it has attempts left the next sync reprocesses it and updates the same row. Because the fetch window is anchored to processing time, which has already moved past the failure, the sync also rewinds the window to the oldest retryable row'sReceivedAt— otherwise the email could never be re-fetched. Once the cap is reached the row is terminal, so an email Claude can never parse stops costing API calls. A failure is any error from the classify call — Python down, a 502, a 503 becauseCLAUDE_API_KEYis unset — so an outage of the Python service uses up attempts just as an Anthropic outage does. The one exception is a cancelled sync, which records nothing. - Authenticating email after start-up does not start the scheduler, which only checks readiness once — restart, or trigger syncs by hand.
- Introspection and the playground are off unless
DEV_MODE=trueandGQL_INTROSPECTION/GQL_PLAYGROUNDare set. - No graceful shutdown.
r.Runblocks forever and its error is ignored; the container is simply killed.
Environment
| var | purpose |
|---|---|
POSTGRES_USER / _PASSWORD / _DB / _HOST / _PORT |
database connection |
BACKEND_PORT |
listen port |
BACKEND_SECRET |
JWT signing secret |
BACKEND_ENDPOINT |
this service's public base URL |
DOMAIN |
auth cookie domain and WebSocket origin allow-list |
DEV_MODE |
release vs debug Gin; gates the two GraphQL dev flags |
SEED_DB |
seed dev test data (never in production) |
GQL_INTROSPECTION / GQL_PLAYGROUND |
dev-only GraphQL extras |
SPOTIFY_CLIENT_ID / _SECRET / _REDIRECT_URI / SPOTIFY_AUTH_STATE |
Spotify OAuth |
PYTHON_HOST / PYTHON_PORT |
Python service, for the four Claude routes (default python:8000) |
GITEA_HOST / GITEA_PORT |
Gitea activity feed |
STEAM_API_KEY / STEAM_ID |
Steam presence |
EMAIL_SYNC_ENABLED / EMAIL_BACKEND / EMAIL_SYNC_INTERVAL |
email pipeline (graph or imap) |
JOB_LEADS_ENABLED / JOB_LEADS_INTERVAL |
lead pipeline timer (default off, 6h) |
ADZUNA_APP_ID / ADZUNA_APP_KEY / REED_API_KEY |
keyword-search lead sources; optional |
MSGRAPH_CLIENT_ID / _SECRET / _TENANT_ID / _REDIRECT_URI |
Microsoft Graph backend |
IMAP_HOST / _PORT / _EMAIL / _PASSWORD |
IMAP backend |
Paths baked into the code, all inside mounted volumes so they survive a
container restart: /backend/logs, /backend/notes, /backend/uploads,
/backend/fallback_music, /backend/token/ (Spotify and Microsoft Graph
OAuth tokens).
CLAUDE_API_KEY is not in the table: the backend does not read it. It is in
the registry with services: ["python"], because the Python service is the
only container that uses it.