Live site: harborstats.jussaw.com
HarborStats is a Catan results tracker for a friend group. The tracked repository contains the main web app in web/, deployment assets in devops/, and CI config in .github/.
This root README is the primary entrypoint for the repo. It covers how the project is laid out, how to run it locally, which commands matter day to day, and where deployment guidance lives.
- Record games with players, scores, winners, notes, and timestamps
- Browse the recent game history from the home page
- Explore stats and activity views
- View player profile pages with player-specific summaries
- Manage data from an admin area protected by a shared password
- Run unit, component, integration, and end-to-end tests
.
├── .github/ GitHub Actions workflows
├── devops/ Docker Compose deployment stack, backup/restore scripts, and ops docs
├── web/ Next.js app, database schema, scripts, tests, and app-level README
└── README.md Root project guide
- Next.js 16 App Router
- React 19
- TypeScript
- Tailwind CSS v4
- PostgreSQL 18
- Drizzle ORM + Drizzle Kit
- Vitest + Testing Library
- Playwright
All app commands run from web/.
cd web
cp .env.example .env
pnpm install
pnpm db:up
pnpm db:migrate
pnpm devThe app runs at http://localhost:3000.
After the app is running, sign in to /admin/players and create your player roster there.
Configure local environment variables in web/.env.
| Variable | Default | Description |
|---|---|---|
DATABASE_URL |
postgres://postgres:postgres@localhost:5432/harborstats |
Postgres connection string used by the app and scripts |
ADMIN_PASSWORD |
required | Shared password for the /admin area |
ADMIN_SESSION_SECRET |
required | Secret used to sign admin session cookies |
ADMIN_SESSION_VERSION |
1 |
Optional; bumping or changing it invalidates all existing admin sessions without rotating ADMIN_SESSION_SECRET |
Run these from web/.
| Command | Description |
|---|---|
pnpm dev |
Start the Next.js dev server |
pnpm build |
Build the production app |
pnpm start |
Start the production server |
pnpm lint |
Run ESLint |
pnpm format |
Format the codebase with Prettier |
pnpm format:check |
Check formatting without writing |
pnpm test |
Run the fast default test suite |
pnpm test:unit |
Run unit tests |
pnpm test:components |
Run component tests |
pnpm test:integration |
Prepare the test DB and run integration tests |
pnpm test:e2e:install |
Install Playwright Chromium |
pnpm test:e2e |
Prepare the test DB and run end-to-end tests |
pnpm test:all |
Run fast, integration, and e2e suites |
pnpm test:ci |
Build the app, then run the full CI-oriented test pipeline |
pnpm db:up |
Start the local Postgres container from web/docker-compose.yml |
pnpm db:generate |
Generate a new Drizzle migration from db/schema.ts changes |
pnpm db:migrate |
Apply pending migrations |
pnpm db:baseline |
Mark the initial migration as already applied for an existing database |
pnpm db:studio |
Open Drizzle Studio |
When making schema changes:
- Edit
web/db/schema.ts - Run
pnpm db:generatefromweb/ - Review the generated SQL in
web/db/migrations/ - Run
pnpm db:migrate
For most day-to-day work, start with:
cd web
pnpm test
pnpm lint
pnpm buildInstall Playwright's browser binary once before your first e2e run:
cd web
pnpm test:e2e:installProduction-style deployment assets live in devops/.
devops/docker-compose.ymldefines the deploy stackdevops/deploy.shpulls the latest code, starts the database, runs baseline and migrations, then brings up the appweb/Dockerfileprovides therunnerandmigratorimage targets used by the deploy stack
For the full deployment guide, including service roles, environment assumptions, and manual compose commands, see devops/README.md.
- web/README.md: lower-level app README focused on the Next.js app itself
- devops/README.md: deployment, backup, and restore guide
- CONTEXT.md: the domain glossary and shared vocabulary for HarborStats
- PLAN.md: the product roadmap; treat planning material as guidance for direction, not necessarily current behavior