# alissonsilva/projetodbz architecture

> Architecture diagram of the GitHub repository alissonsilva/projetodbz, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-15). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alissonsilva/projetodbz
- Repository: https://github.com/alissonsilva/projetodbz

## Overview

ProjetoDBZ is an ASP.NET Core API for user authentication and managing Dragon Ball Z characters, types, and favorites. The main workflow is an HTTP request to a controller, optional character-service processing, and persistence through Entity Framework to the configured database. Authentication issues JWTs used by the API’s authenticated routes. The graph also includes type and favorites endpoints, persistence models, and request middleware. Evidence is limited to the supplied excerpts and source index; unsampled controller and middleware behavior is not inferred.

Main entry points: [`Data/AppDbContext.cs`](https://github.com/alissonsilva/projetodbz/blob/main/Data/AppDbContext.cs) (EF data context), [`Program.cs`](https://github.com/alissonsilva/projetodbz/blob/main/Program.cs) (ASP.NET host), [`Controllers/PersonagensController.cs`](https://github.com/alissonsilva/projetodbz/blob/main/Controllers/PersonagensController.cs) (Character routes), [`Services/PersonagemService.cs`](https://github.com/alissonsilva/projetodbz/blob/main/Services/PersonagemService.cs) (Character operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API endpoints"]
  node_characters["Character routes"]
  node_auth["Authentication routes<br/>[AuthController.cs]"]
  node_types["Type routes<br/>[TipoController.cs]"]
  node_favorites["Favorites routes"]
end

subgraph group_domain["Domain contracts"]
  node_character_dto["Character DTOs"]
  node_common_dto["Paging DTO"]
  node_user_dto["User DTOs"]
  node_type_dto["Type DTOs"]
end

subgraph group_services["Application services"]
  node_character_service_contract["Character service contract"]
  node_character_service["Character operations"]
  node_user_service_contract["User service contract<br/>[IUserService.cs]"]
  node_user_service["Registration and login<br/>[UserService.cs]"]
end

subgraph group_persistence["Persistence and pipeline"]
  node_models["Domain models"]
  node_dbcontext["EF data context<br/>[AppDbContext.cs]"]
  node_database[("MySQL database")]
  node_host["ASP.NET host<br/>[Program.cs]"]
  node_request_middleware["Request middleware"]
end

node_caller(("API client"))

node_caller -->|"sends requests"| node_characters
node_caller -->|"sends requests"| node_auth
node_caller -->|"sends requests"| node_types
node_caller -->|"sends requests"| node_favorites
node_characters -->|"accepts and returns"| node_character_dto
node_characters -->|"calls"| node_character_service_contract
node_characters -->|"reads and saves"| node_dbcontext
node_auth -->|"calls"| node_user_service_contract
node_types -->|"reads and writes"| node_dbcontext
node_favorites -->|"reads and writes"| node_dbcontext
node_character_service_contract -->|"defines operations"| node_character_dto
node_character_service_contract -->|"returns pages"| node_common_dto
node_character_service -->|"queries and saves"| node_dbcontext
node_character_service -->|"maps data"| node_character_dto
node_character_service -->|"builds pages"| node_common_dto
node_user_service_contract -->|"accepts requests"| node_user_dto
node_user_service -->|"queries and saves"| node_dbcontext
node_user_service -->|"reads credentials"| node_user_dto
node_host -->|"registers implementation"| node_character_service_contract
node_host -->|"registers implementation"| node_character_service
node_host -->|"registers implementation"| node_user_service_contract
node_host -->|"registers implementation"| node_user_service
node_host -->|"configures database"| node_dbcontext
node_dbcontext -->|"persists entities"| node_database
node_dbcontext -->|"maps entities"| node_models
node_host -->|"registers middleware"| node_request_middleware

click node_characters "https://github.com/alissonsilva/projetodbz/blob/main/Controllers/PersonagensController.cs"
click node_auth "https://github.com/alissonsilva/projetodbz/blob/main/Controllers/AuthController.cs"
click node_types "https://github.com/alissonsilva/projetodbz/blob/main/Controllers/TipoController.cs"
click node_favorites "https://github.com/alissonsilva/projetodbz/blob/main/Controllers/FavoritosController.cs"
click node_character_dto "https://github.com/alissonsilva/projetodbz/tree/main/DTO/Personagens"
click node_common_dto "https://github.com/alissonsilva/projetodbz/blob/main/DTO/Common/PagedResponseDto.cs"
click node_user_dto "https://github.com/alissonsilva/projetodbz/tree/main/DTO/User"
click node_type_dto "https://github.com/alissonsilva/projetodbz/tree/main/DTO/Tipos"
click node_character_service_contract "https://github.com/alissonsilva/projetodbz/blob/main/Services/Interfaces/IPersonagemService.cs"
click node_character_service "https://github.com/alissonsilva/projetodbz/blob/main/Services/PersonagemService.cs"
click node_user_service_contract "https://github.com/alissonsilva/projetodbz/blob/main/Services/Interfaces/IUserService.cs"
click node_user_service "https://github.com/alissonsilva/projetodbz/blob/main/Services/UserService.cs"
click node_models "https://github.com/alissonsilva/projetodbz/tree/main/Models"
click node_dbcontext "https://github.com/alissonsilva/projetodbz/blob/main/Data/AppDbContext.cs"
click node_host "https://github.com/alissonsilva/projetodbz/blob/main/Program.cs"
click node_request_middleware "https://github.com/alissonsilva/projetodbz/tree/main/Middleware"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_characters,node_auth,node_types,node_favorites,node_caller toneBlue
class node_character_dto,node_common_dto,node_user_dto,node_type_dto toneAmber
class node_character_service_contract,node_character_service,node_user_service_contract,node_user_service toneMint
class node_models,node_dbcontext,node_database,node_host,node_request_middleware toneRose
```

## Components

### API endpoints

- [Character routes](https://github.com/alissonsilva/projetodbz/blob/main/Controllers/PersonagensController.cs): `Controllers/PersonagensController.cs`
- [Authentication routes](https://github.com/alissonsilva/projetodbz/blob/main/Controllers/AuthController.cs): `Controllers/AuthController.cs`
- [Type routes](https://github.com/alissonsilva/projetodbz/blob/main/Controllers/TipoController.cs): `Controllers/TipoController.cs`
- [Favorites routes](https://github.com/alissonsilva/projetodbz/blob/main/Controllers/FavoritosController.cs): `Controllers/FavoritosController.cs`

### Domain contracts

- [Character DTOs](https://github.com/alissonsilva/projetodbz/tree/main/DTO/Personagens): `DTO/Personagens`
- [Paging DTO](https://github.com/alissonsilva/projetodbz/blob/main/DTO/Common/PagedResponseDto.cs): `DTO/Common/PagedResponseDto.cs`
- [User DTOs](https://github.com/alissonsilva/projetodbz/tree/main/DTO/User): `DTO/User`
- [Type DTOs](https://github.com/alissonsilva/projetodbz/tree/main/DTO/Tipos): `DTO/Tipos`

### Application services

- [Character service contract](https://github.com/alissonsilva/projetodbz/blob/main/Services/Interfaces/IPersonagemService.cs): `Services/Interfaces/IPersonagemService.cs`
- [Character operations](https://github.com/alissonsilva/projetodbz/blob/main/Services/PersonagemService.cs): `Services/PersonagemService.cs`
- [User service contract](https://github.com/alissonsilva/projetodbz/blob/main/Services/Interfaces/IUserService.cs): `Services/Interfaces/IUserService.cs`
- [Registration and login](https://github.com/alissonsilva/projetodbz/blob/main/Services/UserService.cs): `Services/UserService.cs`

### Persistence and pipeline

- [Domain models](https://github.com/alissonsilva/projetodbz/tree/main/Models): `Models`
- [EF data context](https://github.com/alissonsilva/projetodbz/blob/main/Data/AppDbContext.cs): `Data/AppDbContext.cs`
- **MySQL database**
- [ASP.NET host](https://github.com/alissonsilva/projetodbz/blob/main/Program.cs): `Program.cs`
- [Request middleware](https://github.com/alissonsilva/projetodbz/tree/main/Middleware): `Middleware`

### Other components

- **API client**

## Connections

- API client → Character routes: sends requests (evidence: `Controllers/PersonagensController.cs`)
- API client → Authentication routes: sends requests (evidence: `Controllers/AuthController.cs`)
- API client → Type routes: sends requests (evidence: `Controllers/TipoController.cs`)
- API client → Favorites routes: sends requests (evidence: `Controllers/FavoritosController.cs`)
- Character routes → Character DTOs: accepts and returns (evidence: `Controllers/PersonagensController.cs`)
- Character routes → Character service contract: calls (evidence: `Controllers/PersonagensController.cs`)
- Character routes → EF data context: reads and saves (evidence: `Controllers/PersonagensController.cs`)
- Authentication routes → User service contract: calls (evidence: `Controllers/AuthController.cs`)
- Type routes → EF data context: reads and writes (evidence: `Controllers/TipoController.cs`)
- Favorites routes → EF data context: reads and writes (evidence: `Controllers/FavoritosController.cs`)
- Character service contract → Character DTOs: defines operations (evidence: `Services/Interfaces/IPersonagemService.cs`)
- Character service contract → Paging DTO: returns pages (evidence: `Services/Interfaces/IPersonagemService.cs`)
- Character operations → EF data context: queries and saves (evidence: `Services/PersonagemService.cs`)
- Character operations → Character DTOs: maps data (evidence: `Services/PersonagemService.cs`)
- Character operations → Paging DTO: builds pages (evidence: `Services/PersonagemService.cs`)
- User service contract → User DTOs: accepts requests (evidence: `Services/Interfaces/IUserService.cs`)
- Registration and login → EF data context: queries and saves (evidence: `Services/UserService.cs`)
- Registration and login → User DTOs: reads credentials (evidence: `Services/UserService.cs`)
- ASP.NET host → Character service contract: registers implementation (evidence: `Program.cs`)
- ASP.NET host → Character operations: registers implementation (evidence: `Program.cs`)
- ASP.NET host → User service contract: registers implementation (evidence: `Program.cs`)
- ASP.NET host → Registration and login: registers implementation (evidence: `Program.cs`)
- ASP.NET host → EF data context: configures database (evidence: `Program.cs`)
- EF data context → MySQL database: persists entities
- EF data context → Domain models: maps entities (evidence: `Data/AppDbContext.cs`)
- ASP.NET host → Request middleware: registers middleware (evidence: `Program.cs`)
