diff --git a/CLAUDE.md b/CLAUDE.md index fda2c4b..b3a50ad 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 79c9587..7fc4ef9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,6 +36,8 @@ services: restart: unless-stopped networks: - web + ports: + - "127.0.0.1:5432:5432" environment: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_MULTIPLE_DATABASES: vorteq_dev,vorteq_test,vorteq_prod @@ -55,6 +57,8 @@ services: restart: unless-stopped networks: - web + ports: + - "127.0.0.1:6379:6379" volumes: - redis_data:/data healthcheck: diff --git a/traefik/config/dev-local.yml b/traefik/config/dev-local.yml new file mode 100644 index 0000000..3f8bc08 --- /dev/null +++ b/traefik/config/dev-local.yml @@ -0,0 +1,14 @@ +http: + routers: + dev-local: + rule: "Host(`dev.quest.vorteq.wulf.cloud`)" + entrypoints: + - websecure + tls: + certResolver: letsencrypt + service: dev-local + services: + dev-local: + loadBalancer: + servers: + - url: "http://172.17.0.1:3001"