How thienkonphap/olympic-2024 works
Main Components
• API Gateway (gateway): Acts as the entry point for client requests, available on port 8082. Its role is to route and possibly filter or aggregate requests before forwarding them to individual services.
• Calendar Service (calendar-service): Exposes endpoints at port 8080. It contains controllers, models, repositories, and services for managing calendar-related data. Its Swagger documentation is available at “/swagger-ui/index.html.”
• Planning Service (planning-service): Runs on port 8081 with similar architectural layering (AppConfig, controllers, models, repositories, services) handling planning-related features.
• Site Service (sites-service): Available on port 8083, contains endpoints for site and sport functionalities, along with Kubernetes deployment artifacts and Docker configurations. It loads initial data via SQL scripts and exposes its own API docs at the proper swagger endpoint.
• External Clients/Users: Represented as browsers or Postman. These clients interact with the API Gateway and can also directly access individual services using their respective ports.
Relationships and Data Flow
• That each microservice exposes its own Swagger documentation for API exploration.
Architectural Patterns and Design Principles
• Microservices Architecture: Each service is built as an isolated Spring Boot application with its own configuration (e.g., application.yml and application.properties) and business domain.
• API Gateway Pattern: A gateway component centralizes incoming requests to route them to the appropriate service.
• Containerization and Orchestration: The presence of Dockerfiles and Kubernetes YAML files (in sites-service/k8s) suggests that container-based deployment is used, emphasizing scalability, resilience, and easy deployment.
Relevant Technologies and Frameworks
• Java with Maven for dependency management.
• Spring Boot (implied by the MsaApplication.java classes and typical Spring project structure).
• Controller/Repository/Service patterns (typical layered architecture).
• Docker and Kubernetes for containerization and orchestration (specifically for the site service).
• Swagger for API documentation.
• Additional libraries provided in the “lib” directory to support Java EE/Jakarta EE features.
Elements
• “API Gateway” (listening on port 8082)
• “Calendar Service” (port 8080)
• “Planning Service” (port 8081)
• “Site Service” (port 8083)
• Data flow from Clients to API Gateway.
• Infrastructure/External component (e.g., API Gateway)
• Business services (e.g., Calendar, Planning, Site)
• Deployment elements (Docker, Kubernetes elements)
• Annotations for Swagger endpoints for enhanced clarity.
Detailed Composition
• Calendar Service
• Planning Service
• Site Service
• Optionally, include Docker/Kubernetes symbols next to the Site Service to remind viewers of its containerized nature.