2.3 KiB
2.3 KiB
AGENTS.md
Bun workspaces monorepo: apps/backend (Elysia API on port 3000) + apps/frontend (Solid.js/Vite/PWA app on port 5173). packages/ is empty; the frontend is the primary app.
Commands
bun install(root) — install all workspacesbun run dev— start backend + frontend togetherbun --filter backend dev/bun --filter frontend devfor one side
- Typecheck/build frontend:
bun --filter frontend build(tsc -b && vite build) - No test suite exists: backend
testscript is a stub that exits 1; frontend has no tests
Gotchas
- Readme at repo root is stale
bun initboilerplate (bun run index.tsdoes not exist); the real entrypoints areapps/backend/src/index.tsandapps/frontend/src/index.tsx - Frontend calls
/api/v1/...; Vite dev proxy adds the strip of/apibefore forwarding tolocalhost:3000. Backend routes live under/v1/...with NO/apiprefix. Don't add/apito backend routes or drop it from frontend fetches - Backend
apps/backend/src/index.ts:3hardcodesisDev = true, which switches ID encoding betweenutf8andbase64urlfor opaquesportsmanager:<host>:<remoteId>IDs — decode/encode must both use the same format; change it deliberately, not accidentally - Frontend is Solid.js (
jsxImportSource: solid-js), not React — no hooks, nouseState; usecreateSignal/createStore(seesrc/stores/matchStore.ts) matchStore.loadMatchmerges the stats payload into the same match record viapatchMatch; the shape ofMatchis intentionally loose ([key: string]: unknown)- PWA (
@serwist/*) is inapps/frontend/package.jsonbut NOT wired intovite.config.ts— Serwist service worker is currently inactive apps/backend/package.jsonhas a stale"module": "src/index.js"field; the actual file issrc/index.ts
Conventions
- No lint/CI/prettier config is set up (prettier is only a root devDependency with no config file) — don't assume a formatter style
- Backend data comes from external German table-tennis/sportsmanager APIs (domains listed at the bottom of
apps/backend/src/index.ts); responses are in German and field names are the raw API's (e.g.heim_punkte,gast_name) - Team/match/event IDs are derived (encoded), not raw — compute IDs via the
Sportsmanager.id()helper rather than hardcoding