Play · architecture profile
Fighter
Authored character journeys with a small D1-backed service. A Phaser and React game whose Cloudflare Worker runs API routes, stores suggestions and publishes analytics.
How it is built.
Fighter is the game in the catalogue with a real server-side job. The built game is served as assets, but `/api/*` runs first in a Worker that writes character suggestions to D1, rate-limits them with a server-side pepper, and sends owner notifications through Resend. It also exposes a public portfolio-analytics aggregate that Woodhouse reads.
- Stack
- Phaser 3.90, React 19.3, TypeScript, Vite 7, Effect 4, Tailwind 4Evidence: package.json
- Runtime
- Cloudflare Worker `loftwah-fighter`; static assets plus API routes that run the Worker firstEvidence: wrangler.json
- Storage
- D1 database `loftwah-fighter` for character suggestions and public analyticsEvidence: wrangler.json; worker/schema
- Identity
- No player sign-in in the deployed Worker. AUTH_PEPPER only salts analytics and suggestion rate-limit identifiers; legacy account tables remain in the schema without exposed routes.Evidence: worker/index.ts; worker/public-analytics.ts; worker/schema/0001_accounts.sql
- Delivery
- Cloudflare custom domain fighter.loftwah.com with a daily cron at 17:03Evidence: wrangler.json
- Integrations
- LoftwahFM radio client 1.2.0; exposes /api/portfolio-analytics for Woodhouse; anonymous analytics stay on its own databaseEvidence: package.json; worker/portfolio-analytics.ts; Woodhouse src/data/portfolio-analytics.ts
The shape of the system.
- Game clientPhaser and React render authored journeys; no account is required to play.Evidence: src
- Worker APIOnly /api/* reaches the Worker first; everything else is served as a static asset.Evidence: wrangler.json assets.run_worker_first
- D1Suggestions and public analytics are rows, not files in a bucket.Evidence: worker/schema
- NotificationResend is used to tell the owner about a suggestion. The game does not depend on email to remain playable.Evidence: worker/index.ts; worker/character-suggestions.ts
Engineering decisions worth knowing.
- A backend only where the product needs one
Character suggestions need durable, moderated records and abuse limits. Moving the game to a static build and the suggestions to a separate service would add a deploy boundary without removing the need for either.
- Analytics stay with the game that measured them
Fighter publishes its own aggregate; Woodhouse reads it rather than becoming the collector. The game keeps working if the hub is unavailable.
What it connects to.
FighterLoftwahFMradio client 1.2.0two-way
Fighter pins the same client and the pressure-system station profile. The client sends the game's anonymous listening events back to LoftwahFM; Fighter keeps its own audio graph.
Evidence: Fighter package.json; LoftwahFM docs/radio-game-integration.md game profile table
WoodhouseFighterportfolio analytics
Woodhouse reads Fighter's /api/portfolio-analytics aggregate instead of collecting the game's events itself. The schema is woodhouse.portfolio-analytics/1.
Evidence: Woodhouse src/data/portfolio-analytics.ts; Fighter worker/portfolio-analytics.ts
Authoritative public sources
What this review does not know.
- The moderation queue's response times and retention rules were not verified in this review.
- The legacy account tables in worker/schema are not exposed by the current Worker, but their retirement was not confirmed.
- The precise effect of the rate limiter under coordinated abuse was not tested.
- No physical-device or assistive-technology test was performed for this profile.