ElChess is the Bun workspace monorepo for the first serious build of elchess.org: an Astro-owned chess web surface, an Elysia API, PostgreSQL as the durable store, and Caddy for local edge-style routing.
BUILD.md is the execution authority for the repo. docs/architecture.md records current repo truth and points back to the build plan.
This repository currently implements:
- Phase 0 bootstrap for the monorepo, shared configs, docs, and local ops wiring.
- Phase 1 product shell work for the Astro web app, initial design tokens, UI primitives, responsive app routes, and Playwright smoke coverage.
- Phase 2 auth foundation work for SQL migrations, durable
users/profiles/sessionstables, secure cookie-backed sessions, and protected API routes. - Placeholder chess gameplay, matchmaking, ratings, review logic, and realtime orchestration are still intentionally unfinished.
- Install Bun 1.3+ and Docker Desktop.
- Run
bun install. - Run
bun run dev. - Open
http://localhost:8080for the Caddy-routed web surface. - Open
http://localhost:8080/api/healthfor the API health endpoint. - Open
http://localhost:8080/auth/sign-upto exercise the current auth shell.
bun run dev starts the Astro and Elysia dev servers, attempts to bring up PostgreSQL and Caddy through Docker Compose, and runs the checked-in SQL migrations against the configured database. If port 8080 is already occupied, export CADDY_PORT=<open-port> before running the command. If Docker is unavailable, the web and API apps still start directly on ports 4321 and 3001, but the PostgreSQL-backed auth flows will need a reachable database.
bun run devstarts the local stack, applies migrations, and launches the app dev servers.bun run db:migrateapplies forward SQL migrations.bun run db:resetrebuilds the schema from the checked-in migrations.bun run buildbuilds the shared packages, API, and Astro web app.bun run lintruns Biome across the repo.bun run typecheckruns packagetscchecks andastro check.bun run testruns Bun tests for the implemented packages and API.bun run test:authruns the API auth integration suite.bun run test:e2eruns Playwright smoke coverage.bun run check:proxyverifies Caddy routing to the web app and API.bun run verifyruns the baseline quality bar.
apps/
api/ Elysia HTTP API with cookie-backed auth flows
web/ Astro pages, layouts, and Vue islands
packages/
contracts/ Shared Zod contracts
chess-core/ Placeholder board shell helpers
ui/ Design tokens, primitives, and first Vue island
db/
migrations/ Forward SQL migrations
seeds/ Local seed assets (not implemented yet)
docs/
architecture.md
ops/
scripts/ Local dev and verification helpers
Astro owns routes, layouts, document composition, and the authenticated shell. Vue is introduced only for the live board-adjacent island in the game room shell, which is still the first place BUILD.md says richer client state is justified. The current boundary is documented in docs/architecture.md.