How brayan6072/mpgestionresiduos works
Project type and purpose
• This is a Java‑based microservices system built with Spring Boot. It implements a waste‑management reporting platform (“MpGestionResiduos”) that handles user login, report generation, and an interactive “miniJuego.”
• Key indicators: multiple Maven modules (login, mcsv‑config, mcsv‑eureka, mcsv‑gateway, mcsv‑reportes, miniJuego), Spring Cloud config, Eureka service registry, API gateway, Dockerfiles.
File structure
• Top‑level modules:
• login – authentication service with JWT, user/role persistence, static UI and templates.
• mcsv‑config – Spring Cloud Config server serving centralized YAML configurations (per‑microservice).
• mcsv‑eureka – Eureka server for service discovery.
• mcsv‑gateway – API gateway routing external traffic to internal microservices.
• mcsv‑reportes – reporting microservice: REST controllers, DTOs, JPA entities & repositories, static UI pages.
• miniJuego – gamification microservice using Firebase for persistence.
• Cross‑cutting files: pom.xml in root defines overall build, BD.sql for initial database schema.
• Each service has Dockerfile, Maven wrapper, application.yml, banner.txt, unit tests.
README for additional insights
• Minimal README: “Manejo de reportes para la gestión de residuos.” Confirms focus on report handling.
Main components
a. External actor
– User’s web browser/mobile app.
b. Edge layer
– API Gateway (mcsv‑gateway).
– Static UI pages served either by gateway or by individual services.
c. Service Registry
– Eureka Server (mcsv‑eureka) – all microservices register here.
d. Configuration
– Config Server (mcsv‑config) – provides per‑service YAML config at startup.
e. Microservices
1. Auth Service (login)
• Components: AuthController, JWT filter, UserRepository.
• Persists to relational DB.
• Calls ReportesClient to fetch report data if needed.
2. Reporting Service (mcsv‑reportes)
• Controllers: ContenedorController, ReportesController, UbicacionesController.
• Services: ContenedorService, ReporteService, UbicacionService.
• Persistence: JPA repositories, Entities (Reportes, Contenedores, etc).
• Static/templates UI.
3. Mini‑Game Service (miniJuego)
• Controllers for game logic (TirarBasura, Usuario, Podium).
• Uses Firebase SDK (serviceAccountKey.json) for storage.
• Static UI pages and JS for game interaction.
f. Data stores and external services
– Relational DB (MySQL/Postgres) for Auth and Reportes.
– Firebase (NoSQL) for miniJuego.
– (Optional) message broker or caching layer if added later.
Relationships and interactions
• User → Gateway → (Auth / Reportes / miniJuego)
• Gateway resolves routes via Eureka
• Services fetch config from Config Server at bootstrap
• Auth issues JWT → forwarded in HTTP Authorization header to protected endpoints
• ReportesClient in login service calls Reporting Service
• Reporting Service and Auth Service share relational DB or separate schemas
• miniJuego calls Firebase REST/SDK for persistence
Architectural patterns / design principles
• Microservice decomposition by domain (Authentication, Reporting, Gamification)
• Centralized configuration (Spring Cloud Config)
• Service discovery (Eureka)
• API gateway for edge routing and security
• JWT‑based stateless authentication
• Standard layered pattern inside each service (Controller → Service → Repository)
Essential elements to capture
• Component names and boundaries (module names)
• Config server → microservices, service registry → gateway & microservices, DB connections
• Static‑UI delivery vs. REST API endpoints