This case study documents the end-to-end debugging of a multi-service web application where authentication and onboarding flows were failing due to misconfigurations, session issues, and service communication breakdowns.
The investigation involved analyzing logs, tracing API flows, and resolving issues across frontend (SvelteKit), backend services, and OAuth integration.
The application failed during critical user flows:
- ❌ Google OAuth login returned errors
- ❌ Backend was unreachable from UI
- ❌ Session cookies were not persisted
- ❌ Onboarding page resulted in 500 errors
The debugging process followed a structured approach:
- Reproduced errors locally
- Inspected logs and API responses
- Validated service connectivity
- Analyzed environment configurations
- Traced authentication flow
- Tested fixes incrementally
- UI proxy pointed to wrong port
- Execution service running on different port
- Mismatch in environment variable names
- Missing
PUBLIC_URLfor redirect URI
- Cookies not forwarded through proxy
- Browser not storing authentication session
- Session structure mismatch
- Backend APIs failing silently
- Weak error handling
- Corrected service port configurations
- Standardized environment variables
- Fixed OAuth redirect handling
- Implemented cookie forwarding in proxy
- Added fallback logic for session parsing
- Improved API error handling
- ✅ Google OAuth login works
- ✅ Session persistence fixed
- ✅ Onboarding flow loads correctly
- ✅ System stable for core flows
- Debugging distributed systems
- API & proxy troubleshooting
- Authentication flow analysis
- Session & cookie handling
- Root cause analysis
- AI-assisted debugging workflow
- SvelteKit (Frontend)
- Node.js / Fastify (Backend)
- PostgreSQL
- Docker
- OAuth (Google)
- BetterAuth
See debug.md for step-by-step debugging process including commands, errors, and fixes.
- Misconfigured environment variables can break entire auth flows
- Cookie forwarding is critical in proxy architectures
- Small inconsistencies in microservices can cause cascading failures
- Structured debugging is essential in multi-service systems
Some features (chat, office integrations) remain incomplete due to missing external API configurations.
Partially resolved – core authentication and onboarding working