# eospinam/pruebafinanzauto architecture

> Architecture diagram of the GitHub repository eospinam/pruebafinanzauto, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-08-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/eospinam/pruebafinanzauto
- Repository: https://github.com/eospinam/pruebafinanzauto

## Overview

##### Project type and purpose
- This is a .NET solution implementing a clean-architecture (onion/hexagonal) backend API (“Finanzauto”).
- It exposes REST endpoints for authentication, and CRUD operations on Students, Teachers, Courses, Notes, and their relationships.

##### File structure
- Top-level solution file (`PruebaFinanzauto.sln`) groups four projects:
- PruebaFinanzauto.Api – the ASP.NET Core Web API (controllers, HTTP, launch settings)
- PruebaFinanzauto.Application – application layer (DTOs, interfaces, services, AutoMapper profiles)
- PruebaFinanzauto.Domain – domain layer (entities)
- PruebaFinanzauto.Infrastructure – infrastructure layer (EF Core DbContext, migrations, repository implementations)
- Controllers receive HTTP, call services in the Application layer via injected interfaces.
- Services orchestrate business logic, map between domain entities and DTOs, and call repository interfaces.
- Repository implementations in Infrastructure use Entity Framework Core to persist the Domain entities to a relational database.

##### README
- The README is minimal, so rely on the file structure and naming conventions for insights into architecture and tech stack.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client
    Client["Client"]:::external

    %% API Layer
    subgraph "API Layer"
        direction TB
        Program["Program & HTTP Setup"]:::api
        AuthController["AuthController"]:::api
        StudentsController["StudentsController"]:::api
        TeachersController["TeachersController"]:::api
        CoursesController["CoursesController"]:::api
        NotesController["NotesController"]:::api
        StudentCourseController["StudentCourseController"]:::api
    end

    %% Application Layer
    subgraph "Application Layer"
        direction TB
        AuthService["AuthService"]:::app
        StudentService["StudentService"]:::app
        DTOs["DTOs"]:::app
        AutoMapperProfile["AutoMapperProfile"]:::app
        IStudentRepository["IStudentRepository"]:::app
    end

    %% Domain Layer
    subgraph "Domain Layer"
        direction TB
        StudentEntity["Student"]:::domain
        TeacherEntity["Teacher"]:::domain
        CourseEntity["Course"]:::domain
        NoteEntity["Note"]:::domain
        StudentCourseEntity["StudentCourse"]:::domain
    end

    %% Infrastructure Layer
    subgraph "Infrastructure Layer"
        direction TB
        AppDbContext["AppDbContext"]:::infra
        Migrations["Migrations"]:::infra
        StudentRepository["StudentRepository"]:::infra
    end

    %% Database
    Database[(Database)]:::db

    %% Connections
    Client -->|"HTTP/JSON"| Program
    Program -->|"routing"| AuthController
    Program -->|"routing"| StudentsController
    Program -->|"routing"| TeachersController
    Program -->|"routing"| CoursesController
    Program -->|"routing"| NotesController
    Program -->|"routing"| StudentCourseController

    AuthController -->|"calls"| AuthService
    StudentsController -->|"calls"| StudentService
    TeachersController -->|"calls"| AuthService
    CoursesController -->|"calls"| AuthService
    NotesController -->|"calls"| AuthService
    StudentCourseController -->|"calls"| AuthService

    AuthService -->|"usesDTOs"| DTOs
    StudentService -->|"usesDTOs"| DTOs

    DTOs -->|"mapping"| AutoMapperProfile
    AutoMapperProfile -->|"maps to"| StudentEntity
    AutoMapperProfile -->|"maps to"| TeacherEntity
    AutoMapperProfile -->|"maps to"| CourseEntity
    AutoMapperProfile -->|"maps to"| NoteEntity
    AutoMapperProfile -->|"maps to"| StudentCourseEntity

    StudentService -->|"depends on"| IStudentRepository
    IStudentRepository -->|"implemented by"| StudentRepository

    StudentRepository -->|"uses EFCore"| AppDbContext
    AppDbContext -->|"executes SQL"| Database
    Migrations -->|"apply schema"| Database
    Database -->|"return entities"| AppDbContext
    AppDbContext -->|"materialize"| StudentEntity
    AppDbContext -->|"materialize"| TeacherEntity
    AppDbContext -->|"materialize"| CourseEntity
    AppDbContext -->|"materialize"| NoteEntity
    AppDbContext -->|"materialize"| StudentCourseEntity

    %% Click Events
    click AuthController "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Api/Controller/AuthController.cs"
    click StudentsController "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Api/Controller/StudentsController.cs"
    click TeachersController "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Api/Controller/TeachersController.cs"
    click CoursesController "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Api/Controller/CoursesController.cs"
    click NotesController "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Api/Controller/NotesController.cs"
    click StudentCourseController "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Api/Controller/StudentCourseController.cs"
    click Program "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Api/Program.cs"
    click AuthService "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Application/Services/AuthService.cs"
    click StudentService "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Application/Services/StudentService.cs"
    click DTOs "https://github.com/eospinam/pruebafinanzauto/tree/master/PruebaFinanzauto.Application/DTOs/"
    click AutoMapperProfile "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Application/Mapping/AutoMapperProfile.cs"
    click IStudentRepository "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Application/Interfaces/IStudentRepository.cs"
    click StudentEntity "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Domain/Entities/Student.cs"
    click TeacherEntity "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Domain/Entities/Teacher.cs"
    click CourseEntity "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Domain/Entities/Course.cs"
    click NoteEntity "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Domain/Entities/Note.cs"
    click StudentCourseEntity "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Domain/Entities/StudentCourse.cs"
    click AppDbContext "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Infrastructure/AppDbContext.cs"
    click Migrations "https://github.com/eospinam/pruebafinanzauto/tree/master/PruebaFinanzauto.Infrastructure/Migrations/"
    click StudentRepository "https://github.com/eospinam/pruebafinanzauto/blob/master/PruebaFinanzauto.Infrastructure/Repositories/StudentRepository.cs"

    %% Styles
    classDef external fill:#FFFFFF,stroke:#000000,stroke-width:1px
    classDef api fill:#D0E8FF,stroke:#000000,stroke-width:1px
    classDef app fill:#DFFFD8,stroke:#000000,stroke-width:1px
    classDef domain fill:#FFE3B8,stroke:#000000,stroke-width:1px
    classDef infra fill:#E8DAFF,stroke:#000000,stroke-width:1px
    classDef db fill:#C0C0C0,stroke:#000000,stroke-width:1px
```
