How carlosquiroz25/proyecto_integrador_api works
Main Components
• API Gateway / Controller Layer: Represented by the multiple controllers (e.g., AnswerController, AuthController, SurveyController, UserAdminController, UserStudentController, UserTeacherController) that expose REST endpoints.
• Service Layer: Contains the business logic and is divided by responsibilities (e.g., AuthService, UserService, SurveyService). Include both the service interfaces and their implementations.
• Data Access Layer: Represented by the repository interfaces (e.g., AnswerRepository, ProfileRepository, UserRepository). This layer handles persistence through Spring Data JPA.
• Domain / Model: The core business entities (User, Profile, Survey, Question, Answer) which dictate the domain logic.
• Security Layer: Covers authentication and authorization aspects such as JWT processing (JwtFilter, JwtUtil, SecurityConfig) and Spring Security configuration.
• External Components: Database (either MySQL or PostgreSQL, as well as any third-party integrations such as Swagger/OpenAPI for API documentation). Also consider external services (like Docker) and cloud deployment environment configuration.
• Infrastructure & Configuration: This includes configuration classes (CorsConfig, OpenApiConfig) and environment-specific files (.env, Dockerfile).
Relationships and Interactions
• The controllers pass requests to the service layer; these services then interact with the repository layer to perform CRUD operations on the database.
• Bidirectional interaction between Entities (Domain Models) and Repositories for persistence.
• Optionally, include how Swagger/OpenAPI is exposed to document and test the API.
Architectural Patterns and Principles
• Follow the layered architecture pattern: clearly separate controllers (presentation), services (business logic), repositories (data persistence) and models (domain).
• Use of dependency injection via Spring Boot.
• Stateless authentication mechanism via JWT.
Extra Details to Consider
• Mention integration with Swagger/OpenAPI for API documentation and testing.
• Environmental configuration aspects (like .env configuration for database and JWT secrets).
• That the project supports role-based interactions (ADMIN, STUDENT, TEACHER) by showing that some controllers and services cater to specific roles. These roles could be illustrated as sub-components or labeled areas within the “Security” domain.