About This Architecture
Production-grade AI platform combining NestJS backend, LangGraph orchestration, and FastAPI RAG service with multi-layer observability and secure authentication. Users and mobile clients route through WAF and CDN to a Next.js frontend, authenticated via Keycloak, communicating with NestJS backend that orchestrates LangGraph workflows and delegates RAG operations to FastAPI. The RAG service chains LLM endpoints, embedding services, and vector databases while streaming events through message queues and tracing execution via Langfuse and Elastic APM. PostgreSQL primary-replica, Redis caching, and object storage provide persistent and ephemeral data layers supporting both transactional and ML workloads. This architecture demonstrates enterprise-grade separation of concerns: presentation tier handles UI, application tier manages business logic and auth, data tier isolates storage, and observability layer captures traces and metrics across all components. Fork and customize this diagram to adapt authentication providers, swap FastAPI for alternative RAG frameworks, or scale individual tiers independently.