ReviewOS

also looking at this

stacks/lastsoulultra

LSU's own coaching surface, and what auditing the site turned up

#12
Merged glennmichael123 wants to merge claude/last-soul-ultra-web-6e0718 into main
86 files +3943 -1190

Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.

README.mdmodified+24-0
Changes to README.md
@@ -43,6 +43,30 @@ HQ's **Brand experience** editor controls colors, fonts, corners, density, modul
4343
4444HQ's repository documents provisioning, API endpoints, native app builds and launch decisions in `docs/developers/branded-coaching.md`. The new HQ database migrations and application deployment must be released before enabling the live LSU embed. This repository change does not deploy either site.
4545
46## Built, with nothing on the site reaching it
47
48Two working features have no entry point in the current pages. Both were
49added and then lost when the site was rebuilt from the production capture, so
50they are listed here rather than left to be found again by accident.
51
52**The live scoreboard.** `resources/data/live.ts` mirrors the race's own board
53- which publishes no JSON, so it lifts the state out of the page the worker
54serves - and `routes/api.ts` serves it at `GET /api/live`, cached for a minute
55and answering 503 with `ok: false` rather than a page of zeroes when upstream
56is down. Nothing fetches it. The only consumer left is the 404 page, which
57asks it whether the race is running to decide what to link to. Restoring the
58standings means rendering `livePayload` on `/results` and polling that
59endpoint; the shape is the same server-side and in the browser so the table
60cannot drift between them.
61
62**The newsletter.** `app/Actions/SubscriberEmailAction.ts`,
63`ConfirmSubscriptionAction.ts`, both `app/Mail/Subscription*` classes and the
64three templates in `resources/emails/` implement a real double opt-in, and
65`/api/email/confirm` is the middle step the framework does not provide. No
66page has a signup form, so nobody can start the flow. Adding one also needs
67privacy copy: the current `/privacy` documents analytics, server logs,
68accounts and entries, and says nothing about a mailing list.
69
4670## Existing race service
4771
4872`resources/functions/race-api.ts` talks to the existing `https://api.lastsoulultra.com/v1` service for public events, sign-in, profile updates and entry requests. Its established bearer session remains under `lsu.runner.session`. Coaching has its own HQ account session; credentials are never silently transferred or linked by unverified email. Form submissions reach the real race service, so use an approved test account/service for write testing.