Infrastructure Level 1 - Application Architecture
This level shows the high-level deployment architecture of the BookWorm application, focusing on the major infrastructure components and their relationships.
Architecture Diagram
Component Overview
API Gateway
- Technology: YARP (Yet Another Reverse Proxy)
- Purpose: Single entry point for all client requests
- Features: Request routing, load balancing, SSL termination
- Services: Routes to Catalog, Chat, Basket, Ordering, Rating APIs
Identity Provider
- Technology: Keycloak
- Purpose: Centralized authentication and authorization
- Features: JWT token issuance, custom theming, realm management
- Database: External PostgreSQL database for user data
Microservices Layer
Eight independent services handling specific business domains:
Service | Purpose | Database | Key Dependencies |
---|---|---|---|
Catalog | Product management | PostgreSQL | Qdrant, Redis, Azure Blob |
Chat | Real-time messaging | PostgreSQL | SignalR, MCP Tools, Ollama |
Basket | Shopping cart | Redis | Catalog API |
Ordering | Order processing | PostgreSQL | Basket, Catalog, SignalR |
Rating | Reviews & ratings | PostgreSQL | Chat API |
Finance | Payment processing | PostgreSQL | RabbitMQ |
Notification | Email/SMS | PostgreSQL | MailPit, RabbitMQ |
Scheduler | Background jobs | PostgreSQL | TickerQ dashboard |
Data Layer
- PostgreSQL: Primary relational database (9 databases)
- Redis: Caching and session storage
- Qdrant: Vector database for AI-powered search
- RabbitMQ: Message queue for async communication
- Azure Blob: File and media storage
- Azure SignalR: Real-time communication
AI Services
- Ollama: Model management and serving
- Gemma 3: Chat interactions (1B dev, 4B prod)
- Nomic Embed Text: Text embedding generation
Monitoring & Tools
- Health Checks UI: Service health monitoring
- Scalar: Interactive API documentation
- K6: Performance testing (development only)
- MCP Tools: Model Context Protocol integration
Deployment Characteristics
Scalability
- Horizontal: Services can be scaled independently
- Vertical: Resource allocation per service
- Auto-scaling: Azure Container Apps automatic scaling
Reliability
- Service Dependencies: Managed through wait conditions
- Health Checks: All services expose health endpoints
- Circuit Breakers: Resilience patterns implemented
- Data Persistence: Volume mounts for stateful services
Security
- Authentication: Keycloak JWT tokens
- Authorization: Role-based access control
- Secrets: Azure Key Vault integration
- Network: Service-to-service communication secured