# saimahmt03/minimalapi architecture

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

- Interactive diagram: https://gitdiagram.com/saimahmt03/minimalapi
- Repository: https://github.com/saimahmt03/minimalapi

## Overview

MinimalApi is a category CRUD HTTP API: callers request category listing, lookup, creation, or removal, and receive category data. Requests enter through mapped endpoints, pass through a service abstraction to a repository, and use an in-memory list as mock storage. DTOs define the operation inputs and outputs; a helper copies category records for list results. The README is empty, so capability coverage comes from the endpoint and source index; startup wiring was not sampled, so no registration relationship is asserted.

Main entry points: [`MinimalApi/Reporsitories/Repository/CategoryRepository.cs`](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Reporsitories/Repository/CategoryRepository.cs) (Category repository), [`MinimalApi/Endpoints/CategoryEndpoint.cs`](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Endpoints/CategoryEndpoint.cs) (Category endpoints), [`MinimalApi/Services/Service/CategoryService.cs`](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Services/Service/CategoryService.cs) (Category service), [`MinimalApi/Helper/Helper.cs`](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Helper/Helper.cs) (Category copier)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_http["HTTP API"]
  node_endpoints["Category endpoints"]
  node_request_dtos["Request DTOs"]
  node_response_dtos["Response DTOs"]
end

subgraph group_app["Category logic"]
  node_service_contract["Service contract"]
  node_service["Category service<br/>[CategoryService.cs]"]
  node_category_model["Category model<br/>[Category.cs]"]
end

subgraph group_data["Category data"]
  node_repo_contract["Repository contract"]
  node_repository["Category repository"]
  node_category_list[("In-memory categories")]
  node_copy_helper["Category copier<br/>[Helper.cs]"]
end

node_caller(("API caller"))

node_caller -->|"calls routes"| node_endpoints
node_endpoints -->|"calls"| node_service_contract
node_service -->|"implements"| node_service_contract
node_service -->|"delegates to"| node_repo_contract
node_repository -->|"implements"| node_repo_contract
node_repository -->|"reads and writes"| node_category_list
node_repository -->|"copies lists"| node_copy_helper
node_copy_helper -->|"creates copies"| node_category_model
node_repository -->|"uses records"| node_category_model
node_endpoints -->|"binds inputs"| node_request_dtos
node_endpoints -->|"returns results"| node_response_dtos
node_repository -->|"consumes inputs"| node_request_dtos
node_repository -->|"builds results"| node_response_dtos

click node_endpoints "https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Endpoints/CategoryEndpoint.cs"
click node_service_contract "https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Services/Interface/ICategoryService.cs"
click node_service "https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Services/Service/CategoryService.cs"
click node_repo_contract "https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Reporsitories/Interface/ICategoryRepository.cs"
click node_repository "https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Reporsitories/Repository/CategoryRepository.cs"
click node_category_list "https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Reporsitories/Repository/CategoryRepository.cs"
click node_copy_helper "https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Helper/Helper.cs"
click node_category_model "https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Models/Category.cs"
click node_request_dtos "https://github.com/saimahmt03/minimalapi/tree/master/MinimalApi/DTO/category"
click node_response_dtos "https://github.com/saimahmt03/minimalapi/tree/master/MinimalApi/DTO/category"

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_endpoints,node_request_dtos,node_response_dtos toneBlue
class node_service_contract,node_service,node_category_model toneAmber
class node_repo_contract,node_repository,node_category_list,node_copy_helper,node_caller toneMint
```

## Components

### HTTP API

- [Category endpoints](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Endpoints/CategoryEndpoint.cs): `MinimalApi/Endpoints/CategoryEndpoint.cs`
- [Request DTOs](https://github.com/saimahmt03/minimalapi/tree/master/MinimalApi/DTO/category): `MinimalApi/DTO/category`
- [Response DTOs](https://github.com/saimahmt03/minimalapi/tree/master/MinimalApi/DTO/category): `MinimalApi/DTO/category`

### Category logic

- [Service contract](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Services/Interface/ICategoryService.cs): `MinimalApi/Services/Interface/ICategoryService.cs`
- [Category service](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Services/Service/CategoryService.cs): `MinimalApi/Services/Service/CategoryService.cs`
- [Category model](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Models/Category.cs): `MinimalApi/Models/Category.cs`

### Category data

- [Repository contract](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Reporsitories/Interface/ICategoryRepository.cs): `MinimalApi/Reporsitories/Interface/ICategoryRepository.cs`
- [Category repository](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Reporsitories/Repository/CategoryRepository.cs): `MinimalApi/Reporsitories/Repository/CategoryRepository.cs`
- [In-memory categories](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Reporsitories/Repository/CategoryRepository.cs): `MinimalApi/Reporsitories/Repository/CategoryRepository.cs`
- [Category copier](https://github.com/saimahmt03/minimalapi/blob/master/MinimalApi/Helper/Helper.cs): `MinimalApi/Helper/Helper.cs`

### Other components

- **API caller**

## Connections

- API caller → Category endpoints: calls routes (evidence: `MinimalApi/Endpoints/CategoryEndpoint.cs`)
- Category endpoints → Service contract: calls (evidence: `MinimalApi/Endpoints/CategoryEndpoint.cs`)
- Category service → Service contract: implements (evidence: `MinimalApi/Services/Service/CategoryService.cs`)
- Category service → Repository contract: delegates to (evidence: `MinimalApi/Services/Service/CategoryService.cs`)
- Category repository → Repository contract: implements (evidence: `MinimalApi/Reporsitories/Repository/CategoryRepository.cs`)
- Category repository → In-memory categories: reads and writes (evidence: `MinimalApi/Reporsitories/Repository/CategoryRepository.cs`)
- Category repository → Category copier: copies lists (evidence: `MinimalApi/Reporsitories/Repository/CategoryRepository.cs`)
- Category copier → Category model: creates copies (evidence: `MinimalApi/Helper/Helper.cs`)
- Category repository → Category model: uses records (evidence: `MinimalApi/Reporsitories/Repository/CategoryRepository.cs`)
- Category endpoints → Request DTOs: binds inputs (evidence: `MinimalApi/Endpoints/CategoryEndpoint.cs`)
- Category endpoints → Response DTOs: returns results (evidence: `MinimalApi/Endpoints/CategoryEndpoint.cs`)
- Category repository → Request DTOs: consumes inputs (evidence: `MinimalApi/Reporsitories/Repository/CategoryRepository.cs`)
- Category repository → Response DTOs: builds results (evidence: `MinimalApi/Reporsitories/Repository/CategoryRepository.cs`)
