Commit Graph

6 Commits

Author SHA1 Message Date
Danny f7db9937b7 fix: logging 2026-01-22 10:53:23 -06:00
Danny 0aaa393a6d refactor: replace SSE streaming with simple JSON chat endpoint
Replace Server-Sent Events streaming implementation with straightforward
JSON request/response pattern to simplify debugging and reduce complexity.

Changes:
- server.js: Convert /api/chat/stream to /api/chat with JSON response
- src/lib/api.ts: Remove SSE parsing logic, add ChatResponse interface
- src/hooks/useChat.ts: Handle JSON response instead of stream chunks

This change makes the request flow easier to debug and troubleshoot
while maintaining the same conversation functionality.
2026-01-20 13:49:44 -06:00
Danny 2d35f2d498 feat: implement server-side proxy with google-auth-library
Rewrite server.js to use google-auth-library for generating Google ID
tokens when authenticating requests to the backend Cloud Run service.

Key changes:
- Replace metadata server token fetch with GoogleAuth client
- Implement proper SSE streaming with raw byte passthrough
- Add health check endpoint for Cloud Run monitoring
- Update server to listen on 0.0.0.0:8080 for Cloud Run compatibility
- Add environment variable validation at startup
- Improve error handling and logging throughout request lifecycle

Update Dockerfile to install google-auth-library dependency and expose
port 8080 instead of port 80.
2026-01-20 12:18:09 -06:00
Danny 2e7db6a952 fix: pin Express to v4 to avoid path-to-regexp v8 breaking changes 2026-01-16 14:43:37 -06:00
Danny 10ed6a395a fix: update Express wildcard route for path-to-regexp v8 compatibility 2026-01-16 14:39:29 -06:00
Danny 5195901f01 feat: add Node.js Express server for IAP and backend auth
Replace Python http.server with Express to handle:
- Large IAP JWT headers that caused 500 errors
- API request proxying with GCP identity tokens
- Static React build serving with SPA fallback

Update api.ts to use relative URLs in production for proxy routing.
2026-01-16 14:33:26 -06:00