How arquisoft/wichat_es3b works
Main Components
• Frontend (Webapp):
• Represented as the React-based web application.
• This component handles user interaction (login, user registration, gameplay features) and communicates with the backend via HTTP APIs.
• Gateway Service:
• Acts as the public-facing proxy.
• Routes client requests from the webapp to the appropriate backend services.
• Backend Microservices:
• LLM Service: An Express service that manages communication with a Language Model (LLM) and requires an API key.
• User-related Services (contained in the users directory):
◦ Auth Service: Handles user authentication.
◦ User Service: Manages user data insertion.
◦ Stats Service: Manages game or usage statistics.
• Wiki Question Service:
◦ A specialized service for question generation and management.
• Database:
• A shared MongoDB database used by at least the auth and user services (accessed via Mongoose).
• Infrastructure and CI/CD:
• Docker and Docker Compose configuration for containerized deployment.
• GitHub Actions workflows for build, testing, and deployment over SSH.
• Environment configuration (.env files) for sensitive data like the LLM API key.
Relationships and Interactions
• The Webapp sends RESTful API calls to the Gateway Service.
• The Gateway Service functions as a reverse proxy, forwarding requests to:
• The LLM Service (for language model communication).
• The respective User services (auth, user, and stats) for authentication and user management.
• The Auth and User services connect to a shared MongoDB database.
• Optionally, if the Wiki Question Service is actively used in the system’s flow, it should be connected (or interact) with the other services that may need to retrieve or generate query-based content.
• CI/CD pipelines are used to build, test, and deploy all these components by:
• Running individual tests (unit and end-to-end tests).
• Building Docker images for each service.
• Deploying via SSH using docker-compose (utilizing profiles such as “prod” and “dev”).
Architectural Patterns and Design Principles
• Microservices Architecture:
• Each business domain is modularized in its own service (e.g., auth, users, stats, LLM, and wiki questions), which improves separation of concerns and scalability.
• Containerization:
• Dockerfiles for each service and the overall docker-compose configuration indicate a containerized deployment approach.
• CI/CD Integration:
• Automated test, build, and deployment pipelines from GitHub Actions ensure a robust development process.
• Clear API Gateway Pattern:
• The gateway service simplifies the communication between the client (webapp) and multiple backend services.
• Shared Data Store:
• MongoDB serves as the central data storage for user-related information, denoting a common dependency.
Detailed Process
• Then, drill down with sub-components or annotations about:
• Which services are containerized,
• How the CI/CD workflow orchestrates deployment,
• How sensitive configuration (API keys via .env) is managed.