Commands
Overview
| Command | Description |
|---|---|
pnpm dev | Start server and client in dev mode |
pnpm build | Build all packages for production |
pnpm db:generate | Generate Drizzle migration files from schema |
pnpm db:migrate | Apply pending database migrations |
pnpm db:seed | Seed database with initial data |
pnpm db:studio | Open Drizzle Studio (visual DB browser) |
docker compose up -d | Start PostgreSQL + Redis containers |
docker compose down | Stop containers (data persists in volumes) |
docker compose down -v | Stop containers and delete all data |
bash dev-reset.sh | Full dev reset: pull dev branch, nuke DB, rebuild from scratch |
Development
Start Everything at Once (localhost)
pnpm dev
Starts the server on port 3001 and the client on port 5173. The Vite dev server proxies API requests (/api/*) and Socket.IO automatically to the Fastify server.
Start Separately (Network Access)
# Terminal 1 β Backend
pnpm --filter @tactihub/server dev
# Terminal 2 β Frontend (network-accessible)
pnpm --filter @tactihub/client exec vite --host
Build
# Build all packages (shared β server β client)
pnpm build
The build order matters: shared is built first since server and client depend on it.
Database
Migrations
# Convert schema changes into migration files
pnpm db:generate
# Apply migrations to the database
pnpm db:migrate
Seeding
# Insert initial data (admin + games + maps + operators)
pnpm db:seed
Drizzle Studio
pnpm db:studio
Opens Drizzle Studio at https://local.drizzle.studio β a visual browser for all database tables.
Push Schema Directly (Development Only)
pnpm db:push
Pushes schema changes directly without migration files. Do not use in production.
Docker
# Start containers
docker compose up -d
# Stop containers (data persists)
docker compose down
# Stop containers + delete all data
docker compose down -v
Warning:
docker compose down -vdeletes the PostgreSQL database and Redis data completely. After restarting, you must rundb:generate,db:migrate, anddb:seedagain.
Dev Reset
bash dev-reset.sh
Performs a full reset of the development environment. The script:
- Switches to the
devbranch and pulls the latest changes - Installs dependencies
- Deletes Docker volumes (PostgreSQL + Redis)
- Restarts containers and waits for PostgreSQL
- Builds the shared package
- Deletes old migration files (prevents
"column already exists"errors) - Generates, migrates, and seeds the database
Warning: This script is only for development. It deletes all data and pulls the
devbranch. Do not use on production systems. See Database for details.
Image Processing
# Process map images from a source folder and convert to WebP
pnpm --filter @tactihub/server tsx src/scripts/process-images.ts "/path/to/source/folder"
The script converts source images to WebP format with deterministic filenames. No database access required.