⌨️

Commands

Overview

CommandDescription
pnpm devStart server and client in dev mode
pnpm buildBuild all packages for production
pnpm db:generateGenerate Drizzle migration files from schema
pnpm db:migrateApply pending database migrations
pnpm db:seedSeed database with initial data
pnpm db:studioOpen Drizzle Studio (visual DB browser)
docker compose up -dStart PostgreSQL + Redis containers
docker compose downStop containers (data persists in volumes)
docker compose down -vStop containers and delete all data
bash dev-reset.shFull 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 -v deletes the PostgreSQL database and Redis data completely. After restarting, you must run db:generate, db:migrate, and db:seed again.


Dev Reset

bash dev-reset.sh

Performs a full reset of the development environment. The script:

  1. Switches to the dev branch and pulls the latest changes
  2. Installs dependencies
  3. Deletes Docker volumes (PostgreSQL + Redis)
  4. Restarts containers and waits for PostgreSQL
  5. Builds the shared package
  6. Deletes old migration files (prevents "column already exists" errors)
  7. Generates, migrates, and seeds the database

Warning: This script is only for development. It deletes all data and pulls the dev branch. 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.