# evilwave12/dsw2026-tpi architecture

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

- Interactive diagram: https://gitdiagram.com/evilwave12/dsw2026-tpi
- Repository: https://github.com/evilwave12/dsw2026-tpi

## Overview

This ASP.NET Core API exposes administrator registration/login and doctor-related operations. The visible authentication flow routes requests through the authentication controller and service, which validate credentials or register users and issue JWTs for login. Doctor operations are represented by a controller, service, persistence abstraction and EF-backed data layer. The tree and README do not document broader product capabilities; several configuration and doctor-controller details are unsampled, so those links are limited to relationships supported by the source index.

Main entry points: [`Dsw2026Tpi.Application/Services/DoctorService.cs`](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Services/DoctorService.cs) (Doctor service), [`Dsw2026Tpi.Application/Services/AuthenticationService.cs`](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Services/AuthenticationService.cs) (Authentication service), [`Dsw2026Tpi.Api/Controllers/AuthenticationController.cs`](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Api/Controllers/AuthenticationController.cs) (Authentication API), [`Dsw2026Tpi.Data/Identity/ApplicationUser.cs`](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Data/Identity/ApplicationUser.cs) (Identity user)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["HTTP API"]
  node_auth_controller["Authentication API"]
  node_doctor_controller["Doctor API"]
  node_exception_middleware["Error middleware"]
end

subgraph group_application["Application Services"]
  node_auth_service["Authentication service"]
  node_doctor_service["Doctor service<br/>[DoctorService.cs]"]
  node_signin["Password check<br/>[SignInService.cs]"]
  node_jwt["JWT issuer<br/>[JwtService.cs]"]
  node_auth_dto["Auth DTOs<br/>[RegisterModel.cs]"]
  node_doctor_dto["Doctor DTO<br/>[DoctorModel.cs]"]
end

subgraph group_domain["Domain and Persistence"]
  node_doctor["Doctor entity<br/>[Doctor.cs]"]
  node_speciality["Speciality entity<br/>[Speciality.cs]"]
  node_pagination["Pagination<br/>[Pagination.cs]"]
  node_persistence_contract["Persistence contract<br/>[IPersistence.cs]"]
  node_ef_persistence["EF persistence<br/>[PersistenceEf.cs]"]
  node_app_db[("Application database")]
end

subgraph group_identity["Identity and Errors"]
  node_user["Identity user<br/>[ApplicationUser.cs]"]
  node_auth_db[("Identity database")]
  node_errors["Application errors<br/>[AppException.cs]"]
  node_auth_error["Authentication error"]
end

node_caller(("API caller"))

node_caller -->|"sends requests"| node_auth_controller
node_auth_controller -->|"invokes"| node_auth_service
node_auth_service -->|"checks password"| node_signin
node_auth_service -->|"generates token"| node_jwt
node_auth_service -->|"creates user"| node_user
node_signin -->|"checks user"| node_user
node_auth_db -->|"maps identity"| node_user
node_auth_service -->|"throws"| node_auth_error
node_exception_middleware -->|"formats errors"| node_errors
node_caller -.->|"sends requests"| node_doctor_controller
node_doctor_controller -->|"invokes"| node_doctor_service
node_doctor_service -->|"uses persistence"| node_persistence_contract
node_doctor_service -->|"maps data"| node_doctor_dto
node_doctor_service -->|"uses entity"| node_doctor
node_doctor_service -->|"uses entity"| node_speciality
node_doctor_service -->|"uses paging"| node_pagination
node_ef_persistence -->|"implements"| node_persistence_contract
node_ef_persistence -->|"queries"| node_app_db
node_auth_controller -->|"accepts payload"| node_auth_dto

click node_auth_controller "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Api/Controllers/AuthenticationController.cs"
click node_doctor_controller "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Api/Controllers/DoctorController.cs"
click node_exception_middleware "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Api/Middlewares/ExceptionHandlingMiddleware.cs"
click node_auth_service "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Services/AuthenticationService.cs"
click node_doctor_service "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Services/DoctorService.cs"
click node_signin "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Api/Services/SignInService.cs"
click node_jwt "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Services/JwtService.cs"
click node_auth_dto "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Dtos/RegisterModel.cs"
click node_doctor_dto "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Dtos/DoctorModel.cs"
click node_doctor "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Domain/Entities/Doctor.cs"
click node_speciality "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Domain/Entities/Speciality.cs"
click node_pagination "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Domain/Entities/Pagination.cs"
click node_persistence_contract "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Domain/Interfaces/IPersistence.cs"
click node_ef_persistence "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Data/PersistenceEf.cs"
click node_app_db "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Data/Dsw2026TpiDbContext.cs"
click node_user "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Data/Identity/ApplicationUser.cs"
click node_auth_db "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Data/Identity/AuthenticationDbContext.cs"
click node_errors "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.CrossCutting/Exceptions/AppException.cs"
click node_auth_error "https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.CrossCutting/Exceptions/AuthenticationException.cs"

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_auth_controller,node_doctor_controller,node_exception_middleware toneBlue
class node_auth_service,node_doctor_service,node_signin,node_jwt,node_auth_dto,node_doctor_dto toneAmber
class node_doctor,node_speciality,node_pagination,node_persistence_contract,node_ef_persistence,node_app_db,node_caller toneMint
class node_user,node_auth_db,node_errors,node_auth_error toneRose
```

## Components

### HTTP API

- [Authentication API](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Api/Controllers/AuthenticationController.cs): `Dsw2026Tpi.Api/Controllers/AuthenticationController.cs`
- [Doctor API](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Api/Controllers/DoctorController.cs): `Dsw2026Tpi.Api/Controllers/DoctorController.cs`
- [Error middleware](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Api/Middlewares/ExceptionHandlingMiddleware.cs): `Dsw2026Tpi.Api/Middlewares/ExceptionHandlingMiddleware.cs`

### Application Services

- [Authentication service](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Services/AuthenticationService.cs): `Dsw2026Tpi.Application/Services/AuthenticationService.cs`
- [Doctor service](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Services/DoctorService.cs): `Dsw2026Tpi.Application/Services/DoctorService.cs`
- [Password check](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Api/Services/SignInService.cs): `Dsw2026Tpi.Api/Services/SignInService.cs`
- [JWT issuer](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Services/JwtService.cs): `Dsw2026Tpi.Application/Services/JwtService.cs`
- [Auth DTOs](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Dtos/RegisterModel.cs): `Dsw2026Tpi.Application/Dtos/RegisterModel.cs`
- [Doctor DTO](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Application/Dtos/DoctorModel.cs): `Dsw2026Tpi.Application/Dtos/DoctorModel.cs`

### Domain and Persistence

- [Doctor entity](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Domain/Entities/Doctor.cs): `Dsw2026Tpi.Domain/Entities/Doctor.cs`
- [Speciality entity](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Domain/Entities/Speciality.cs): `Dsw2026Tpi.Domain/Entities/Speciality.cs`
- [Pagination](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Domain/Entities/Pagination.cs): `Dsw2026Tpi.Domain/Entities/Pagination.cs`
- [Persistence contract](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Domain/Interfaces/IPersistence.cs): `Dsw2026Tpi.Domain/Interfaces/IPersistence.cs`
- [EF persistence](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Data/PersistenceEf.cs): `Dsw2026Tpi.Data/PersistenceEf.cs`
- [Application database](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Data/Dsw2026TpiDbContext.cs): `Dsw2026Tpi.Data/Dsw2026TpiDbContext.cs`

### Identity and Errors

- [Identity user](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Data/Identity/ApplicationUser.cs): `Dsw2026Tpi.Data/Identity/ApplicationUser.cs`
- [Identity database](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.Data/Identity/AuthenticationDbContext.cs): `Dsw2026Tpi.Data/Identity/AuthenticationDbContext.cs`
- [Application errors](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.CrossCutting/Exceptions/AppException.cs): `Dsw2026Tpi.CrossCutting/Exceptions/AppException.cs`
- [Authentication error](https://github.com/evilwave12/dsw2026-tpi/blob/main/Dsw2026Tpi.CrossCutting/Exceptions/AuthenticationException.cs): `Dsw2026Tpi.CrossCutting/Exceptions/AuthenticationException.cs`

### Other components

- **API caller**

## Connections

- API caller → Authentication API: sends requests (evidence: `Dsw2026Tpi.Api/Controllers/AuthenticationController.cs`)
- Authentication API → Authentication service: invokes (evidence: `Dsw2026Tpi.Api/Controllers/AuthenticationController.cs`)
- Authentication service → Password check: checks password (evidence: `Dsw2026Tpi.Application/Services/AuthenticationService.cs`)
- Authentication service → JWT issuer: generates token (evidence: `Dsw2026Tpi.Application/Services/AuthenticationService.cs`)
- Authentication service → Identity user: creates user (evidence: `Dsw2026Tpi.Application/Services/AuthenticationService.cs`)
- Password check → Identity user: checks user (evidence: `Dsw2026Tpi.Api/Services/SignInService.cs`)
- Identity database → Identity user: maps identity (evidence: `Dsw2026Tpi.Data/Identity/AuthenticationDbContext.cs`)
- Authentication service → Authentication error: throws (evidence: `Dsw2026Tpi.Application/Services/AuthenticationService.cs`)
- Error middleware → Application errors: formats errors (evidence: `Dsw2026Tpi.Api/Middlewares/ExceptionHandlingMiddleware.cs`)
- API caller → Doctor API: sends requests
- Doctor API → Doctor service: invokes (evidence: `Dsw2026Tpi.Api/Controllers/DoctorController.cs`)
- Doctor service → Persistence contract: uses persistence (evidence: `Dsw2026Tpi.Application/Services/DoctorService.cs`)
- Doctor service → Doctor DTO: maps data (evidence: `Dsw2026Tpi.Application/Services/DoctorService.cs`)
- Doctor service → Doctor entity: uses entity (evidence: `Dsw2026Tpi.Application/Services/DoctorService.cs`)
- Doctor service → Speciality entity: uses entity (evidence: `Dsw2026Tpi.Application/Services/DoctorService.cs`)
- Doctor service → Pagination: uses paging (evidence: `Dsw2026Tpi.Application/Services/DoctorService.cs`)
- EF persistence → Persistence contract: implements (evidence: `Dsw2026Tpi.Data/PersistenceEf.cs`)
- EF persistence → Application database: queries (evidence: `Dsw2026Tpi.Data/PersistenceEf.cs`)
- Authentication API → Auth DTOs: accepts payload (evidence: `Dsw2026Tpi.Api/Controllers/AuthenticationController.cs`)
