# farouk4web/todolist_cleanarch_dapper architecture

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

- Interactive diagram: https://gitdiagram.com/farouk4web/todolist_cleanarch_dapper
- Repository: https://github.com/farouk4web/todolist_cleanarch_dapper

## Overview

Nota is a Clean Architecture ASP.NET Core notes API. Clients send note requests to the controller, which dispatches CQRS requests through MediatR; handlers implement note operations, with repository-backed persistence described by the README. The graph also preserves user commands, domain models, pagination, and exception handling. Some application-to-repository calls are documented but their handler source excerpts were not provided, so those links cite the README rather than implying inspected code.

Main entry points: [`Nota.Api/Program.cs`](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Api/Program.cs) (MediatR dispatch), [`Nota.Infrastructure/Repositories/GenericRepository.cs`](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Infrastructure/Repositories/GenericRepository.cs) (Generic repository), [`Nota.Domain/Entities/Note.cs`](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Domain/Entities/Note.cs) (Note entity), [`Nota.Application/Features/Notes/Queries/GetList/GetNotesHandler.cs`](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Queries/GetList/GetNotesHandler.cs) (List notes handler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_presentation["API presentation"]
  node_notes_api["Notes controller<br/>[NotesController.cs]"]
  node_mediator["MediatR dispatch<br/>[Program.cs]"]
  node_errors["Exception middleware"]
end

subgraph group_application["Application features"]
  node_note_commands["Note commands<br/>[Commands]"]
  node_note_create["Create note handler"]
  node_note_update["Update note handler"]
  node_note_delete["Toggle delete handler"]
  node_note_get["Get note handler"]
  node_note_list["List notes handler<br/>[GetNotesHandler.cs]"]
  node_auth["User commands<br/>[Commands]"]
  node_pagination["Pagination models"]
  node_note_dto["Note DTO<br/>[NoteDto.cs]"]
end

subgraph group_domain["Domain model"]
  node_note_entity["Note entity<br/>[Note.cs]"]
  node_user_entity["User entity<br/>[User.cs]"]
  node_base_entity["Base entity<br/>[BaseEntity.cs]"]
  node_priority["Priority enum<br/>[Priority.cs]"]
end

subgraph group_persistence["Persistence"]
  node_repository["Generic repository"]
  node_unit_of_work["Unit of work<br/>[UnitOfWork.cs]"]
  node_sql_db[("SQL database")]
end

node_client(("API client"))

node_client -->|"sends requests"| node_notes_api
node_notes_api -->|"dispatches requests"| node_mediator
node_mediator -.->|"routes commands"| node_note_create
node_mediator -.->|"routes commands"| node_note_update
node_mediator -.->|"routes commands"| node_note_delete
node_mediator -.->|"routes queries"| node_note_get
node_mediator -.->|"routes queries"| node_note_list
node_notes_api -->|"accepts commands"| node_note_commands
node_note_create -->|"creates entity"| node_note_entity
node_note_update -->|"updates entity"| node_note_entity
node_note_delete -->|"updates entity"| node_note_entity
node_note_get -->|"queries entity"| node_note_entity
node_note_list -->|"queries entities"| node_note_entity
node_note_list -->|"uses pagination"| node_pagination
node_note_get -->|"uses DTO"| node_note_dto
node_note_list -->|"returns DTOs"| node_note_dto
node_note_create -.->|"uses repository"| node_repository
node_note_update -.->|"uses repository"| node_repository
node_note_delete -.->|"uses repository"| node_repository
node_note_get -.->|"uses repository"| node_repository
node_note_list -.->|"uses repository"| node_repository
node_auth -->|"handles users"| node_user_entity
node_note_entity -->|"inherits fields"| node_base_entity
node_user_entity -->|"inherits fields"| node_base_entity
node_note_dto -->|"uses enum"| node_priority
node_repository -->|"executes SQL"| node_sql_db
node_unit_of_work -->|"creates repositories"| node_repository
node_mediator -->|"registers service"| node_unit_of_work
node_notes_api -.->|"uses middleware"| node_errors

click node_notes_api "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Api/Controllers/NotesController.cs"
click node_mediator "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Api/Program.cs"
click node_errors "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Api/Middlewares/ExceptionMiddleware.cs"
click node_note_commands "https://github.com/farouk4web/todolist_cleanarch_dapper/tree/main/Nota.Application/Features/Notes/Commands"
click node_note_create "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Commands/Create/CreateNoteCommandHandler.cs"
click node_note_update "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Commands/Update/UpdateNoteCommandHandler.cs"
click node_note_delete "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Commands/Delete/ToggleDeleteNoteCommandHandler.cs"
click node_note_get "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Queries/GetById/GetNoteByIdHandler.cs"
click node_note_list "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Queries/GetList/GetNotesHandler.cs"
click node_auth "https://github.com/farouk4web/todolist_cleanarch_dapper/tree/main/Nota.Application/Features/Auth/Commands"
click node_pagination "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Common/PaginatedRequest.cs"
click node_note_dto "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Dtos/NoteDto.cs"
click node_note_entity "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Domain/Entities/Note.cs"
click node_user_entity "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Domain/Entities/User.cs"
click node_base_entity "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Domain/Entities/BaseEntity.cs"
click node_priority "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Domain/Enums/Priority.cs"
click node_repository "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Infrastructure/Repositories/GenericRepository.cs"
click node_unit_of_work "https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Infrastructure/Repositories/UnitOfWork.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_notes_api,node_mediator,node_errors,node_client toneBlue
class node_note_commands,node_note_create,node_note_update,node_note_delete,node_note_get,node_note_list,node_auth,node_pagination,node_note_dto toneAmber
class node_note_entity,node_user_entity,node_base_entity,node_priority toneMint
class node_repository,node_unit_of_work,node_sql_db toneRose
```

## Components

### API presentation

- [Notes controller](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Api/Controllers/NotesController.cs): `Nota.Api/Controllers/NotesController.cs`
- [MediatR dispatch](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Api/Program.cs): `Nota.Api/Program.cs`
- [Exception middleware](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Api/Middlewares/ExceptionMiddleware.cs): `Nota.Api/Middlewares/ExceptionMiddleware.cs`

### Application features

- [Note commands](https://github.com/farouk4web/todolist_cleanarch_dapper/tree/main/Nota.Application/Features/Notes/Commands): `Nota.Application/Features/Notes/Commands`
- [Create note handler](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Commands/Create/CreateNoteCommandHandler.cs): `Nota.Application/Features/Notes/Commands/Create/CreateNoteCommandHandler.cs`
- [Update note handler](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Commands/Update/UpdateNoteCommandHandler.cs): `Nota.Application/Features/Notes/Commands/Update/UpdateNoteCommandHandler.cs`
- [Toggle delete handler](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Commands/Delete/ToggleDeleteNoteCommandHandler.cs): `Nota.Application/Features/Notes/Commands/Delete/ToggleDeleteNoteCommandHandler.cs`
- [Get note handler](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Queries/GetById/GetNoteByIdHandler.cs): `Nota.Application/Features/Notes/Queries/GetById/GetNoteByIdHandler.cs`
- [List notes handler](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Queries/GetList/GetNotesHandler.cs): `Nota.Application/Features/Notes/Queries/GetList/GetNotesHandler.cs`
- [User commands](https://github.com/farouk4web/todolist_cleanarch_dapper/tree/main/Nota.Application/Features/Auth/Commands): `Nota.Application/Features/Auth/Commands`
- [Pagination models](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Common/PaginatedRequest.cs): `Nota.Application/Common/PaginatedRequest.cs`
- [Note DTO](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Application/Features/Notes/Dtos/NoteDto.cs): `Nota.Application/Features/Notes/Dtos/NoteDto.cs`

### Domain model

- [Note entity](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Domain/Entities/Note.cs): `Nota.Domain/Entities/Note.cs`
- [User entity](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Domain/Entities/User.cs): `Nota.Domain/Entities/User.cs`
- [Base entity](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Domain/Entities/BaseEntity.cs): `Nota.Domain/Entities/BaseEntity.cs`
- [Priority enum](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Domain/Enums/Priority.cs): `Nota.Domain/Enums/Priority.cs`

### Persistence

- [Generic repository](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Infrastructure/Repositories/GenericRepository.cs): `Nota.Infrastructure/Repositories/GenericRepository.cs`
- [Unit of work](https://github.com/farouk4web/todolist_cleanarch_dapper/blob/main/Nota.Infrastructure/Repositories/UnitOfWork.cs): `Nota.Infrastructure/Repositories/UnitOfWork.cs`
- **SQL database**

### Other components

- **API client**

## Connections

- API client → Notes controller: sends requests (evidence: `Nota.Api/Controllers/NotesController.cs`)
- Notes controller → MediatR dispatch: dispatches requests (evidence: `Nota.Api/Controllers/NotesController.cs`)
- MediatR dispatch → Create note handler: routes commands (evidence: `README.md`)
- MediatR dispatch → Update note handler: routes commands (evidence: `README.md`)
- MediatR dispatch → Toggle delete handler: routes commands (evidence: `README.md`)
- MediatR dispatch → Get note handler: routes queries (evidence: `README.md`)
- MediatR dispatch → List notes handler: routes queries (evidence: `README.md`)
- Notes controller → Note commands: accepts commands (evidence: `Nota.Api/Controllers/NotesController.cs`)
- Create note handler → Note entity: creates entity (evidence: `Nota.Application/Features/Notes/Commands/Create/CreateNoteCommandHandler.cs`)
- Update note handler → Note entity: updates entity (evidence: `Nota.Application/Features/Notes/Commands/Update/UpdateNoteCommandHandler.cs`)
- Toggle delete handler → Note entity: updates entity (evidence: `Nota.Application/Features/Notes/Commands/Delete/ToggleDeleteNoteCommandHandler.cs`)
- Get note handler → Note entity: queries entity (evidence: `Nota.Application/Features/Notes/Queries/GetById/GetNoteByIdHandler.cs`)
- List notes handler → Note entity: queries entities (evidence: `Nota.Application/Features/Notes/Queries/GetList/GetNotesHandler.cs`)
- List notes handler → Pagination models: uses pagination (evidence: `Nota.Application/Features/Notes/Queries/GetList/GetNotesHandler.cs`)
- Get note handler → Note DTO: uses DTO (evidence: `Nota.Application/Features/Notes/Queries/GetById/GetNoteByIdHandler.cs`)
- List notes handler → Note DTO: returns DTOs (evidence: `Nota.Application/Features/Notes/Queries/GetList/GetNotesHandler.cs`)
- Create note handler → Generic repository: uses repository (evidence: `README.md`)
- Update note handler → Generic repository: uses repository (evidence: `README.md`)
- Toggle delete handler → Generic repository: uses repository (evidence: `README.md`)
- Get note handler → Generic repository: uses repository (evidence: `README.md`)
- List notes handler → Generic repository: uses repository (evidence: `README.md`)
- User commands → User entity: handles users (evidence: `Nota.Application/Features/Auth/Commands/Create/CreateUserCommandHandler.cs`)
- Note entity → Base entity: inherits fields (evidence: `Nota.Domain/Entities/Note.cs`)
- User entity → Base entity: inherits fields (evidence: `Nota.Domain/Entities/User.cs`)
- Note DTO → Priority enum: uses enum (evidence: `Nota.Application/Features/Notes/Dtos/NoteDto.cs`)
- Generic repository → SQL database: executes SQL (evidence: `Nota.Infrastructure/Repositories/GenericRepository.cs`)
- Unit of work → Generic repository: creates repositories (evidence: `Nota.Infrastructure/Repositories/UnitOfWork.cs`)
- MediatR dispatch → Unit of work: registers service (evidence: `Nota.Api/Program.cs`)
- Notes controller → Exception middleware: uses middleware
