# toshmatovdeveloper/geodelivery architecture

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

- Interactive diagram: https://gitdiagram.com/toshmatovdeveloper/geodelivery
- Repository: https://github.com/toshmatovdeveloper/geodelivery

## Overview

GeoDelivery is a .NET modular-monolith food-delivery backend. The visible customer-facing workflow is HTTP requests for restaurant, category, and dish management or browsing, routed through controllers and MediatR into Catalog application workflows and, where sampled, Catalog persistence. The tree also documents authentication and caching; their implementation wiring is only partly visible, so those branches are shown conservatively. The README describes PostgreSQL/EF Core, but the sampled source does not expose database configuration details.

Main entry points: [`GeoDelivery/Web/Program.cs`](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Web/Program.cs) (Web startup), [`GeoDelivery/Catalog/Controllers/CategoriesController.cs`](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Controllers/CategoriesController.cs) (Category API), [`GeoDelivery/Catalog/Controllers/DishesControllers.cs`](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Controllers/DishesControllers.cs) (Dish API), [`GeoDelivery/Catalog/Infrastructure/CatalogDbContext.cs`](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Infrastructure/CatalogDbContext.cs) (Catalog EF context)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web API"]
  node_program["Web startup<br/>[Program.cs]"]
  node_restaurants_api["Restaurant API"]
  node_categories_api["Category API"]
  node_dishes_api["Dish API"]
  node_mediator["MediatR dispatcher"]
  node_exception_handlers["Exception handlers"]
end

subgraph group_catalog["Catalog"]
  node_restaurant_workflows["Restaurant workflows"]
  node_category_workflows["Category workflows"]
  node_dish_workflows["Dish workflows"]
  node_catalog_domain["Catalog entities and DTOs"]
  node_validation["Request validation"]
  node_cache_behavior["Query cache behavior<br/>[CachingBehavior.cs]"]
end

subgraph group_auth["Authentication"]
  node_auth_register["User registration"]
  node_token_provider["Token provider<br/>[TokenProvider.cs]"]
  node_auth_domain["User and roles"]
end

subgraph group_infra["Persistence and cache"]
  node_catalog_dbcontext["Catalog EF context"]
  node_catalog_db[("Catalog database")]
  node_auth_dbcontext["Auth EF context<br/>[AuthDbContext.cs]"]
  node_redis_service["Redis cache service"]
end

node_user(("API client"))
node_redis[("Redis")]

node_user -->|"sends requests"| node_restaurants_api
node_user -->|"sends requests"| node_categories_api
node_user -->|"sends requests"| node_dishes_api
node_program -->|"maps controllers"| node_restaurants_api
node_program -->|"maps controllers"| node_categories_api
node_program -->|"maps controllers"| node_dishes_api
node_program -->|"configures handling"| node_exception_handlers
node_restaurants_api -->|"sends queries"| node_mediator
node_categories_api -->|"sends commands"| node_mediator
node_categories_api -->|"sends queries"| node_mediator
node_dishes_api -->|"sends commands"| node_mediator
node_dishes_api -->|"sends queries"| node_mediator
node_mediator -->|"dispatches requests"| node_restaurant_workflows
node_mediator -->|"dispatches requests"| node_category_workflows
node_mediator -->|"dispatches requests"| node_dish_workflows
node_restaurant_workflows -->|"queries data"| node_catalog_dbcontext
node_category_workflows -->|"queries data"| node_catalog_dbcontext
node_dish_workflows -->|"queries data"| node_catalog_dbcontext
node_catalog_dbcontext -->|"persists entities"| node_catalog_db
node_redis_service -->|"reads and writes"| node_redis

click node_program "https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Web/Program.cs"
click node_restaurants_api "https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Controllers/RestaurantsController.cs"
click node_categories_api "https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Controllers/CategoriesController.cs"
click node_dishes_api "https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Controllers/DishesControllers.cs"
click node_exception_handlers "https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Web/Middlewares/Exceptions"
click node_restaurant_workflows "https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Catalog/Application/Features/Restaurant"
click node_category_workflows "https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Catalog/Application/Features/Category"
click node_dish_workflows "https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Catalog/Application/Features/Dish"
click node_catalog_domain "https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Catalog/Domain"
click node_validation "https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Catalog/Application/Validation"
click node_cache_behavior "https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Application/Caching/CachingBehavior.cs"
click node_auth_register "https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Auth/Application/Features/UserRegisterCommand.cs"
click node_token_provider "https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Auth/Application/Features/TokenProvider.cs"
click node_auth_domain "https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Auth/Domain"
click node_catalog_dbcontext "https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Infrastructure/CatalogDbContext.cs"
click node_auth_dbcontext "https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Auth/Infrastructure/AuthDbContext.cs"
click node_redis_service "https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Infrastructure/Caching/RedisCacheService.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_program,node_restaurants_api,node_categories_api,node_dishes_api,node_mediator,node_exception_handlers,node_user toneBlue
class node_restaurant_workflows,node_category_workflows,node_dish_workflows,node_catalog_domain,node_validation,node_cache_behavior,node_redis toneAmber
class node_auth_register,node_token_provider,node_auth_domain toneMint
class node_catalog_dbcontext,node_catalog_db,node_auth_dbcontext,node_redis_service toneRose
```

## Components

### Web API

- [Web startup](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Web/Program.cs): `GeoDelivery/Web/Program.cs`
- [Restaurant API](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Controllers/RestaurantsController.cs): `GeoDelivery/Catalog/Controllers/RestaurantsController.cs`
- [Category API](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Controllers/CategoriesController.cs): `GeoDelivery/Catalog/Controllers/CategoriesController.cs`
- [Dish API](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Controllers/DishesControllers.cs): `GeoDelivery/Catalog/Controllers/DishesControllers.cs`
- **MediatR dispatcher**
- [Exception handlers](https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Web/Middlewares/Exceptions): `GeoDelivery/Web/Middlewares/Exceptions`

### Catalog

- [Restaurant workflows](https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Catalog/Application/Features/Restaurant): `GeoDelivery/Catalog/Application/Features/Restaurant`
- [Category workflows](https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Catalog/Application/Features/Category): `GeoDelivery/Catalog/Application/Features/Category`
- [Dish workflows](https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Catalog/Application/Features/Dish): `GeoDelivery/Catalog/Application/Features/Dish`
- [Catalog entities and DTOs](https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Catalog/Domain): `GeoDelivery/Catalog/Domain`
- [Request validation](https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Catalog/Application/Validation): `GeoDelivery/Catalog/Application/Validation`
- [Query cache behavior](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Application/Caching/CachingBehavior.cs): `GeoDelivery/Catalog/Application/Caching/CachingBehavior.cs`

### Authentication

- [User registration](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Auth/Application/Features/UserRegisterCommand.cs): `GeoDelivery/Auth/Application/Features/UserRegisterCommand.cs`
- [Token provider](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Auth/Application/Features/TokenProvider.cs): `GeoDelivery/Auth/Application/Features/TokenProvider.cs`
- [User and roles](https://github.com/toshmatovdeveloper/geodelivery/tree/main/GeoDelivery/Auth/Domain): `GeoDelivery/Auth/Domain`

### Persistence and cache

- [Catalog EF context](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Infrastructure/CatalogDbContext.cs): `GeoDelivery/Catalog/Infrastructure/CatalogDbContext.cs`
- **Catalog database**
- [Auth EF context](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Auth/Infrastructure/AuthDbContext.cs): `GeoDelivery/Auth/Infrastructure/AuthDbContext.cs`
- [Redis cache service](https://github.com/toshmatovdeveloper/geodelivery/blob/main/GeoDelivery/Catalog/Infrastructure/Caching/RedisCacheService.cs): `GeoDelivery/Catalog/Infrastructure/Caching/RedisCacheService.cs`

### Other components

- **API client**
- **Redis**

## Connections

- API client → Restaurant API: sends requests
- API client → Category API: sends requests
- API client → Dish API: sends requests
- Web startup → Restaurant API: maps controllers
- Web startup → Category API: maps controllers
- Web startup → Dish API: maps controllers
- Web startup → Exception handlers: configures handling
- Restaurant API → MediatR dispatcher: sends queries
- Category API → MediatR dispatcher: sends commands
- Category API → MediatR dispatcher: sends queries
- Dish API → MediatR dispatcher: sends commands
- Dish API → MediatR dispatcher: sends queries
- MediatR dispatcher → Restaurant workflows: dispatches requests
- MediatR dispatcher → Category workflows: dispatches requests
- MediatR dispatcher → Dish workflows: dispatches requests
- Restaurant workflows → Catalog EF context: queries data
- Category workflows → Catalog EF context: queries data
- Dish workflows → Catalog EF context: queries data
- Catalog EF context → Catalog database: persists entities
- Redis cache service → Redis: reads and writes
