- TypeScript 74.4%
- Svelte 18.7%
- HTML 3.8%
- JavaScript 2.2%
- CSS 0.9%
|
Some checks are pending
checks / checks (push) Waiting to run
Forgejo Actions, not GitHub: `git push` now mirrors to both hosts, and GitHub ignores .forgejo/, so the suite runs once rather than twice. Ordered cheapest-first — the four checks CLAUDE.md names, then Playwright — so a broken build reports in a minute instead of after the browsers have downloaded. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U6zT2Vz5EdyYnMsumGfPvv |
||
|---|---|---|
| .claude | ||
| .forgejo/workflows | ||
| data | ||
| docs | ||
| frontend | ||
| server | ||
| shared | ||
| .gitignore | ||
| .thumbnail | ||
| CLAUDE.md | ||
| dev.sh | ||
| Galaxy Domination Grid View.dc.html | ||
| Galaxy Domination Start Screen Desktop.dc.html | ||
| package.json | ||
| pnpm-lock.yaml | ||
| pnpm-workspace.yaml | ||
| README.md | ||
| support.js | ||
Galaxy Domination
A turn-based 4X strategy game for up to 8 commanders per campaign, played asynchronously — you submit your turn, the empire keeps running while you're away, and results resolve once everyone (or the timer) catches up.
Stack
This is a pnpm workspace monorepo with three packages:
| Package | What it is | Tech |
|---|---|---|
frontend |
The web client | SvelteKit, Vite, Vitest, Playwright |
server |
The API server | Fastify, better-sqlite3, Zod, Nodemailer |
shared |
Types and logic shared between frontend/server | Plain TypeScript |
Data is stored in a local SQLite file (server/data/game.db) — no external
database service required for development.
Requirements
- Node.js 22+
- pnpm 11+
Getting started
pnpm install
# copy env templates and adjust if needed
cp server/.env.example server/.env
cp frontend/.env.example frontend/.env
# run both apps (in separate terminals)
pnpm dev:server # API on http://localhost:4000
pnpm dev:web # web app on http://localhost:5173
Open http://localhost:5173 in your browser.
Environment variables
server/.env
| Variable | Default | Notes |
|---|---|---|
PORT |
4000 |
API server port |
FRONTEND_ORIGIN |
http://localhost:5173 |
Must match wherever the frontend actually runs, or CORS will reject requests |
DB_PATH |
./data/game.db |
SQLite file location |
SMTP_HOST etc. |
unset | Optional. Without SMTP config, verification/reset emails are logged to the server console instead of sent |
frontend/.env
| Variable | Default | Notes |
|---|---|---|
PUBLIC_API_URL |
http://localhost:4000 |
Base URL of the API server |
Other scripts
pnpm check # typecheck frontend + server
pnpm build:web # production build of the frontend
Tests
Most of the rules live in shared and the turn resolution in server, so those two suites carry
the weight — run all three.
pnpm --filter @botf/shared test # game rules
pnpm --filter @botf/server test # API + turn resolution
pnpm --filter frontend test:unit --run # component + unit tests (drop --run to watch)
pnpm --filter frontend test:e2e # Playwright end-to-end
Run vitest through --filter, not from the repo root: the root picks up both the server and
frontend projects and they collide on the same test database.
Features
- Auth — email/password registration with email verification, login, logout, forgot/reset password, all backed by session cookies.
- Campaigns — found a new empire (choose galaxy size and commander count) or join an existing one with an invite code. Empires are placed on a procedurally generated galaxy grid.
- Admin panel — manage users, roles, and game sessions (visible only to
accounts with the
adminrole).
Test accounts
In non-production environments (NODE_ENV !== 'production'), the server
automatically seeds a handful of accounts the first time it starts against an
empty database, so you can log in immediately without registering.
| Password | Role | Notes | |
|---|---|---|---|
admin@test.local |
DevPass123! |
admin | Can access /admin |
user@test.local |
DevPass123! |
user | |
user2@test.local |
DevPass123! |
user | For testing multiplayer flows with a second account |
The server also seeds a couple of demo game sessions ("Ape Shit", "OBANGO")
populated with fake commander accounts (e.g. kade@players.test,
onyeka@players.test, ...) sharing the same DevPass123! password, so the
campaign list has realistic-looking data out of the box.
These accounts only exist in dev/test — the seed step is skipped entirely
when NODE_ENV=production.