How ciromontes/clinicaveterinariabackend works
Project type and purpose
• This is a monolithic full-stack application built with Spring Boot (Java) that bundles and serves a React/Vite Single Page App (SPA) from its static resources and exposes REST APIs for user authentication, appointment (cita) management, and pet (mascota) management.
• The README confirms:
• Backend: Spring Boot + Maven
• Frontend: React/Vite compiled into static assets under src/main/resources/static
• Persistent storage: MySQL
• Security: JWT-based authentication
File structure
• Top-level:
• pom.xml, mvnw(.cmd): Maven build configuration
• src/main/java/com/sena/clinicaveterinaria: Java source
• src/main/resources/static: built frontend (index.html, assets)
• src/main/resources/application.properties: DB, JWT and server config
• Java packages:
• config: SecurityConfig, SpaRedirectConfig
• controller: REST endpoints (AuthController, CitaController, MascotaController, UsuarioController)
• dto: request/response payloads (LoginRequest, AuthResponse)
• model: JPA entities (Usuario, Mascota, Cita)
• repository: Spring Data JPA interfaces
• service & service/impl: business logic, JWT handling
• Tests: src/test/java covers application startup test
Key architectural insights from the README
• Monolithic deployment: single JAR packaging both backend and frontend
• JWT security filter applied to /api/**
• Standard CRUD REST endpoints for citas and mascotas
• Database schema must be pre-created in MySQL
a. Controllers (AuthController, CitaController, MascotaController)
b. Services (JwtService, CitaServiceImpl, MascotaServiceImpl, UsuarioServiceImpl)
c. Repositories (CitaRepository, MascotaRepository, UsuarioRepository)
6. Off to the side, note the static-file serving component (SpaRedirectConfig) that delivers index.html and hashed assets from src/main/resources/static.
• “GET / → index.html”
• “POST /api/auth/login → AuthController.login() → JwtService.generateToken()”
• “GET/POST/PUT/DELETE /api/citas → CitaController → CitaService → CitaRepository → MySQL”
• Blue = HTTP/API layer
• Green = business logic
• Yellow = persistence
• Grey = static resource serving