Backend integration
The business service runs Go/Gin on 8002 and owns authentication, products and favorites; FastAPI runs on 8001 and owns AI JSON/SSE. Start each service using its own quick-start instructions, then run the frontend with the committed .env.integration:
VITE_USE_MOCK=false
VITE_API_BASE_URL=/api
VITE_AI_API_BASE_URL=/api/ai
VITE_API_TARGET=http://127.0.0.1:8002
VITE_AI_API_TARGET=http://127.0.0.1:8001
VITE_REQUEST_ID_ENABLED=true
VITE_PWA_ENABLED=falsepnpm dev:integrationContract differences to resolve
The Vite proxy forwards requests; it does not translate API contracts. Before treating a full browser flow as integrated, reconcile these differences:
- Login: frontend sends
nameand readstoken; Gin expectsusernameand returnsaccessToken. - Profile: frontend requests
/api/user/profile; Gin exposes/api/user/info. - Catalog: frontend requests
/api/productsand/api/products/:id, using localizednameandpriceCents; Gin exposes/api/product/listand/api/product/detail?id=…, returningtitleandprice. - Project CRUD exists in the frontend contract, but the current Gin router does not register Project endpoints.
New feature boundaries
The favorite GET/POST paths match Gin, but require a Gin-issued JWT and an existing public product ID. A frontend Mock token is not valid for the real services. AI suggestions are public JSON and can be checked independently of login. The browser session cannot be assumed integrated simply because the transport accepts the service envelope.
Verification
Use API-level checks below before browser integration. Obtain BUSINESS_USER_JWT from the business service’s actual login response; use its development account configuration, not old documentation credentials. Browser E2E against Mock does not establish real database or cross-service integration.
curl -s 'http://127.0.0.1:8001/api/ai/suggestions?locale=ja-JP'
curl -s 'http://127.0.0.1:8002/api/product/favorite?id=1' \
-H "Authorization: Bearer $BUSINESS_USER_JWT"