How bpthiago/estagio-rec works
This project is a C# web API designed to manage and coordinate student internship data for the Campus, specifically facilitating the processes for the Coordenadoria de Relações Institucionais e Extensão Comunitária – REC. The project is structured in a layered (or Clean Architecture) fashion, separating concerns clearly among the presentation layer (controllers), application/business logic, domain entities, and persistence layers.
Main Components
• Frontend/API Layer: Although there isn’t a dedicated “frontend” directory, the controllers (e.g., AlunoController, EmpresaController, EstagioController, OrientadorController) represent the API endpoints handling HTTP requests.
• Application Layer: Contains the business logic (UseCases, DTOs, Services) that drive the system’s processes for operations like adding, updating, deleting, and retrieving records for “Aluno”, “Empresa”, “Estagio”, and “Orientador”.
• Domain Layer: Encapsulates core business entities (Aluno, Empresa, Estagio, Orientador) and enumerations (e.g., SituacaoEnum) that define the data models.
• Persistence Layer: Responsible for data access and storage, including the AppDbContext, various repository implementations, and corresponding interfaces to abstract data operations.
• Supporting Infrastructure: Projects files like Dockerfile, docker-compose files indicate containerization, while configuration files (launchSettings.json) enable environment settings.
Component Relationships and Interactions
• The Controllers receive API requests and pass them to the Application layer. They invoke specific UseCases (e.g., AdicionarAlunoHandler, AtualizarEmpresaHandler) to process business logic.
• The UseCases interact with the Domain entities, validating and transforming data via Mappers and DTO objects.
• After processing, the UseCases will delegate operations to the Persistence layer through repository interfaces. The repositories (e.g., AlunoRepository, EmpresaRepository) implement the actual data access logic and communicate with the database.
• The Application layer also offers extensions (ServiceExtensions) to configure dependency injection, linking controllers, use cases, and repository implementations.
• Docker files and associated docker-compose configurations represent the deployment containerization strategy, showing how the application is built, tested, and deployed.
Architectural Patterns/Design Principles
• Layered Architecture / Clean Architecture: Clear separation into controllers, application logic, domain model, and persistence.
• Use of DTOs and Mappers: Ensures that data transformation logic is decoupled from business logic.
• Repository Pattern: For abstracting data access processing.
• Dependency Injection: Evidenced by ServiceExtensions to manage dependencies.
• Containerization: Use of Docker and Docker Compose for portability and deployment.
Relevant Technologies and Frameworks
• The project is based in .NET/C# (as evidenced by the .csproj file and solution file) using an MVC/Web API pattern.
• Entity Framework (likely inferred from the AppDbContext, which is typical in EF setups).
• Docker for containerization.
• Possibly additional .NET libraries/frameworks for dependency injection and mapping.
Detail the Data Flow and Dependency Injection
• That the Use Cases might have base classes (e.g., BaseUseCases) that provide common functionality, representing a shared service abstraction.