Skip to content

Local Development

Run the full PackEdge stack locally for development.

Prerequisites

Services

ServiceURLDescription
APIhttp://localhost:8090Go API (Docker, host port 8090 → container 8080)
Consolehttp://localhost:3000SolidJS SPA (Vite)
Docshttp://localhost:5173VitePress
PostgreSQLlocalhost:5433Database (Docker)
Redislocalhost:6380Cache (Docker)

Getting Started

1. Start the API (Docker Compose)

This starts the Go API, PostgreSQL, and Redis:

bash
cd apps/api
make dev

2. Run Database Migrations

bash
cd apps/api
DATABASE_URL="postgres://packedge:packedge@localhost:5433/packedge?sslmode=disable" make migrate-up

3. Start the Console

bash
pnpm dev:console

The console runs at http://localhost:3000 and proxies API requests (/console/*, /ws/*) to the API at localhost:8090.

4. Start the Docs (optional)

bash
pnpm dev:docs

Environment Variables

The console uses two API-related environment variables (see apps/console/.env.example):

VariableDev DefaultProductionPurpose
VITE_API_URL/apihttps://api.packedge.dev/consoleFetch requests (proxied in dev)
VITE_API_BASE_URLhttp://localhost:8090https://api.packedge.devDirect navigation (OAuth redirects)

Docker Compose Services

The apps/api/docker-compose.yml runs three containers:

  • api (packedge-api) - Go API binary on container port 8080, published to host port 8090
  • postgres (api-postgres-1) - PostgreSQL 16 on host port 5433
  • redis (api-redis-1) - Redis 7 on host port 6380

Useful Commands

bash
# View API logs
docker compose logs api -f

# Restart API after code changes
docker compose restart api

# Rebuild and restart API
docker compose up --build api -d

# Stop everything
docker compose down

# Stop and remove volumes (reset database)
docker compose down -v