feat: add local dev workflow with hot reload via Traefik

Route dev domain through Traefik to host:3001 instead of Docker
container, enabling instant hot reload. Expose PostgreSQL and Redis
ports to localhost for local dev server connectivity.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Lorentz 2026-02-16 19:55:26 +00:00
parent 19e8730d41
commit 9fad8af225
3 changed files with 34 additions and 1 deletions

View file

@ -81,7 +81,8 @@ quest-vorteq/
├── traefik/
│ ├── traefik.yml # Traefik configuration
│ ├── acme.json # SSL certificates (gitignored)
│ └── config/ # Dynamic Traefik config
│ └── config/
│ └── dev-local.yml # Routes dev domain → host:3001 for local dev server
├── prisma/
│ ├── schema.prisma # PostgreSQL schema (auth + quest + ship/alloc/finance/paint/doc/wave/lts domains)
│ ├── migrations/
@ -170,6 +171,8 @@ src/components/forms/ # Shared form components
- Orders: implemented (list page with search and CSV export, HDC exception)
- Remaining: shipments, coil-activity, invoices, shipment-requests, allocation-requests, jobs, admin pages
**Dev workflow:** Local Next.js dev server with hot reload via `PORT=3001 npm run dev`. Traefik routes `dev.quest.vorteq.wulf.cloud` to host:3001 via `traefik/config/dev-local.yml`. The `app-dev` Docker container should be stopped during local dev to avoid route conflicts.
**Auth status:** Better Auth is configured with Prisma adapter. A custom login endpoint exists at `/api/auth/login`. Auth middleware is temporarily disabled in dev mode (`DEV_MODE=true` bypasses to a mock admin session). The dev domain (`dev.quest.vorteq.wulf.cloud`) also bypasses auth in middleware.
**Git:** Currently only `main` branch. No `development` branch yet.
@ -334,6 +337,18 @@ docker compose logs -f vorteq-dev # Tail dev container logs
npm run lint && npm run typecheck && npm test
```
### Local Development (Hot Reload)
```bash
# Start local dev (instead of Docker container)
docker compose stop app-dev # Release the competing Traefik route
PORT=3001 npm run dev # Run in a tmux pane — hot reload at https://dev.quest.vorteq.wulf.cloud
# Stop local dev (restore containerized version)
# Ctrl+C the dev server, then:
docker compose start app-dev
```
Traefik routes `dev.quest.vorteq.wulf.cloud``http://172.17.0.1:3001` via `traefik/config/dev-local.yml`. CI/CD pipeline is unchanged — pushes to `main` still build and deploy the production container.
## Environment Variables
```env