How gamrikamal/t-delivery works
• Microservices: Each service should be shown as a separate component. For example:
• auth-service (JWT authentication, token generation, and proxy to user-service)
• courier-service (manages courier order assignments and caching)
• discovery-service (Eureka server for service registration and discovery)
• gateway-service (API gateway for routing, load balancing, and JWT verification)
• menu-service (handles restaurant menu delivery via MongoDB)
• message-service (processes messages from Kafka and sends emails)
• order-service (processes orders, integrates with PostGIS for geodata, and serves a web-socket-enabled UI)
• route-service (calculates optimal routes and distances using Google Maps API)
• user-service (manages user data and roles stored in PostgreSQL)
• Databases and external resource integrations:
• PostgreSQL (order-service, user-service, route-service for geodata via PostGIS)
• MongoDB (menu-service)
• Kafka (message-service and inter-service event messaging)
• External APIs (Google Maps API for route-service)
• The gateway-service channels incoming requests to the appropriate microservice (auth, order, menu, etc.).
• Internal service-to-service communications should be depicted: for instance, auth-service calling user-service for authentication, order-service interacting with route-service (and in turn Google Maps API), as well as outbound message flows going to Kafka for message-service consumption.
• Data flows from services to the databases (e.g., order-service to PostgreSQL, menu-service to MongoDB).
Architectural patterns used
• Microservices architecture: Highlight that each service is independently deployable (using Docker) and communicates over HTTP or messaging (Kafka).
• API Gateway: Illustrate the pattern with a gateway at the front that manages concerns like authentication (token verification via JWT) and request routing.
• Service Discovery: Indicate the role of discovery-service (Eureka) in enabling dynamic service registration and discovery.
• Event-driven communication: Represent Kafka as a central messaging backbone for asynchronous messaging (primarily used by the message-service).
Technological stack details
• Next to each component, note the foundational technologies. For example:
• auth-service, order-service, etc. use Spring Boot.
• Gateway and Discovery are built on Spring Cloud.
• Databases are represented by PostgreSQL (enhanced with PostGIS) and MongoDB.
• Use Docker symbols to denote containerized deployment.
• Kafka as the messaging broker.
• External integrations (Google Maps API) for route calculations.