Appearance
Local Development
Run the full PackEdge stack locally for development.
Prerequisites
- Docker & Docker Compose
- Node.js (v18+)
- pnpm
- golang-migrate CLI (
brew install golang-migrate)
Services
| Service | URL | Description |
|---|---|---|
| API | http://localhost:8090 | Go API (Docker, host port 8090 → container 8080) |
| Console | http://localhost:3000 | SolidJS SPA (Vite) |
| Docs | http://localhost:5173 | VitePress |
| PostgreSQL | localhost:5433 | Database (Docker) |
| Redis | localhost:6380 | Cache (Docker) |
Getting Started
1. Start the API (Docker Compose)
This starts the Go API, PostgreSQL, and Redis:
bash
cd apps/api
make dev2. Run Database Migrations
bash
cd apps/api
DATABASE_URL="postgres://packedge:packedge@localhost:5433/packedge?sslmode=disable" make migrate-up3. Start the Console
bash
pnpm dev:consoleThe 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:docsEnvironment Variables
The console uses two API-related environment variables (see apps/console/.env.example):
| Variable | Dev Default | Production | Purpose |
|---|---|---|---|
VITE_API_URL | /api | https://api.packedge.dev/console | Fetch requests (proxied in dev) |
VITE_API_BASE_URL | http://localhost:8090 | https://api.packedge.dev | Direct 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