How arquisoft/wichat_es5b works
Project Overview and Purpose
• The project is a full-stack microservices application named “wichat_es5b”. It is structured as a set of small, independently deployed services (all built with Express) that together form the application.
• The primary purpose is to offer a chat/game web application with authentication, user management, game logic, and interactions with an external language model (LLM) and Wikidata resources. The front-end (a React-based WebApp) interacts with the backend services via a public gateway.
Analyzing the File Structure
• Several top-level directories represent individual microservices:
• gameservice (handles game logic and question management)
• gatewayservice (acts as the entry point, routing public requests)
• llmservice (manages communication with the language model via API keys)
• statsservice (handles usage statistics and history/ranking data)
• users (which is subdivided into authservice and userservice — authentication and user management)
• webapp (the front-end React application that users interact with)
• wikidataservice (fetches question-related data from Wikidata)
• Common files include Dockerfiles and .dockerignore in every service, indicating containerized deployment.
• The presence of docs (with architecture and deployment files) and GitHub workflows (in .github/workflows) implies that CI/CD and automated deployments (via GitHub Actions and SSH) are essential parts of the ecosystem.
Identifying the Main System Components
a. Frontend:
• Webapp: A React-based UI that provides the client interface to users.
b. API Gateway:
• Gateway Service: A central proxy exposed to clients; it routes REST API calls to the appropriate back-end microservices.
c. Backend Microservices:
• User Service: Manages user data (sharing MongoDB with auth and stats services).
• Auth Service: Manages authentication.
• Stats Service: Manages user history and global ranking.
• Game Service: Handles game logic, question management, and game progression.
• LLM Service: Communicates with the external LLM API using configured API keys.
• Wikidata Service: Retrieves question-related content from external Wikidata sources.
d. Database:
• Shared MongoDB instance for services (User, Auth, Stats) as described in the README.
e. External/Third-party Integrations:
• LLM Provider (via externally configured API keys)
• Wikidata as a data source.
f. CI/CD and Deployment:
• GitHub Actions workflows for testing, building, pushing Docker images, and automated deployment via SSH.
• Docker Compose file (docker-compose.yml) orchestrates the containers during both development and production deployments.
Architectural Patterns and Technology Highlights
• Microservices Architecture: Each service is self-contained and communicates (likely using REST over HTTP) with the gateway service.
• Containerization: All services include Dockerfiles, so Docker is a key technology along with docker-compose for coordination.
• CI/CD Pipeline: GitHub Actions not only runs unit and e2e tests before builds but also manages deployments.
• Shared Database: Some services (User, Auth, Stats) use MongoDB (via Mongoose) as highlighted in the README.
• API Gateway Pattern: The gateway service abstracts and secures access to the microservices.
• External Communication: LLM configuration and Wikidata interactions are clearly separable concerns.
Final Detailed Checklist
• Shared database and external API endpoints.
• If applicable, denote Docker container boundaries and CI/CD flow to emphasize deployment approaches.