Skip to main content

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:

ServicePurposeDatabaseKey Dependencies
CatalogProduct managementPostgreSQLQdrant, Redis, Azure Blob
ChatReal-time messagingPostgreSQLSignalR, MCP Tools, Ollama
BasketShopping cartRedisCatalog API
OrderingOrder processingPostgreSQLBasket, Catalog, SignalR
RatingReviews & ratingsPostgreSQLChat API
FinancePayment processingPostgreSQLRabbitMQ
NotificationEmail/SMSPostgreSQLMailPit, RabbitMQ
SchedulerBackground jobsPostgreSQLTickerQ 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