Microservices
ForesightX splits responsibilities by business capability. Each backend service is a FastAPI application with its own configuration, health check, tests, and deployment lifecycle.
| Service | Responsibility | Public route prefix |
|---|---|---|
| Auth | Registration, login, OAuth, JWT lifecycle, session revocation | /api/auth |
| Data | Quotes, history, indicators, news, search, and streaming | /api/data |
| Pattern | Feature preparation and model inference | /api/pattern |
| Profile | User details, portfolio, transactions, and risk | /api/profile |
| Orchestration | Multi-service analysis and recommendation workflow | /api/orchestration |
| Frontend | Responsive React application and session-aware UI | / |
Boundary rules
- A service owns its tables and migrations.
- Cross-service reads happen through APIs, not shared database credentials.
- External provider formats are normalized by the service that owns that integration.
- The frontend calls same-origin NGINX routes rather than container names.
- Optional integrations should fail explicitly or use documented fallback behavior.
Common conventions
GET /healthfor liveness and readiness checks- Pydantic schemas for request and response validation
- Environment variables for deployment-specific configuration
- Structured HTTP errors at service boundaries
- Pytest for backend verification and Vitest for frontend components