Wire frontend into Docker Compose with type-safe API client

- Add frontend service to docker-compose.yml (port 3000, BACKEND_URL env var)
- Add frontend/Dockerfile using adapter-node for plain Node/Docker runtime
- Switch svelte.config.js from adapter-auto to adapter-node
- Generate OpenAPI types from backend spec (openapi-typescript + openapi-fetch)
- Add src/lib/server/api.ts as server-only typed API client factory
- Add generate:api script to regenerate types when backend spec changes

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-02 12:36:09 +02:00
parent b36d4c731d
commit 82815205d0
8 changed files with 6135 additions and 0 deletions

View File

@@ -32,5 +32,17 @@ services:
db:
condition: service_healthy
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: mealprep-frontend
ports:
- "3000:3000"
environment:
BACKEND_URL: http://app:8080
depends_on:
- app
volumes:
pgdata: