π»
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:
| Variable | Default | Description |
|---|---|---|
APP_URL | http://localhost:5173 | Frontend 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:
| Field | Value |
|---|---|
| Username | admin |
admin@tactihub.local | |
| Password | changeme |
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:
- Pulls the latest
devbranch - Installs dependencies
- Stops Docker containers and deletes all volumes
- Restarts PostgreSQL + Redis
- Builds the
sharedpackage - Deletes old migration files
- Generates and applies migrations
- Seeds the database
- Builds all packages
- Asks whether to start the dev server
Useful Commands
| Command | Description |
|---|---|
pnpm dev | Start dev server (server + client) |
pnpm build | Build everything (shared β server β client) |
pnpm db:generate | Generate Drizzle migrations |
pnpm db:migrate | Apply migrations |
pnpm db:seed | Seed database with initial data |
pnpm db:studio | Open Drizzle Studio (DB browser) |
docker compose up -d | Start PostgreSQL + Redis |
docker compose down | Stop containers (data persists) |
docker compose down -v | Stop containers + delete all data |