T1/Phase 1: scaffold Vite SPA + Hono API + Bun worker

- apps/web: Vite + React 19 + TanStack Router/Query + shadcn/ui
   - apps/api: Hono + Bun on :3001 with /api/health, /api/auth/*, /mcp stubs
   - apps/worker: Bun worker stub, DB connection, graceful SIGTERM
   - apps/web-legacy/: old Next.js code moved aside (preserved for T2-T8 reference)
   - Dockerfiles: api (Bun), worker (Bun), spa (multi-stage Caddy)
   - Caddyfile: serves dist + reverse-proxies /api/* + /mcp to api
   - docker-compose.yml: 4-service target (api, spa, db, worker)
   - packages/db/src/client.ts: shared Drizzle client for api + worker
   - db/client.ts: root-level alias for convenience

   Parent: t_e1cbd87d -> t_24c9c3fd (T0)
This commit is contained in:
Hermes
2026-08-01 01:15:31 +00:00
parent 9203aee758
commit fca56ab77e
312 changed files with 3489 additions and 196 deletions
+32 -36
View File
@@ -1,39 +1,4 @@
services:
web:
build:
context: .
dockerfile: Dockerfile.web
container_name: project-e-web
# For Nginx Proxy Manager: Don't expose ports directly
# NPM will connect via Docker network using container name
# Only uncomment ports if you need direct access for debugging
ports:
- "3000:3000"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://project_e:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD}@db:5432/project_e
- NEXTAUTH_URL=${PUBLIC_URL:-http://localhost:3000}
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET:?Set NEXTAUTH_SECRET}
- INITIAL_ADMIN_EMAIL=${INITIAL_ADMIN_EMAIL:?Set INITIAL_ADMIN_EMAIL}
- INITIAL_ADMIN_PASSWORD=${INITIAL_ADMIN_PASSWORD:?Set INITIAL_ADMIN_PASSWORD}
- PUBLIC_URL=${PUBLIC_URL:-http://localhost:3000}
- COOKIE_SECURE=${COOKIE_SECURE:-false}
- ALLOWED_HOSTS=${ALLOWED_HOSTS:-localhost}
volumes:
- project-e-web-uploads:/tmp/uploads
networks:
- project-e-network
depends_on:
db:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "node -e \"fetch('http://localhost:3000/api/health').then((response) => process.exit(response.ok ? 0 : 1)).catch(() => process.exit(1))\""]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
restart: unless-stopped
db:
image: postgres:16-alpine
container_name: project-e-db
@@ -55,6 +20,38 @@ services:
retries: 5
restart: unless-stopped
api:
build:
context: .
dockerfile: Dockerfile.api
container_name: project-e-api
ports:
- "3001:3000"
environment:
- NODE_ENV=production
- PORT=3000
- DATABASE_URL=postgresql://project_e:${POSTGRES_PASSWORD:?Set POSTGRES_PASSWORD}@db:5432/project_e
- AUTH_SECRET=${AUTH_SECRET:-stub-secret}
networks:
- project-e-network
depends_on:
db:
condition: service_healthy
restart: unless-stopped
spa:
build:
context: .
dockerfile: Dockerfile.spa
container_name: project-e-spa
ports:
- "3000:80"
networks:
- project-e-network
depends_on:
- api
restart: unless-stopped
worker:
build:
context: .
@@ -76,4 +73,3 @@ networks:
volumes:
project-e-pg-data:
project-e-web-uploads: