How nguyenhoanghiep478/bookingtrainticket works
Main Components
• Config Service – A centralized configuration provider that all microservices check for runtime configuration (usually on port 8888).
• Discovery Service – A service registry (such as Eureka) that helps each microservice register its information and discover others (commonly on port 8761).
• Microservices:
• Auth Service: Handles user authentication and authorization.
• Store Service: Manages inventory, ticketing, and aspects of train scheduling.
• Order Service: Responsible for order creation, processing (buy/sell orders), and interacting with other services via service gateways.
• Payment Service: Handles payment processing with integration for multiple payment methods (e.g., COD or PayPal).
• Marketing Service: Manages promotional campaigns, email notifications (including templates like mailTemplate.html, preOrderTemplate.html, etc.), and communications.
• Gateway Service (if present): Acts as the API gateway to route external requests to the appropriate microservices.
• External Infrastructure:
• Database (PostgreSQL) for persistent data.
• Apache Kafka for asynchronous messaging among services.
• Redis for caching and fast data retrieval.
• Docker (Compose) for container orchestration of Kafka, Redis, and possibly other services.
Relationships & Interactions
• Config Service and Discovery Service as central to the architecture.
• Similarly, show registration of these services with the Discovery Service.
• Auth Service (for user identity/permission check).
• Store Service (to verify availability of tickets or inventory).
• Payment Service (to process payments).
• Marketing Service (for promotional notifications).
• If a Gateway is implemented, show it routing incoming requests to the appropriate microservices ensuring it is registered in the discovery mechanism.
• Integration with external systems like Swagger documentation endpoints (indicate that each service has its own API doc portal) and deployment pipelines using Docker.
Architectural Patterns & Design Principles
• Microservices Architecture – Separate, independently deployable services communicating over well-defined APIs.
• Service Discovery and Configuration Management – Centralized approaches using Config and Discovery Services.
• Fault Tolerance and Scalability – Although not explicitly depicted, consider annotating that each service container is isolated and can scale independently.
• Use of RESTful APIs (documented via Swagger) and potential API Gateway for security aggregation and routing.
Final Steps
• Keep the design detailed enough to capture all essential architectural guidelines but also clear enough to be easily understood by technical stakeholders.