# p3t3r276/todolist-net8-fastendpoint architecture

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

- Interactive diagram: https://gitdiagram.com/p3t3r276/todolist-net8-fastendpoint
- Repository: https://github.com/p3t3r276/todolist-net8-fastendpoint

## Overview

##### Project type and purpose
- This is a full‐stack “ToDo List” application focusing (in the provided codebase) on the backend:
- ASP.NET Core Minimal API (.NET 8) using FastEndpoints
- Clean/Onion‐style architecture with separate layers (API, Application, Domain, Persistence)
- EF Core backends for SQL Server and SQLite, with planned extensions (MongoDB, Identity, Docker)
- The README describes testing EF Core integration, FastEndpoints, MediatR, and outlines future features (validation, identity, microservices).

##### File structure
Top‐level directories:
- backend/ – contains the entire .NET solution
– FastTodo.API (Minimal API project with HTTP endpoints)
– FastTodo.Application (CQRS handlers, request/response models)
– FastTodo.Domain (domain entities)
– FastTodo.Infrastructure (base DbContext abstraction)
– Persistence/EF (SQL Server context, migrations)
– Persistence/SQLite (SQLite context, migrations)
- docs/ – documentation folder

Key patterns:
- Layered Clean Architecture (API → Application → Domain → Persistence)
- CQRS via MediatR in Application layer
- FastEndpoints powering Minimal API routing

##### README for additional insights
- Technology stack: .NET 8, FastEndpoints, EF Core 9, MediatR, Angular front end
- Future integrations: FluentValidation, Docker, ASP.NET Identity, microservices for identity DB

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend
    FE["Angular Frontend"]:::frontend
    click FE "https://github.com/p3t3r276/todolist-net8-fastendpoint/tree/master/frontend/"

    %% API Layer
    subgraph "API Layer"
        API["FastTodo.API"]:::api
        Endpoints["API Endpoints"]:::api
        CT["CreateTodoEndpoint"]:::api
        GT["GetMyTodosEndpoint"]:::api
        Prog["Program & Config"]:::api
    end

    click API "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.API"
    click Endpoints "https://github.com/p3t3r276/todolist-net8-fastendpoint/tree/master/backend/FastTodo.API/Endpoints"
    click CT "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.API/Endpoints/Todo/Commands/CreateTodoEndpoint.cs"
    click GT "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.API/Endpoints/Todo/Queries/GetMyTodosEndpoint.cs"
    click Prog "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.API/Program.cs"

    %% Application Layer
    subgraph "Application Layer"
        App["FastTodo.Application"]:::app
        AppMod["Application ModuleConfiguration"]:::app
        CTH["CreateTodoItemHandler"]:::app
        CTR["CreateTodoRequest"]:::app
        GTH["GetMyTodosHandler"]:::app
        GTR["GetMyTodosRequest"]:::app
        DTO["TodoItemDto"]:::app
    end

    click App "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.Application"
    click AppMod "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.Application/ModuleConfiguration.cs"
    click CTH "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.Application/Features/Todos/Commands/CreateTodo/CreateTodoItemHandler.cs"
    click CTR "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.Application/Features/Todos/Commands/CreateTodo/CreateTodoRequest.cs"
    click GTH "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.Application/Features/Todos/Queries/GetMyTodos/GetMyTodosHandler.cs"
    click GTR "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.Application/Features/Todos/Queries/GetMyTodos/GetMyTodosRequest.cs"
    click DTO "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.Application/Features/Todos/Models/TodoItemDto.cs"

    %% Domain Layer
    subgraph "Domain Layer"
        Dom["FastTodo.Domain"]:::domain
        Entity["TodoItem"]:::domain
    end

    click Dom "https://github.com/p3t3r276/todolist-net8-fastendpoint/tree/master/backend/FastTodo.Domain/Entities"
    click Entity "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.Domain/Entities/TodoItem.cs"

    %% Persistence Layer
    subgraph "Persistence Layer"
        Infra["BaseDbContext"]:::persistence
        subgraph SQLServer
            SQLMod["SQL Server ModuleConfiguration"]:::persistence
            SQLCtx["FastTodoSQLDbContext"]:::persistence
            SQLConf["SQL Configurations"]:::persistence
        end
        subgraph SQLite
            LiteMod["SQLite ModuleConfiguration"]:::persistence
            LiteCtx["FastTodoSqliteDbContext"]:::persistence
            LiteConf["SQLite Configurations"]:::persistence
            Migs["SQLite Migrations"]:::persistence
        end
    end

    click Infra "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/FastTodo.Infrastructure/BaseDbContext.cs"
    click SQLMod "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/Persistence/EF/ModuleConfiguration.cs"
    click SQLCtx "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/Persistence/EF/DbContexts/FastTodoSQLDbContext/FastTodoSQLDbContext.cs"
    click SQLConf "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/Persistence/EF/DbContexts/FastTodoSQLDbContext/Configurations/FastTodoApplyFilterConfiguration.cs"
    click LiteMod "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/Persistence/SQLite/ModuleConfiguration.cs"
    click LiteCtx "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/Persistence/SQLite/DbContexts/FastTodoDbContext/FastTodoSqliteDbContext.cs"
    click LiteConf "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/Persistence/SQLite/DbContexts/FastTodoDbContext/Configurations/TodoItemConfiguration.cs"
    click Migs "https://github.com/p3t3r276/todolist-net8-fastendpoint/blob/master/backend/Persistence/SQLite/Data/Todo/Migrations/20250526064137_Initial.cs"

    %% External Systems
    subgraph "External Databases"
        SQLServerDB["SQL Server Instance"]:::external
        SQLiteFile["SQLite File"]:::external
        MongoDB["MongoDB (future)"]:::future
        IdentityDB["Identity DB (future)"]:::future
    end

    %% Data Flows
    FE -->|"HTTP/JSON"| API
    API -->|"routes to"| Endpoints
    Endpoints -->|"handles command"| CT
    Endpoints -->|"handles query"| GT
    CT -->|"MediatR CreateTodoRequest"| CTR
    GT -->|"MediatR GetMyTodosRequest"| GTR
    CTR -->|"handled by"| CTH
    GTR -->|"handled by"| GTH
    CTH -->|"uses"| AppMod
    GTH -->|"uses"| AppMod
    CTH -->|"maps to"| Entity
    GTH -->|"maps from"| Entity
    CTH -->|"calls"| Infra
    GTH -->|"calls"| Infra
    Infra -->|"implements"| SQLCtx
    Infra -->|"implements"| LiteCtx
    SQLCtx -->|"executes SQL"| SQLServerDB
    LiteCtx -->|"executes SQL"| SQLiteFile

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#1E70BF,stroke-width:2px;
    classDef api fill:#DFF7D8,stroke:#2E8B57,stroke-width:2px;
    classDef app fill:#FFF7D0,stroke:#D4A017,stroke-width:2px;
    classDef domain fill:#FFF3D6,stroke:#D69922,stroke-width:2px;
    classDef persistence fill:#FFE0B2,stroke:#E27D00,stroke-width:2px;
    classDef external fill:#E0E0E0,stroke:#777777,stroke-width:2px;
    classDef future fill:#F0F0F0,stroke:#AAAAAA,stroke-dasharray: 5 5;
```
