An app shell with a sidebar (a top bar on phones) replaces the per-page headers and back links. A token-based design system in styles.css, with a dark set under prefers-color-scheme, replaces the paper palette and the cv-btn/ja-input classes ported from the main site. - Applications: header with counts and the follow-up total, the add form behind a "New application" button, coloured pipeline tiles, a "Needs follow-up" filter, sort indicators, icon row actions, compact phone cards. Quick reference sits beside the table on wide screens. - Leads: profile and sources side by side, underline tabs, score rings, source health dots. - Settings: status cards for capture and email. No API or store changes. jobs-shared.css and the unused Creato font are removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01CiMoE29eGkJtia4hCzSKzT
Job tracker
A private tracker for job applications, served at /jobs/ on adam-french.co.uk. It has four parts:
- Applications (
/jobs/): the list, the pipeline view and the Quick Reference snippets. - Leads inbox (
/jobs/leads): postings the server finds on Greenhouse, Lever and Ashby boards and in Adzuna and Reed searches, scored by Claude against a search profile. - Email pipeline: reads the mailbox (Microsoft Graph or IMAP), has Claude classify recruitment mail, and creates or advances applications.
- Capture userscript (
web/public/job-capture.user.js): adds the posting open in the browser.
It was split out of the web_server repo, where it lived inside the site's Go backend, Python service and Vue app. It is now one Go binary that serves its own Vue SPA. It runs as one container behind the site's nginx and borrows the site's login.
Layout
cmd/jobtracker/ main: reads the environment, wires everything, registers routes
internal/auth/ is this request the admin? (asks the site backend)
internal/claude/ the three Claude calls: read a posting, score a lead, classify an email
internal/graph/ gqlgen GraphQL: schema/*.graphql is the source of truth
internal/handlers/ REST: capture routes, capture token, email controls, SPA file server
internal/models/ GORM models (six tables)
internal/services/ lead pipeline, job sources, email sync (Graph + IMAP), upsert, status vocabulary
web/ Vue 3 + Vite SPA, built for base /jobs/
Routes
Everything is served under BASE_PATH (/jobs). nginx proxies the prefix through unchanged.
| Path | Auth | What |
|---|---|---|
/jobs/, /jobs/leads, /jobs/settings |
none (the data behind them is admin-only) | SPA |
POST /jobs/api/graphql |
@admin on every field |
everything the pages show and edit |
/jobs/api/capture, /capture/status, /capture/extract |
bearer capture token | the userscript |
/jobs/api/admin/capture-token (GET/POST/DELETE) |
admin | the token, from the Settings page |
GET /jobs/api/email/status, POST /jobs/api/email/sync |
admin | email controls on the Settings page |
GET /jobs/api/email/callback |
open (Microsoft redirects here) | Graph OAuth |
GET /jobs/api/health |
open | healthcheck: process up and database reachable |
Auth
There are no accounts here. internal/auth forwards the browser's Cookie header to the site backend's GET /auth/validate-admin, which is the same check nginx uses for /radio/admin and /sb, and treats a 2xx as "admin".
- Expired access token:
validate-adminfalls back to the refresh token and answers with new cookies. ThoseSet-Cookieheaders are relayed to the browser. - Caching: a "yes" is cached for 30 seconds per cookie, so logging out takes up to 30 seconds to reach the tracker.
- Lapsed session: the SPA sends the browser to the site's
/admin/login?redirect=/jobs/...(web/src/session.js).
AUTH_MODE=dev admits everyone, for the standalone compose. It is refused unless DEV_MODE=true.
Development
make check # go vet + go test, and a vite build
make generate # after editing internal/graph/schema/*.graphql
make dev # docker compose up --build: tracker + Postgres, seeded, no login
Then open http://localhost:8080/jobs/. Set CLAUDE_API_KEY in your shell or a .env to try the Claude features.
For SPA hot reload, run make dev (or the Go binary) and then cd web && npm run dev. Vite proxies /jobs/api to localhost:8080; see web/vite.config.js.
Every variable is listed and explained in .env.example.
Running inside web_server
The site's docker-compose.yml runs the published image as service jobs, with an explicit environment: list rather than env_file, so the site's other secrets stay out of the container. The site's nginx routes /jobs/ to it. The site's Postgres container holds the data, in its own jobs database and role. ./jobs-data is mounted at /data; the container runs as uid 1000, so chown 1000 jobs-data on the host.
Deploying
A push to main here runs .gitea/workflows/ci.yaml. It tests, builds and pushes adam-french.co.uk/adamf/job-tracker:<sha> and :latest, then rolls the site onto the new image and waits for the container's healthcheck. A tracker that does not come up healthy fails the run, with its last log lines in the output.
The roll-out is the same command you would run by hand on the Pi:
cd ~/deploy/web_server && docker compose pull jobs && docker compose up -d --no-deps jobs
To pin a version, set JOBS_IMAGE_TAG=<sha> in the site's .env. While it is pinned, pushes here still publish but change nothing live. To roll back, pin the last good sha.
One-off: registry setup
The image lives in this Gitea's container registry. Two things make that less simple than it sounds:
- Docker always talks to
/v2/at the root of the host, whatever Gitea'sROOT_URLsays (/gitea/). - Gitea advertises its token endpoint at
https://adam-french.co.uk/v2/token, on the apex domain. The site redirects the apex towww.
So the apex server block in web_server's nginx/nginx.conf.template proxies /v2/ to Gitea and redirects everything else. That was added in web_server commit da2ab9f.
-
Check Gitea's registry is on. On the Pi, bypassing nginx:
curl -si http://localhost:3000/v2/ | head -5You want a
401withWww-Authenticate: Bearer realm="https://adam-french.co.uk/v2/token". A404means packages are off: add[packages]withENABLED = trueto Gitea'sapp.ini.templateand recreate Gitea. -
Check nginx routes it.
curl -si https://adam-french.co.uk/v2/should give the same401, not a301towww. If you are setting up a fresh site, the route to copy islocation /v2/in the apexserverblock ofnginx/nginx.conf.template. -
Make a token. In Gitea, go to Settings → Applications and create a token with package: read and write.
-
Round trip a throwaway image on the Pi:
docker login adam-french.co.uk -u adamf # the token is the password docker pull alpine:3.22 docker tag alpine:3.22 adam-french.co.uk/adamf/registry-test:1 docker push adam-french.co.uk/adamf/registry-test:1 docker rmi adam-french.co.uk/adamf/registry-test:1 docker pull adam-french.co.uk/adamf/registry-test:1Delete the test package afterwards, from your profile → Packages → registry-test → Settings. If the push fails, the error says where:
unauthorized: the token's scope is wrong, orhttps://adam-french.co.uk/v2/tokenisn't reaching Gitea (it should answer401or JSON, not a301).413: theclient_max_body_size 0line isn't in effect.- HTML, a redirect, or "invalid character '<'":
/v2/is not reaching Gitea.
-
Give CI the credentials. In this repo's Settings → Actions → Secrets, add
REGISTRY_USER(adamf) andREGISTRY_TOKEN(the token). The next push tomainpublishes the image.
The Pi also has to be logged in to pull the image. The docker login in step 4 covers that; it is stored in that user's ~/.docker/config.json.
One-off cutover from the old in-backend tracker
Do the registry setup above first: step 6 needs the image.
Run these on the Pi, in this order:
- Stop the old schedulers. On the old backend, set
EMAIL_SYNC_ENABLED=falseandJOB_LEADS_ENABLED=false, so mail and boards are never processed twice. - Create the database and role. Use the values you put in the site's
.envasPOSTGRES_JOBS_USER,POSTGRES_JOBS_PASSWORDandPOSTGRES_JOBS_DB:docker exec db psql -U "$POSTGRES_USER" -d "$POSTGRES_DB" \ -c "CREATE ROLE jobs LOGIN PASSWORD '…'" -c "CREATE DATABASE jobs OWNER jobs" - Copy the six tables, with their schema and sequences. AutoMigrate then finds nothing to do:
Then compare
docker exec db pg_dump -U "$POSTGRES_USER" -d "$POSTGRES_DB" --no-owner --no-privileges \ -t job_applications -t job_app_references -t processed_emails \ -t job_sources -t job_leads -t job_search_profiles \ | docker exec -i db psql -U jobs -d jobs -v ON_ERROR_STOP=1SELECT count(*)on each table in the two databases. - Move the token files:
mkdir -p jobs-data cp backend/token/msgraph_token.json backend/token/job_capture_token.json jobs-data/ sudo chown -R 1000:1000 jobs-data - Point Microsoft at the new callback. In the Entra app registration, add the redirect URI
https://adam-french.co.uk/jobs/api/email/callback, and setMSGRAPH_REDIRECT_URIto the same value. - Deploy and check. Deploy
web_serverwith thejobsservice and routes, then re-enable the two schedulers, now read byjobs. Check:- the tracker loads
- "Check now" on Leads works
- "Sync now" on Settings works
- a capture from a real posting appears in the tracker
The old tables stay in the site database until they are dropped by hand. GORM never drops anything, so this is safe until you are sure.
Things that are easy to get wrong
- The status vocabulary has copies.
enum JobStatus(GraphQL) andservices.statusOrderare tied by a test, and so areclaude.EmailStatusesand the classifier prompt. Two copies are not checked and must be edited by hand:web/src/views/jobStatus.jsandSTATUS_LABELSin the userscript. - Bump the userscript's
@versionon every edit, or installed copies never update. - The Graph OAuth
stateis a fixed string (carried over unchanged from the old backend), and/email/callbackis open. A forged callback can only link a mailbox the attacker controls, but a per-request nonce, like the site's Spotify flow uses, would close that. BASE_PATHand Vite'sbasemust agree. The SPA's asset URLs and router base are fixed at build time.