Commit Graph
93 Commits
Author SHA1 Message Date
adamfandClaude Opus 5 22c6229c42 Add first test suite; fix Timer resume, scraper silent failure
Deploy with Docker Compose / deploy (push) Successful in 1m0s
Weekly Maintenance / maintenance (push) Successful in 19m9s
- backend/services/auth_test.go: token-version normalisation, the
  revocation rule, GenerateJWT/VerifyJWT claim handling. The happy path
  of AuthenticateTokenWithClaims still needs a DB driver we don't have.
- python/tests: travelodge.py's pure functions and the NDJSON event
  contract. pytest is a commented-out dev dep so the image stays slim.
- Timer.vue: the Paused screen now offers Resume, reaching pauseTimer's
  previously unreachable un-pause branch.
- travelodge.py: warn when upstream parses but yields nothing usable, so
  a field rename is distinguishable from sold-out inventory.
- CoverLetters.vue moved out of views/unused/ — it is live on /cv.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-17 02:55:18 +01:00
adamfandClaude Opus 5 25ac1cde1c Fix security issues, bugs, and convoluted code across the stack
Security:
- Token revocation. User gains a TokenVersion counter embedded in both
  tokens as a "tv" claim; AuthenticateToken rejects a token whose version
  no longer matches the row. Logout bumps it, so logging out now kills
  outstanding tokens rather than only clearing cookies. Costs one
  primary-key SELECT per authenticated request, which is the price of
  having revocation at all.
- Spotify OAuth CSRF. The fixed SPOTIFY_AUTH_STATE constant is replaced by
  a per-request one-shot nonce, verified and consumed on callback.
- Private chat attachments. Attachments on private messages are written to
  /backend/uploads/private/ and served at /uploads/private/, gated by the
  same nginx auth_request admin check used for /hasura/ and /notes/.
  Private uploads are rejected from non-admin callers.
- The icecast admin UI (/radio/admin/) is behind the admin gate; listener
  traffic is untouched.
- Store caches are mutex-guarded, so -race is clean.

Bugs:
- The email pipeline no longer drops emails permanently on transient
  failure. Failures record an attempt counter and are retried up to 3
  times; the fetch window rewinds to the oldest retryable email's
  ReceivedAt, without which a retry could never re-fetch it.
- Rowing duplicate detection distinguishes ErrRecordNotFound from a real
  DB error, so a transient failure no longer causes a duplicate insert
  plus a paid Claude call.
- DeletePost propagates its delete error instead of reporting success.
- RecentlyPlayed populates the cache it reads.
- main.go exits non-zero if r.Run fails, so a port conflict is visible.
- Python: the scan truncation flag is set on every deadline path;
  timed_out is reported by the worker rather than inferred from the clock;
  date validation uses Europe/London rather than server-local time.
- Vue: Time.vue and Radio.vue intervals are cleared on unmount; Feed.vue
  guards a missing author; Timer.vue gets an explicit state machine and
  compares total elapsed seconds; Elle.vue's comma-operator call and
  per-frame console.log are fixed.

Simplification:
- One TTLCache replaces three near-identical cache implementations, with
  the differing eviction rules as explicit parameters.
- run_scan's transport index no longer uses one object as both ordering
  record and live output; its three phases are separate functions.
- _price_hotels submits all work to a single pool, so the nested-executor
  deadlock hazard is gone by construction.
- The NDJSON event generators share one implementation.
- IMAP FETCH responses pair each line with its literal in the type, so
  callers no longer hand-skip alternate entries.
- Shared helpers for slice-of-pointers, markdown fences and auth cookies.
- Vue: useHotelSearch, createMirrorStore, useRotation, useCreateForm,
  useLinkAttrs, ListWidget and LinkTableItems replace duplicated blocks.
- nginx dev config's duplicated :80/:443 bodies share one partial.

Infra: certbot passes --deploy-hook touching a sentinel that nginx's
watcher reloads on, so renewed certs are served without a restart, and the
watcher also removes the manual restart after first issuance. db is gated
on service_healthy, autoheal is pinned, and the unused envsubst entries
are dropped.

Verified: go build/vet, npx vite build, py_compile, docker compose config
for both overlays, bash -n on all scripts, and an envsubst render of every
nginx template (no leftover placeholders, runtime vars preserved, braces
balanced).

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-16 16:12:21 +01:00
adamfandClaude Opus 5 64df70e5d2 Document codebase: comments, per-area READMEs, deployment guide
Readability pass across all four areas of the stack. Comments explain why
rather than what, concentrated at the points where behaviour is non-obvious:
concurrency, caching, auth, scraping and nginx templating.

Backend: doc comments on every exported declaration across handlers,
services, models and resolvers. Resolver commentary lives inside function
bodies so gqlgen does not strip it on regeneration; schema files use #
comments rather than description blocks so introspection output is
unchanged. Extracted the duplicated auth-cookie blocks into helpers.

Frontend: header comments on every component, store and view, including
STATUS: notes marking which of the parallel/legacy views are still live.
Documented the non-reactive animation-state pattern, the homeData hub and
the WebSocket stale-socket guard. Removed a few dead imports and named the
reconnect-backoff and poll-interval constants.

Python: module and function docstrings covering the Travelodge scraping
contract, the deadline threading, the two-executor concurrency and the
NDJSON streaming protocol.

Infra: header blocks on every compose file, nginx template, Dockerfile and
entrypoint, covering the config selection, envsubst allow-lists, rate-limit
semantics and volume persistence. Hoisted the duplicated envsubst variable
list in nginx/entrypoint.sh.

New: backend/README.md, python/README.md, DEPLOYMENT.md, .env.example,
backend/graph/doc.go. Refreshed vue/README.md. Corrected CLAUDE.md, which
stated a 24h access token where main.go sets 7 days.

No behaviour change. go build/vet, vite build, py_compile and docker
compose config all pass.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-09-16 15:57:48 +01:00
adamf b0822b1513 update intro
Deploy with Docker Compose / deploy (push) Successful in 20s
2026-09-16 15:32:03 +01:00
adamfandClaude Opus 5 ebb28532c3 Require sign-in for places
Deploy with Docker Compose / deploy (push) Successful in 56s
Gate the places query behind an authenticated user so the list is no
longer public, and relax the place mutations from admin-only to any
signed-in user. Hide the Places tab and skip the fetch entirely for
anonymous visitors.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UKvnE448c1FeepmxZkTezz
2026-09-14 19:58:43 +01:00
adamfandClaude Opus 5 fe6fc02b6b Open home widget create forms in popup modals
Deploy with Docker Compose / deploy (push) Successful in 23s
Weekly Maintenance / maintenance (push) Successful in 1m19s
The Places tab already popped its create form up over the page; every other
/stp widget swapped its contents for the form instead, which meant losing
sight of the list you were adding to and a cramped form inside a grid cell.

Extract the Places modal into a shared components/util/Modal.vue (teleported
backdrop, click-outside and Escape to close) and use it for the Feed, Bookmarks,
Favorites, Consumption and Rowing create forms as well. Widget headers keep
their normal titles now that each form carries its own heading in the modal.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KcFtkisHcKJuTZAnv3fVzA
2026-09-12 18:50:17 +01:00
adamfandClaude Opus 5 894c158afd Add places / things-to-do list with admin management
Deploy with Docker Compose / deploy (push) Successful in 16m21s
Backend: new Place GORM model (title, location, notes, image, category,
cost, priority, done) with auto-migration, a place.graphql schema, and
resolvers for the places query plus admin-only create/update/delete.
Regenerate gqlgen output against gqlgen v0.17.95, which requires Go 1.26 —
bump go.mod and the builder image to match.

Frontend: a places Pinia store, a CreatePlace admin form, and a
PlacesTable rendered as a new tab in the Collage cell, with inline
done-toggle and delete for admins. Rework the Admin page into a
sidebar-navigated panel layout (picking up the previously unreachable
CreateBookmark form) and give Login proper field labels, submit state,
and error feedback.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01KcFtkisHcKJuTZAnv3fVzA
2026-09-12 18:10:41 +01:00
adamfandClaude Fable 5.1 f83d683180 Add cheapest-night date-range scan to the Travelodge finder
Deploy with Docker Compose / deploy (push) Successful in 52s
A second "Cheapest night" tab on /hotels scans every candidate check-in
between two dates (filtered by weekday, 1-7 nights, up to ~3 months),
keeps the N cheapest hotels per night, and prices TfL transport once per
unique hotel so the whole range fits in the streaming window.

Backend
- travelodge.py: extract _shortlist/_make_row/_price_hotels/_apply_transport
  from run_search; add a 30-minute per-(location, dates, rooms) Travelodge
  result cache, a deadline on page fetches, and run_scan (parallel date
  fetches with per-date failure isolation, one TfL lookup per hotel).
- main.py: HotelRequestBase shared by search and scan requests,
  HotelScanRequest with weekday/range validation, scan event models,
  _guarded slot wrapper, POST /hotels/scan/stream (NDJSON).
- nginx: the streaming location now matches /py/hotels/(search|scan).

Frontend
- Split CheapHotels.vue into SingleStayPanel, CheapestNightPanel,
  SharedFields, HotelRows, a shared form composable, stream/format helpers
  and hotels-shared.css; shared fields keep their values across tabs.
- Vite dev server proxies /py to the Python API.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01H5P3C1HbbEwLZEYsjwr7uV
2026-09-08 01:38:30 +01:00
adamfandClaude Fable 5.1 20e958c124 Speed up cheap Travelodge finder and stream results
Deploy with Docker Compose / deploy (push) Successful in 59s
Backend: fetch Travelodge pages in parallel batches, price TfL journeys
from a worker pool throttled to the anonymous 50/min limit (500/min with
TFL_APP_KEY), cache TfL journeys for two hours, and expose a streaming
NDJSON endpoint (/hotels/search/stream) that sends the hotel list first
and one line per hotel as fares arrive. A 20-hotel search now takes
about 10 seconds instead of minutes. Every hotel also gets a cycling
time from the origin (TfL cycle routing with an app key, otherwise a
distance estimate).

Frontend: consume the stream so hotels appear immediately with a
progress bar, show three picks (best value, cheapest room, quickest
cycle) instead of one, add a rank-by toggle (stay + transport, stay
only, cycle time, travel time) and a Cycle column, and raise the hotel
cap to 40.

Nginx: match both search routes and disable proxy buffering and gzip so
the stream reaches the browser as it is produced.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dphx7LL5JC8dAFYU7MMpoA
2026-09-08 00:29:37 +01:00
adamfandClaude Fable 5.1 152f60ee32 Add Python FastAPI service, cheap hotels page, and Tailwind theme refactor
Deploy with Docker Compose / deploy (push) Successful in 1m29s
- Replace searxng and open-webui with a FastAPI `python/` service proxied
  at /py/ (Travelodge hotel search, rate-limited in nginx)
- Add CheapHotels view and CreateToggle component
- Move design tokens into Tailwind @theme in styles.css and migrate
  components/views to utility classes; CVLayout re-points tokens for light theme
- Update README, CLAUDE.md, and .gitignore accordingly

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Dphx7LL5JC8dAFYU7MMpoA
2026-09-08 00:06:04 +01:00
adamf d777ea4b7d update CV
Deploy with Docker Compose / deploy (push) Successful in 46s
2026-09-07 23:35:00 +01:00
adamf fb6b4799b9 added way to write cover letters
Deploy with Docker Compose / deploy (push) Successful in 29s
Weekly Maintenance / maintenance (push) Successful in 15m15s
2026-08-18 17:45:16 +01:00
adamf 64672dfdc8 Speed up deploy times
Deploy with Docker Compose / deploy (push) Successful in 5m30s
2026-08-18 17:27:48 +01:00
adamf 557f92b39a Update CV and add mobile automata simulator
Deploy with Docker Compose / deploy (push) Successful in 19m2s
2026-08-18 12:20:07 +01:00
adamfandClaude Fable 5 127ce95473 Fix mismatched closing strong tag
Deploy with Docker Compose / deploy (push) Successful in 22m22s
Weekly Maintenance / maintenance (push) Successful in 8m40s
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-11 20:35:47 +01:00
adamfandClaude Fable 5 9a7fdc6e30 Update CV: add profile section, dissertation, and receipt_maker project
Deploy with Docker Compose / deploy (push) Has been cancelled
Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-11 20:35:27 +01:00
adamf eaad5c3ef3 Update CV
Deploy with Docker Compose / deploy (push) Successful in 32s
Weekly Maintenance / maintenance (push) Successful in 23m10s
2026-07-07 13:24:22 +01:00
adamf 4f16b000bc Update CV, make programming first selected CV and hide others
Deploy with Docker Compose / deploy (push) Has been cancelled
2026-07-07 12:19:23 +01:00
adamf 3e25b3d51f Add education header
Deploy with Docker Compose / deploy (push) Successful in 20s
Weekly Maintenance / maintenance (push) Failing after 25m25s
2026-06-22 19:53:43 +01:00
adamf f272bd7920 Add education header
Deploy with Docker Compose / deploy (push) Successful in 34s
2026-06-22 19:51:31 +01:00
adamf c773098d32 Move education to top
Deploy with Docker Compose / deploy (push) Has been cancelled
2026-06-22 15:48:46 +01:00
adamfandClaude Opus 4.7 aa14b4c185 Pin Listening header so only song content scrolls
Deploy with Docker Compose / deploy (push) Successful in 4m36s
Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-28 10:53:43 +01:00
adamfandClaude Opus 4.7 06a18eac3d Remove link from Daisy Green Holland Park entry
Deploy with Docker Compose / deploy (push) Has been cancelled
Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-28 10:50:16 +01:00
adamfandClaude Opus 4.7 a8debe2f51 Remove Air Cadet Force qualification from Programming CV
Deploy with Docker Compose / deploy (push) Successful in 22m38s
Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-26 12:25:32 +01:00
adamfandClaude Opus 4.7 548f2350d2 Add Daisy Green Holland Park to hospitality experience
Deploy with Docker Compose / deploy (push) Has been cancelled
Adds the new Daisy Green Holland Park role (May 2026 – Present) to
CVHospitality, and expands CVProgramming's hospitality section to
list each venue individually.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-26 12:24:20 +01:00
adamf 3f5803d4fc Hatsune miku menu first commit
Deploy with Docker Compose / deploy (push) Successful in 4m3s
2026-05-19 14:57:36 +01:00
adamfandClaude Opus 4.7 60bd906251 Add school grades and Air Cadets to Programming CV
Deploy with Docker Compose / deploy (push) Successful in 3m41s
Adds University Academy of Engineering Southbank section with A-Level
and GCSE grades, plus CVQO Level 2 BTEC via the Air Cadet Force.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-18 22:46:49 +01:00
adamf 3b14c3453c Include grades
Deploy with Docker Compose / deploy (push) Successful in 1m1s
2026-05-13 09:45:50 +01:00
adamfandClaude Opus 4.7 842943e7e8 Add Analyst CV template
Deploy with Docker Compose / deploy (push) Successful in 27m35s
Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-05-13 08:56:51 +01:00
adamf 3844a32751 Big formatting spree
Deploy with Docker Compose / deploy (push) Successful in 3m50s
2026-04-29 09:06:41 +01:00
adamf b41e67fe1a Making all CV's abide by same styling
Deploy with Docker Compose / deploy (push) Successful in 16s
2026-04-27 11:45:15 +01:00
adamf 9bcb21910d Making all CV's abide by same styling
Deploy with Docker Compose / deploy (push) Has been cancelled
2026-04-27 11:45:01 +01:00
adamfandClaude Sonnet 4.6 a116ec2614 Add Programming CV and revise General CV layout and content
Deploy with Docker Compose / deploy (push) Successful in 24s
Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-25 16:58:56 +01:00
adamfandClaude Opus 4.6 6f204d4164 Revise Electrical CV layout and content
Deploy with Docker Compose / deploy (push) Successful in 18s
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-24 03:51:55 +01:00
adamfandClaude Opus 4.6 de803dea9f Add To The Rise Bakery to Hospitality CV and trim interests
Deploy with Docker Compose / deploy (push) Successful in 33s
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-23 14:59:48 +01:00
adamfandClaude Opus 4.6 a520944fe3 Align Hospitality CV layout with General CV style
Deploy with Docker Compose / deploy (push) Successful in 4m36s
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-23 14:53:49 +01:00
adamf 22a836cb95 Add other CVs back
Deploy with Docker Compose / deploy (push) Successful in 21m27s
2026-04-23 13:58:55 +01:00
adamfandClaude Opus 4.7 12967c573b Rewrite Electrical CV in a more natural voice
Deploy with Docker Compose / deploy (push) Successful in 18s
Drop the Crown and Anchor entry and rework Profile, Key Strengths,
Experience and Additional so the copy reads more like something I'd
actually write rather than polished boilerplate.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-04-21 12:21:40 +01:00
adamfandClaude Opus 4.7 14233e88a8 Generalize Electrical CV and drop Why Electrical section
Deploy with Docker Compose / deploy (push) Successful in 21s
Rework the apprenticeship-specific profile into a general electrical
apprenticeship pitch, folding in the useful framing from Why Electrical,
and tighten experience and Additional copy.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-04-21 12:12:10 +01:00
adamfandClaude Opus 4.7 2bcb47a1a1 Add Electrical CV template for apprenticeship applications
Deploy with Docker Compose / deploy (push) Successful in 23s
Co-Authored-By: Claude Opus 4.7 <[email protected]>
2026-04-21 12:08:17 +01:00
adamfandClaude Opus 4.6 0b6ffedb70 Add padding below headers in Listening/Steam and adjust layout sizing
Deploy with Docker Compose / deploy (push) Successful in 27s
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-16 02:57:54 +01:00
adamfandClaude Opus 4.6 a14b78a1b9 Add CreateBookmark form with toggle in Bookmarks header
Deploy with Docker Compose / deploy (push) Successful in 25s
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-16 02:51:51 +01:00
adamf f390bf82cc Resize bookmark headers
Deploy with Docker Compose / deploy (push) Successful in 20s
2026-04-16 00:42:53 +01:00
adamf 8d10f75f2b Move bookmarks to home folder, reduce header size and fix import link
Deploy with Docker Compose / deploy (push) Successful in 28s
2026-04-14 17:31:53 +01:00
adamfandClaude Sonnet 4.6 2b5745b946 Move scroll animations to Rust/WASM, enable Hasura, and move bookmarks to home sidebar
Deploy with Docker Compose / deploy (push) Successful in 12m7s
Port AutoScroll and Headline scroll logic from Vue/JS to Rust compiled
to WASM via wasm-pack. Add multi-stage Docker build for WASM compilation,
Vite WASM plugins, and top-level await for WASM init. Enable Hasura
service in docker-compose. Move bookmarks from a separate route to an
inline sidebar component on the home page. Fix ToggleHeader click
propagation.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-14 16:34:24 +01:00
adamfandClaude Opus 4.6 759614e92d Add job application quick reference for storing profile links and experience
Deploy with Docker Compose / deploy (push) Successful in 3m34s
Auth-protected CRUD for personal info (LinkedIn, GitHub, etc.) and
experience entries, stored in the database so nothing sensitive is in
the public repo. Displayed as a categorized panel on the Job Applications page.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-13 12:38:53 +01:00
adamfandClaude Opus 4.6 81c5684102 Fix appliedAt date format to RFC3339 for GraphQL mutations
Deploy with Docker Compose / deploy (push) Successful in 15s
Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-04-13 12:34:12 +01:00
adamfandClaude Sonnet 4.6 a911e6ca69 Add inline admin create forms to home page components
Deploy with Docker Compose / deploy (push) Successful in 28s
Lazy-load create forms (Post, Activity, Favorite, Rowing) directly
into their corresponding home components with an admin-only toggle
button, replacing the need to navigate to the admin page.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-13 12:13:13 +01:00
adamfandClaude Sonnet 4.6 66f32cdbd2 Add database-backed bookmarks via GraphQL
Deploy with Docker Compose / deploy (push) Successful in 3m47s
Replace hardcoded bookmarks in the frontend with a GORM-backed Bookmark
model exposed through GraphQL query and admin-only create/delete mutations.
Frontend groups bookmarks by category dynamically from the store.

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-13 12:04:13 +01:00
adamfandClaude Sonnet 4.6 18b50f1ce6 Split admin login into its own route and add auth guard to /admin
Deploy with Docker Compose / deploy (push) Successful in 28s
- Add /admin/login route for Login.vue as a standalone page
- Add requiresAdmin guard to /admin route
- Update auth guard redirect to /admin/login with redirect query param
- Update nginx @auth_denied to redirect to /admin/login
- Remove Login component from Admin.vue; drop v-if auth checks (guard handles access)
- Remove stale view files from old views/ structure (moved in prior commit)

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
2026-04-13 11:19:10 +01:00