# omniverse-labs/fullstack-dotnet-react architecture

> Architecture diagram of the GitHub repository omniverse-labs/fullstack-dotnet-react, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-07-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omniverse-labs/fullstack-dotnet-react
- Repository: https://github.com/omniverse-labs/fullstack-dotnet-react

## Overview

##### Project type and purpose
- This is a full-stack “To-Do” application with a React/Redux single-page frontend and an ASP .NET 5 Web API backend.
- Backend layers: API (Controllers), Core (services & interfaces), Data (EF Core, repositories), Tests (unit/integration).
- Frontend layers: React components, Redux actions/reducers/selectors, store, HTTP client (axios).

##### File structure
- Top-level folders:
- backend: contains FS.Todo.Api (Web API), FS.Todo.Core (business logic), FS.Todo.Data (EF Core context & repositories), FS.Todo.Tests (xUnit tests), FS.Todo.sln
- frontend: Create-React-App scaffold, public assets, src/features/todo, src/redux

- Key patterns:
- Layered architecture in backend (API → Service → Repository → Database)
- Dependency Injection (interfaces in Core and Data)
- EF Core code-first migrations in Data/Migrations
- Redux “ducks” pattern (actions, reducers, selectors per feature)

##### README insights
- Describes HTTP endpoints (GET/POST/PUT/DELETE /todo)
- Stack: .NET 5, EF Core (SQLite), React, Redux, axios, redux-thunk
- Unit tests for each layer, Swagger for API testing

##### Main components & their relationships
A. Frontend SPA
- React UI (components: AddTodoForm, TodoList, TodoItem, TodoPage)
- Redux layer (actions dispatch API calls, reducers update state, selectors read state)
- Axios HTTP client → calls backend endpoints

B. Backend Web API
- Controllers (TodoController) expose REST endpoints
- Core Services (ITodoService, TodoService) implement business logic
- Data Layer
– Repositories (ITodoRepository, TodoRepository) wrap EF Core DbContext
– Entities & EF Core migrations manage SQLite schema
- Program/Startup configure middleware, DI container, routing

C. Database
- SQLite file accessed via EF Core DbContext (TodoContext)

D. External/Development Tools
- Swagger/OpenAPI
- EF Core tools (dotnet-ef for migrations)
- VS Code debugger support
- Unit & integration tests (xUnit, NSubstitute, TestHost)

##### Architectural patterns & design principles
- Layered/Clean Architecture: Presentation → Application (services) → Domain Models → Infrastructure (repositories, EF Core)
- Dependency Inversion: controllers depend on interfaces, implementations injected at runtime
- Separation of Concerns: UI separate from state management, API separate from data access
- Code-first Migrations ensure DB version control

## Diagram (Mermaid)

```mermaid
graph TD
    subgraph "UI Layer"
        Browser["Browser/SPA"]:::frontend
    end

    subgraph "Frontend App"
        Index["Index (root)"]:::frontend
        App["App"]:::frontend
        AddTodoForm["AddTodoForm"]:::frontend
        TodoPage["TodoPage"]:::frontend
        TodoList["TodoList"]:::frontend
        TodoItem["TodoItem"]:::frontend
        Store["Redux Store"]:::frontend
        Actions["Todo Actions"]:::frontend
        TodoReducer["Todo Reducer"]:::frontend
        RootReducer["Root Reducer"]:::frontend
        Selectors["Todo Selectors"]:::frontend
    end

    subgraph "Backend API"
        Program["Program"]:::backend
        Startup["Startup"]:::backend
        TodoController["TodoController"]:::backend
        CreateModel["CreateTodoModel"]:::backend
        UpdateModel["UpdateTodoModel"]:::backend
        ITodoService["ITodoService"]:::backend
        TodoService["TodoService"]:::backend
        ITodoRepo["ITodoRepository"]:::backend
        TodoRepo["TodoRepository"]:::backend
        TodoContext["TodoContext (DbContext)"]:::backend
    end

    subgraph "Database"
        SQLite["SQLite DB file"]:::database
    end

    subgraph "Dev/Test Tools"
        Swagger["Swagger UI"]:::tool
        Migrations["EF Core Migrations"]:::tool
        TestsAPI["API Tests"]:::tool
        TestsCore["Core Tests"]:::tool
        TestsData["Data Tests"]:::tool
    end

    Browser -->|"loads"| Index
    Index -->|"renders"| App
    App -->|"renders"| AddTodoForm
    App -->|"renders"| TodoPage
    TodoPage -->|"contains"| TodoList
    TodoList -->|"contains"| TodoItem

    App -->|"provides"| Store
    Store -->|"dispatch"| Actions
    Actions -->|"calls HTTP"| TodoController
    App -->|"selects"| Selectors

    TodoController -->|"calls"| ITodoService
    ITodoService -->|"implemented by"| TodoService
    TodoService -->|"depends on"| ITodoRepo
    ITodoRepo -->|"implemented by"| TodoRepo
    TodoRepo -->|"uses"| TodoContext
    TodoContext -->|"saves data"| SQLite

    Migrations -->|"modifies schema"| TodoContext
    Swagger -->|"tests endpoints"| TodoController
    TestsAPI -->|"tests"| TodoController
    TestsCore -->|"tests"| TodoService
    TestsData -->|"tests"| TodoRepo

    click AddTodoForm "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/frontend/src/features/todo/AddTodoForm.js"
    click TodoPage "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/frontend/src/features/todo/TodoPage.js"
    click TodoList "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/frontend/src/features/todo/TodoList.js"
    click TodoItem "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/frontend/src/features/todo/TodoItem.js"
    click Store "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/frontend/src/redux/store.js"
    click Actions "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/frontend/src/redux/actions/todoActions.js"
    click TodoReducer "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/frontend/src/redux/reducers/todoReducer.js"
    click RootReducer "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/frontend/src/redux/reducers/rootReducer.js"
    click Selectors "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/frontend/src/redux/selectors/todoSelectors.js"
    click Index "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/frontend/src/index.js"
    click App "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/frontend/src/App.js"
    click TodoController "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Api/Controllers/TodoController.cs"
    click Program "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Api/Program.cs"
    click Startup "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Api/Startup.cs"
    click CreateModel "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Api/Models/CreateTodoModel.cs"
    click UpdateModel "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Api/Models/UpdateTodoModel.cs"
    click ITodoService "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Core/Interfaces/ITodoService.cs"
    click TodoService "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Core/Services/TodoService.cs"
    click ITodoRepo "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Data/Interfaces/ITodoRepository.cs"
    click TodoRepo "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Data/Repositories/TodoRepository.cs"
    click TodoContext "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Data/TodoContext.cs"
    click TestsAPI "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Tests/Api/TodoControllerTests.cs"
    click TestsCore "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Tests/Core/TodoServiceTests.cs"
    click TestsData "https://github.com/omniverse-labs/fullstack-dotnet-react/blob/main/backend/FS.Todo.Tests/Data/TodoRepositoryTests.cs"

    classDef frontend fill:#D0E8FF,stroke:#0288D1,color:#000;
    classDef backend fill:#E8F5E9,stroke:#2E7D32,color:#000;
    classDef database fill:#FFF3E0,stroke:#F57C00,color:#000;
    classDef tool fill:#ECEFF1,stroke:#607D8B,color:#000;
```
