How milkfrogge/coffee-store works
High-Level Architecture Overview
a) External Layer:
• API Gateway (HTTP:8000)
• Client Applications (Flutter UI)
b) Service Layer (with ports):
• ProductService (gRPC:5000) - Currently implemented
• AuthService (gRPC:5001)
• RoyaltyService (gRPC:5002)
• OrderService (gRPC:5003)
• StorageService (S3Minio:5004)
• BaristaService (HTTP:5005)
• KitchenService (HTTP:5006)
c) Infrastructure Layer:
• Message Brokers (for SAGA pattern)
• Individual Databases per service
• Observability Stack (Prometheus, Grafana, Jaeger, Graylog)
Detailed ProductService Architecture
a) API Layer:
• gRPC Service (product.proto, category.proto)
• Interceptors (timeout, tracing)
b) Internal Structure:
• Service Layer (internal/service/product)
• CRUD operations
• Validation
• Repository Layer (internal/repository/product)
• Postgres implementation
• Models (internal/model)
• Converters (internal/converter)
c) Database:
• PostgreSQL with migrations
• SQL queries for product operations
Observability Components
a) Monitoring:
• Prometheus metrics collection
• Grafana dashboards
b) Tracing:
• Jaeger client integration
• Trace flow through interceptors
c) Logging:
• Graylog integration
Important Details to Highlight
• SAGA pattern implementation
• Transactional outbox pattern
• Database-per-service architecture
• gRPC communication between services
• Observability integration points
• Role-based access control flow
• Message broker interaction points