How cmosquera1998/encuentro_matrimonial_backend works
Project type and purpose
• This is a backend web application (monolithic) built with Spring Boot. Its purpose is to provide a REST API for managing “Encuentros Matrimoniales” (marital encounters), covering user management, four “pillar” data models, formation modules, and geographic hierarchies. It uses Spring Security with JWT, Spring Data JPA, Swagger for documentation, and PostgreSQL for persistence. It can be containerized with Docker/Docker-Compose.
File structure
• Top-level artifacts:
• pom.xml, mvnw / mvnw.cmd, .mvn wrapper → Maven build
• Dockerfile, docker-compose.yml, docker.env → Container setup
• src/main/java/com/encuentro/matrimonial → Core app code
• src/main/resources → application.properties, messages.properties
• Within src/main/java/com/encuentro/matrimonial:
• configuration → SwaggerConfig, message bundles
• constants → Resource path and message constants
• controller → REST controllers for authentication, users, pillars, formation, location
• modelo → JPA entities (User, Role, City, Pilar1-4, Formation, etc.)
• repository → Spring Data JPA repos
• security → JWT filter, password encoder, security config
• service + implementation → Business logic interfaces and classes
• util → JWT util, initial data loader, error message wrappers
• Configuration files for Swagger, Spring profiles, and CORS settings appear in configuration packages.
Extract insights from the README
• Clearly describes a layered architecture: Controllers → Services → Repositories → Database.
• Uses JWT tokens for stateless auth, role-based access by geographic level.
• Exposes REST endpoints for each module.
• Uses Docker Compose for local setup, and can run with Maven packaging.
a. Main components
• API Gateway / HTTP layer (Spring MVC controllers)
• Security Layer (JWT filter + Spring Security)
• Business Logic Layer (Service interfaces + implementations)
• Data Access Layer (Spring Data JPA Repositories)
• Database (PostgreSQL)
• External tools: Swagger UI for API docs, Docker/Docker-Compose for containerization
b. Relationships and interactions
• Clients (e.g., frontend apps or API consumers) send HTTP requests to the API Gateway.
• Requests pass through the JWT filter (JwtRequestFilter) for authentication/authorization.
• Authenticated calls hit the appropriate Controller.
• Controller delegates to Service.
• Service invokes Repository to perform CRUD on the DB.
• DB returns entities, Service applies business logic, Controller maps to HTTP response models.
• Swagger UI reads Controller annotations to provide interactive docs.
• Docker Compose orchestrates container startup of the app and PostgreSQL.
c. Architectural patterns and design principles
• Layered (onion) architecture: Controllers → Services → Repositories → Entities
• Dependency injection via Spring
• Separation of concerns: Security, API layer, business logic, persistence
• Stateless JWT authentication for horizontal scalability
• Configuration by Spring Profiles (dev, prod, docker)
d. Key technologies/frameworks
• Spring Boot / Spring MVC, Spring Security (JWT)
• Spring Data JPA + Hibernate
• PostgreSQL 13
• Swagger (SpringFox)
• Docker & Docker-Compose
• Maven