How arquisoft/wichat_es3a works
Project Type and Purpose
• This is a full-stack, microservices-based chat application prototype (“wichat_es3a”) with a React frontend, multiple backend services (Express/Node), a shared MongoDB, and monitoring + CI/CD pipelines.
• The components support user registration, authentication, question generation via an LLM, question history, and a gateway API that fronts all backend services.
File Structure Analysis
• Top-level directories correspond to each microservice or component:
• users/authservice & users/userservice
• gateway-api-service & gatewayservice
• llmservice
• historicservice
• questionservice
• webapp (React frontend)
• A docker-compose.yml orchestrates all services (profiles: dev, prod).
• “docs/src” follows the arc42 template, detailing architecture, runtime, deployment views, and decisions.
• CI workflows and Sonar properties at the root indicate automated builds, tests, quality gates, and deploy over SSH.
Key Architectural Insights from README
• User service and Auth service share a MongoDB via Mongoose.
• LLM service delegates calls to an external LLM provider (API key).
• Gateway service exposes a single API entrypoint, proxies requests to user/auth/LLM/question/historic services.
• Webapp uses the gateway over HTTP for login, registration, game play, browsing history.
• Monitoring stack (in gatewayservice folder) uses Prometheus + Grafana dashboards.
• CI/CD uses GitHub Actions: runs unit & e2e tests, builds Docker images, pushes to GH Packages, then deploys via SSH.
Components
• Frontend (React Webapp)
• API Gateway (gateway-api-service/gatewayservice)
• Auth Service
• User Service
• Question Service
• Historic Service
• LLM Service
• MongoDB Database
• Monitoring Stack (Prometheus, Grafana)
• External LLM Provider API
• CI/CD Pipeline (GitHub Actions)
• Docker Compose Orchestrator
• Deployment Target (Remote VM with Docker)
Relationships and Data Flows
• Webapp → HTTP(S) → API Gateway
• Gateway → routed HTTP calls → Auth / User / Question / Historic / LLM services
• Auth & User → read/write → MongoDB
• Question Service may call LLM Service or external LLM API directly
• Historic Service reads from MongoDB (or from Question Service?)
• Monitoring Stack scrapes metrics from each service
• CI/CD pipeline triggers on push or release, runs tests, builds Docker images, pushes them, and SSH-deploys Docker Compose on the remote VM.
Architectural Patterns and Principles
• Microservices per bounded context (auth, user, question, historic, llm).
• API Gateway pattern centralizing external access.
• Shared database for related services (auth + user).
• Container-based deployment with Docker Compose profiles (dev/prod).
• Infrastructure as Code via Docker Compose + GitHub Actions.
• Observability via Prometheus + Grafana.