How fmarques56/rhtest works
Project type and purpose
• This is a full-stack web application used for teaching/testing (TPs) called RhTest:
– Frontend: Vue.js (apps/rhfront)
– Backend API: Node.js + TypeScript (apps/rhapi)
– Monitoring stack: Prometheus + Grafana + noise exporter (apps/monitoring)
• Docker Compose files spin up both the application (rhfront + rhapi) and the monitoring environment.
File structure
• Top-level directories:
– apps/rhfront → Vue 3 + Vite, components, service layer
– apps/rhapi → Express/Koa-style REST API, modules (employee), resource files (JSON, Swagger), unit tests
– apps/monitoring → Prometheus, Grafana, noise exporter
– cours → course materials (not part of runtime)
• Docker artifacts:
– apps/rhfront/Dockerfile, run.sh, build.sh
– apps/rhapi/Dockerfile
– apps/monitoring/noise/Dockerfile + noise.sh
– docker-compose-*.yml orchestrators
• Configuration files: prometheus.yml, datasources.yml, tsconfig.json, vite.config.js, package.json, etc.
Extract insights from README
• Purpose: support 4 TPs (requirements, TDD, API tests, functional tests) and a monitoring TP
• App token, Gitpod support, screenshot.
Main components & their relationships
a. Clients (Browser, automated tests)
↔ HTTP/HTTPS
b. Frontend (Vue.js app in container “rhfront”)
• Serves UI (index.html, App.vue, components)
• Calls Backend API endpoints via employee.service.js
c. Backend API (Node/TypeScript in container “rhapi”)
• Exposes REST endpoints (employee.controller)
• Business logic (employee.service)
• Data layer (employee.repository reading from salarie.json)
• Serves Swagger UI (resources/swagger.json)
d. Monitoring stack (three containers):
1. noise exporter → synthesizes metrics on /metrics
2. Prometheus → scrapes metrics from rhapi (/metrics if configured) and noise exporter
3. Grafana → dashboards, reads from Prometheus (configured via datasources.yml)
e. Orchestration (Docker Compose):
– docker-compose-rhtest.yml brings up rhfront + rhapi
– docker-compose-monitoring.yml brings up monitoring stack
Architectural patterns & design principles
• Layered architecture: UI → API → Data
• Micro-container approach: each service in its own Docker container
• Configuration-as-code: YAML files for Prometheus & Grafana
• Testability: unit tests in rhapi (vitest), Vue components easily testable
• Extensibility: noise exporter simulates metrics, can add real exporters