How arquisoft/wichat_0 works
Main Components Identification
• Frontend (Webapp): A React application that provides the user interface for login and user registration.
• API Gateway Service: Acts as the entry point exposed to public users. It proxies requests to internal services.
• Auth Service: An Express service responsible for handling user authentication.
• User Service: An Express service managing user data and registration, interacting with MongoDB.
• LLM Service: An Express service for handling communication with one or more external LLM providers, configured via API keys.
• Database: A Mongo database (or multiple instances) accessed by both the Auth and User services via mongoose.
• External Services: (Optional element) The LLM provider’s APIs, which are interacted with by the LLM service.
• CI/CD & Monitoring: GitHub Actions for continuous integration and delivery (the deployment pipeline, unit tests, e2e tests) and integrated monitoring (Prometheus and Grafana configurations under the gateway service).
Relationships and Interactions
• The Webapp communicates with the API Gateway Service to perform user operations.
• The API Gateway forwards specific requests to the Auth Service, User Service, or LLM Service.
• The Auth and User services both interface with the same MongoDB instance for data storage.
• The LLM Service communicates with external LLM providers (using provided API keys), facilitating features in the Webapp.
• CI/CD pipelines (defined in the .github/workflows directory) oversee building, testing, releasing, and deployment using SSH and docker-compose.
Architectural Patterns and Design Principles
• Microservices Architecture: Each service (gateway, auth, user, LLM) operates independently, enabling separate deployment and scalability.
• API Gateway Pattern: The gateway service serves as a façade for exposing internal services externally.
• Containerization and Orchestration: Docker containers for each service managed via docker-compose (with different profiles for dev/prod) and orchestrated through GitHub Actions.
• Continuous Integration/Continuous Delivery (CI/CD) workflow: Automated build, test, and deployment cycles using GitHub Actions.
• Monitoring: Integrated monitoring setup using Prometheus and Grafana (as seen in the gateway service directory).
Technologies and Frameworks
• Backend: Node.js with Express.js in all microservices.
• Frontend: React.js.
• Database: MongoDB (accessed via mongoose).
• Containerization: Docker (with individual Dockerfiles and .dockerignore files).
• CI/CD: GitHub Actions.
• Monitoring: Prometheus and Grafana.
• Communication: RESTful services with potential OpenAPI definitions (gatewayservice/openapi.yaml).