No description
  • TypeScript 74.4%
  • Svelte 18.7%
  • HTML 3.8%
  • JavaScript 2.2%
  • CSS 0.9%
Find a file
Marlon Schultz 19bdd4bf45
Some checks are pending
checks / checks (push) Waiting to run
Run the checks and the e2e suite on every push
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
2026-08-19 15:32:15 +02:00
.claude Allow the run skill locally 2026-08-08 13:05:38 +02:00
.forgejo/workflows Run the checks and the e2e suite on every push 2026-08-19 15:32:15 +02:00
data Say what the influence field actually does 2026-08-18 02:19:54 +02:00
docs Record what was true after every turn, and a tool that reads two of them 2026-08-19 01:45:34 +02:00
frontend Stop a read-only screen from moving workers it may only look at 2026-08-19 12:53:17 +02:00
server Let an omniscient admin open a world, and find people on it 2026-08-19 12:38:46 +02:00
shared Stop raceTerraformTick answering a question nobody asked 2026-08-19 00:29:13 +02:00
.gitignore Take the game binary back out of the repo 2026-08-08 12:52:52 +02:00
.thumbnail Initial commit 2026-07-08 08:30:03 +02:00
CLAUDE.md Clear out what the docs and the code say that is no longer true 2026-08-18 14:27:36 +02:00
dev.sh Add dev.sh to start both servers with one command 2026-08-16 00:52:50 +02:00
Galaxy Domination Grid View.dc.html Initial commit 2026-07-08 08:30:03 +02:00
Galaxy Domination Start Screen Desktop.dc.html Initial commit 2026-07-08 08:30:03 +02:00
package.json Type-check shared, and fix what it finds 2026-08-07 22:42:28 +02:00
pnpm-lock.yaml Read a battle as diagram and log, in game as well as in the simulator 2026-08-16 20:51:33 +02:00
pnpm-workspace.yaml Pin the roll that made the elimination test flake, and patch two advisories 2026-08-10 20:27:30 +02:00
README.md Say pnpm in the docs, since that is what the repo actually is 2026-07-27 14:55:00 +02:00
support.js Initial commit 2026-07-08 08:30:03 +02:00

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 admin role).

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.

Email 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.