How arquisoft/wichat_es6a works
Main Components
• Web Application: A React frontend located in the webapp folder. It provides the user interface and makes API calls to the backend.
• Gateway Service: An Express service (gatewayservice) that acts as a public façade or API gateway. It channels requests to the relevant backend services.
• Backend Microservices:
• Auth Service: (users/authservice) handles user authentication.
• User Service: (users/userservice) manages user data and registration.
• LLM Service: (llmservice) communicates with a Language Learning Model (LLM). It uses an API key-based integration and provides advanced processing.
• History Service: (historyservice) manages history or stats, likely related to chat interactions.
• Wikidata Service: (wikidataservice) provides integration with external wikidata sources.
• Shared Database: As noted in the README, the Auth and User services share a MongoDB instance (accessed via mongoose). Though not explicitly in the file tree, it should be represented as a common datastore.
• Monitoring and CI/CD Components: Notice the monitoring directories inside the gateway service (using Grafana and Prometheus which is a hint for real-time metrics monitoring) as well as the GitHub Actions workflows (in the .github directory). This indicates continuous testing, building, and deployment integration.
Relationships and Interactions
• The WebApp sends HTTP requests (via APIs) to the Gateway Service.
• The Gateway Service forwards or proxies requests to the appropriate microservices (Auth, User, LLM, etc.).
• Auth and User services interact with the shared Mongo database.
• Monitoring tools (Prometheus and Grafana) collect metrics from the services (at least from the gateway service) and display dashboards.
• The CI/CD pipeline (configured in GitHub Actions) automates unit, integration, and end-to-end tests, followed by Docker image builds and deployment (using docker-compose.yml and SSH deployment commands).
Architectural Patterns & Design Principles
• Microservices Architecture: Each backend component is isolated in its own folder with its own Dockerfile and package.json, suggesting independent deployment and scaling.
• API Gateway Pattern: The gatewayservice acts as a proxy for client requests, centralizing external communication.
• Containerization & Orchestration: Dockerfiles in each component coupled with a central docker-compose.yml show container-based deployment.
• Continuous Integration/Deployment: GitHub Actions for automated testing and deployment, ensuring graceful integration.
• Separation of Concerns: Frontend and multiple backend services are clearly segregated.
Technologies & Frameworks
• React for building the web frontend.
• Express (Node.js) for the backend services.
• MongoDB (with mongoose) for persistent storage in the auth and user services.
• Docker & docker-compose for containerization.
• GitHub Actions for CI/CD.
• Monitoring tools (Prometheus and Grafana) for real-time service metrics.