# j0rgemiranda/libreria.modelos architecture

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

- Interactive diagram: https://gitdiagram.com/j0rgemiranda/libreria.modelos
- Repository: https://github.com/j0rgemiranda/libreria.modelos

## Overview

##### Project type and purpose
- This is a full-stack ASP.NET Core solution named “Libreria” for managing a library’s data (autores, libros, editoriales, paises).
- It consists of:
- A class-library (Libreria.Modelos) containing domain POCOs.
- A RESTful Web API (Libreria.API) exposing CRUD endpoints.
- An MVC Web App (Libreria.MVC) providing an HTML UI.
- A small console API consumer (Librerria.API.Consumer) for direct API calls.
- A test project (Libreria.Test) for automated tests.

##### File structure
- Top-level solution (.sln) references four main projects.
- “Libreria.Modelos”: domain entities (Autor, Libro, Editorial, Pais).
- “Libreria.API”:
- Controllers folder (AutoresController, LibrosController, etc.).
- Data folder (AppDbContext + EF Core migrations).
- appsettings.json, launchSettings, HTTP-client script.
- “Libreria.MVC”:
- Controllers and Views organized by entity.
- wwwroot for static assets (Bootstrap, jQuery).
- Shared layouts, view imports.
- “Librerria.API.Consumer”: simple CRUD console app.
- “Libreria.Test”: test harness.

##### README
- README only names “Libreria.Modelos”. No extra architectural guidance.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Clients Layer
    subgraph "Clients"
        MVC["Libreria.MVC (UI)"]:::ui
        Consumer["API Consumer App"]:::ui
    end

    %% Service Layer
    subgraph "Service Layer"
        API["Libreria.API (REST Service)"]:::service
        subgraph "Controllers"
            AC["AutoresController"]:::service
            LC["LibrosController"]:::service
            EC["EditorialesController"]:::service
            PC["PaisesController"]:::service
        end
        subgraph "Configuration"
            APIConfig["appsettings.json & launchSettings.json"]:::service
        end
        subgraph "Data Access"
            DbContext["AppDbContext"]:::data
            Migrations["Migrations"]:::data
            DB[(Database)]:::data
        end
    end

    %% Domain and Tests
    Domain["Libreria.Modelos"]:::library
    Test["Libreria.Test"]:::library

    %% Connections
    MVC -->|HTTP/JSON| API
    Consumer -->|HTTP/JSON| API
    API -->|uses controllers| AC
    API -->|uses controllers| LC
    API -->|uses controllers| EC
    API -->|uses controllers| PC
    API -->|reads config| APIConfig
    API -->|EF Core DbContext| DbContext
    Migrations -->|apply migrations| DB
    DbContext -->|Reads/Writes| DB
    API -->|references| Domain
    MVC -->|references| Domain
    Test -->|references| API
    Test -->|references| Domain

    %% Click Events
    click Domain "https://github.com/j0rgemiranda/libreria.modelos/tree/master/Libreria.Modelos/"
    click API "https://github.com/j0rgemiranda/libreria.modelos/tree/master/Libreria.API/"
    click AC "https://github.com/j0rgemiranda/libreria.modelos/blob/master/Libreria.API/Controllers/AutoresController.cs"
    click LC "https://github.com/j0rgemiranda/libreria.modelos/blob/master/Libreria.API/Controllers/LibrosController.cs"
    click EC "https://github.com/j0rgemiranda/libreria.modelos/blob/master/Libreria.API/Controllers/EditorialesController.cs"
    click PC "https://github.com/j0rgemiranda/libreria.modelos/blob/master/Libreria.API/Controllers/PaisesController.cs"
    click DbContext "https://github.com/j0rgemiranda/libreria.modelos/blob/master/Libreria.API/Data/AppDbContext.cs"
    click Migrations "https://github.com/j0rgemiranda/libreria.modelos/tree/master/Libreria.API/Migrations/"
    click APIConfig "https://github.com/j0rgemiranda/libreria.modelos/blob/master/Libreria.API/appsettings.json"
    click MVC "https://github.com/j0rgemiranda/libreria.modelos/tree/master/Libreria.MVC/"
    click Consumer "https://github.com/j0rgemiranda/libreria.modelos/blob/master/Librerria.API.Consumer/Librerria.API.Consumer.csproj"
    click Test "https://github.com/j0rgemiranda/libreria.modelos/blob/master/Libreria.Test/Libreria.Test.csproj"

    %% Styles
    classDef ui fill:#e0f7fa,stroke:#0288d1,stroke-width:1px;
    classDef service fill:#e8f5e9,stroke:#2e7d32,stroke-width:1px;
    classDef data fill:#fff3e0,stroke:#ef6c00,stroke-width:1px;
    classDef library fill:#eeeeee,stroke:#616161,stroke-width:1px;
```
