πŸ’»

Development Setup

Prerequisites

  • Node.js >= 20.0 (LTS recommended)
  • pnpm >= 9.0 (npm install -g pnpm)
  • Docker + Docker Compose (for PostgreSQL and Redis)
  • Git

1. Clone the Repository

git clone https://github.com/niklask52t/TactiHub.git
cd TactiHub
git checkout dev

2. Configure Environment Variables

cp .env.example .env

The default values work for local development. Optionally adjust:

VariableDefaultDescription
APP_URLhttp://localhost:5173Frontend URL for email links
JWT_SECRET(must be set)Any string for dev
JWT_REFRESH_SECRET(must be set)Any string for dev
SMTP_*(optional)Without SMTP: admin verifies users manually

3. Start Docker Containers

docker compose up -d

Starts PostgreSQL 16 (port 5432) and Redis 7 (port 6379).


4. Install Dependencies & Set Up Database

pnpm install

pnpm db:generate
pnpm db:migrate
pnpm db:seed

The seed creates:

  • Admin account: admin / admin@tactihub.local / changeme
  • Rainbow Six Siege: 21 maps, 42 operators, 55 gadgets (with pre-installed icons)
  • Valorant: 4 maps, 11 agents, 40 abilities

5. Start the Dev Server

Option A β€” Localhost only:

pnpm dev

Starts server (port 3001) and client (port 5173) simultaneously on localhost.

Option B β€” Network access (remote server / LXC / VM):

# Terminal 1 β€” Backend API
pnpm --filter @tactihub/server dev

# Terminal 2 β€” Frontend (network-accessible)
pnpm --filter @tactihub/client exec vite --host

The --host flag makes the Vite dev server accessible on 0.0.0.0.


6. Open the App

Navigate to http://localhost:5173 (or http://<server-ip>:5173 for remote).

Login:

FieldValue
Usernameadmin
Emailadmin@tactihub.local
Passwordchangeme

On first login you will be prompted to change your email and password.


Full Reset

If the database gets into an inconsistent state or you want to start fresh:

bash update.sh
# Select mode [1] dev

The script:

  1. Pulls the latest dev branch
  2. Installs dependencies
  3. Stops Docker containers and deletes all volumes
  4. Restarts PostgreSQL + Redis
  5. Builds the shared package
  6. Deletes old migration files
  7. Generates and applies migrations
  8. Seeds the database
  9. Builds all packages
  10. Asks whether to start the dev server

Useful Commands

CommandDescription
pnpm devStart dev server (server + client)
pnpm buildBuild everything (shared β†’ server β†’ client)
pnpm db:generateGenerate Drizzle migrations
pnpm db:migrateApply migrations
pnpm db:seedSeed database with initial data
pnpm db:studioOpen Drizzle Studio (DB browser)
docker compose up -dStart PostgreSQL + Redis
docker compose downStop containers (data persists)
docker compose down -vStop containers + delete all data