# kubasamanek/pantrycloud architecture

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

- Interactive diagram: https://gitdiagram.com/kubasamanek/pantrycloud
- Repository: https://github.com/kubasamanek/pantrycloud

## Overview

PantryCloud is a household and pantry management platform: users interact with its web app, which sends API requests through a YARP gateway to microservices. Those services cover identity, household membership and preferences, pantry inventory, recipes, shopping lists, notifications, and audit history. Services follow Core, Application, Infrastructure, and Presentation layers; the graph highlights application handlers and selected service internals where source was sampled. README-level routing and layering are documented, but most service wiring and persistence details were not sampled, so uncertain connections are omitted or marked unverified.

Main entry points: [`src/Gateways/PantryCloud.ApiGateway/PantryCloud.ApiGateway.Infrastructure/ServiceCollectionExtensions.cs`](https://github.com/kubasamanek/pantrycloud/blob/master/src/Gateways/PantryCloud.ApiGateway/PantryCloud.ApiGateway.Infrastructure/ServiceCollectionExtensions.cs) (API gateway), [`src/Web/PantryCloud.Web/Services/Auth/IAuthApi.cs`](https://github.com/kubasamanek/pantrycloud/blob/master/src/Web/PantryCloud.Web/Services/Auth/IAuthApi.cs) (Auth client), [`src/Web/PantryCloud.Web`](https://github.com/kubasamanek/pantrycloud/tree/master/src/Web/PantryCloud.Web) (Web frontend), [`src/Services/PantryCloud.Audit/PantryCloud.Audit.Presentation/Controllers/AuditController.cs`](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Audit/PantryCloud.Audit.Presentation/Controllers/AuditController.cs) (Audit API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client and gateway"]
  node_web["Web frontend<br/>[PantryCloud.Web]"]
  node_authclient["Auth client<br/>[IAuthApi.cs]"]
  node_tokenstore["Token storage"]
  node_gateway["API gateway"]
end

subgraph group_household["Household services"]
  node_household["Household API"]
  node_household_domain["Household domain<br/>[Household.cs]"]
  node_household_handlers["Household queries<br/>[Handlers]"]
end

subgraph group_pantry["Pantry services"]
  node_pantry["Pantry API"]
  node_pantry_queries["Pantry queries"]
  node_recipe["Recipe API"]
  node_recipe_queries["Recipe queries"]
  node_recipe_search["Recipe search"]
  node_shopping["Shopping API"]
  node_shopping_queries["Shopping queries"]
  node_shopping_domain["Shopping list model<br/>[ShoppingList.cs]"]
end

subgraph group_identity["Identity services"]
  node_identity["Identity API<br/>[AuthController.cs]"]
end

subgraph group_support["Supporting services"]
  node_notification["Notification API"]
  node_notification_query["Notification query"]
  node_audit["Audit API<br/>[AuditController.cs]"]
  node_audit_handler["Audit query handler"]
  node_audit_service["Audit query service"]
  node_audit_db[("Audit database context<br/>[AuditDbContext.cs]")]
end

node_user(("Household user"))

node_user -->|"uses"| node_web
node_web -->|"sends API requests"| node_gateway
node_gateway -->|"routes identity"| node_identity
node_gateway -->|"routes household"| node_household
node_gateway -->|"routes recipes"| node_recipe
node_gateway -->|"routes lists"| node_shopping
node_gateway -->|"routes notifications"| node_notification
node_gateway -->|"routes audit"| node_audit
node_authclient -.->|"calls auth API"| node_gateway
node_authclient -.->|"stores tokens"| node_tokenstore
node_household_handlers -.->|"queries domain"| node_household_domain
node_recipe_queries -.->|"uses search"| node_recipe_search
node_shopping_queries -.->|"queries domain"| node_shopping_domain
node_notification_query -.->|"serves query"| node_notification
node_audit -.->|"dispatches query"| node_audit_handler
node_audit_handler -->|"delegates query"| node_audit_service
node_audit_service -->|"queries entries"| node_audit_db

click node_web "https://github.com/kubasamanek/pantrycloud/tree/master/src/Web/PantryCloud.Web"
click node_authclient "https://github.com/kubasamanek/pantrycloud/blob/master/src/Web/PantryCloud.Web/Services/Auth/IAuthApi.cs"
click node_tokenstore "https://github.com/kubasamanek/pantrycloud/blob/master/src/Web/PantryCloud.Web/Services/Auth/LocalStorageTokenStorage.cs"
click node_gateway "https://github.com/kubasamanek/pantrycloud/blob/master/src/Gateways/PantryCloud.ApiGateway/PantryCloud.ApiGateway.Infrastructure/ServiceCollectionExtensions.cs"
click node_identity "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Identity/PantryCloud.Identity.Presentation/Controllers/AuthController.cs"
click node_household "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Household/PantryCloud.Household.Presentation/Controllers/HouseholdController.cs"
click node_household_domain "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Household/PantryCloud.Household.Core/Entities/Household.cs"
click node_household_handlers "https://github.com/kubasamanek/pantrycloud/tree/master/src/Services/PantryCloud.Household/PantryCloud.Household.Application/Queries/Handlers"
click node_pantry "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Pantry/PantryCloud.Pantry.Presentation/Controllers/PantryController.cs"
click node_pantry_queries "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Pantry/PantryCloud.Pantry.Application/Queries/Handlers/ListPantryItemsQueryHandler.cs"
click node_recipe "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Recipe/PantryCloud.Recipe.Presentation/Controllers/RecipeController.cs"
click node_recipe_queries "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Recipe/PantryCloud.Recipe.Application/Queries/Handlers/GetRecipeQueryHandler.cs"
click node_recipe_search "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Recipe/PantryCloud.Recipe.Infrastructure/Services/LocalMongoRecipeSearchService.cs"
click node_shopping "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.ShoppingList/PantryCloud.ShoppingList.Presentation/Controllers/ShoppingListController.cs"
click node_shopping_queries "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.ShoppingList/PantryCloud.ShoppingList.Application/Queries/Handlers/GetShoppingListQueryHandler.cs"
click node_shopping_domain "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.ShoppingList/PantryCloud.ShoppingList.Core/Entities/ShoppingList.cs"
click node_notification "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Notification/PantryCloud.Notification.Presentation/Controllers/NotificationsController.cs"
click node_notification_query "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Notification/PantryCloud.Notification.Application/Queries/GetMyNotificationsQueryHandler.cs"
click node_audit "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Audit/PantryCloud.Audit.Presentation/Controllers/AuditController.cs"
click node_audit_handler "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Audit/PantryCloud.Audit.Application/Queries/Handlers/ListHouseholdAuditEntriesQueryHandler.cs"
click node_audit_service "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Audit/PantryCloud.Audit.Infrastructure/Services/AuditQueryService.cs"
click node_audit_db "https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Audit/PantryCloud.Audit.Infrastructure/Persistence/AuditDbContext.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_web,node_authclient,node_tokenstore,node_gateway,node_user toneBlue
class node_household,node_household_domain,node_household_handlers toneAmber
class node_pantry,node_pantry_queries,node_recipe,node_recipe_queries,node_recipe_search,node_shopping,node_shopping_queries,node_shopping_domain toneMint
class node_identity toneRose
class node_notification,node_notification_query,node_audit,node_audit_handler,node_audit_service,node_audit_db toneIndigo
```

## Components

### Client and gateway

- [Web frontend](https://github.com/kubasamanek/pantrycloud/tree/master/src/Web/PantryCloud.Web): `src/Web/PantryCloud.Web`
- [Auth client](https://github.com/kubasamanek/pantrycloud/blob/master/src/Web/PantryCloud.Web/Services/Auth/IAuthApi.cs): `src/Web/PantryCloud.Web/Services/Auth/IAuthApi.cs`
- [Token storage](https://github.com/kubasamanek/pantrycloud/blob/master/src/Web/PantryCloud.Web/Services/Auth/LocalStorageTokenStorage.cs): `src/Web/PantryCloud.Web/Services/Auth/LocalStorageTokenStorage.cs`
- [API gateway](https://github.com/kubasamanek/pantrycloud/blob/master/src/Gateways/PantryCloud.ApiGateway/PantryCloud.ApiGateway.Infrastructure/ServiceCollectionExtensions.cs): `src/Gateways/PantryCloud.ApiGateway/PantryCloud.ApiGateway.Infrastructure/ServiceCollectionExtensions.cs`

### Household services

- [Household API](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Household/PantryCloud.Household.Presentation/Controllers/HouseholdController.cs): `src/Services/PantryCloud.Household/PantryCloud.Household.Presentation/Controllers/HouseholdController.cs`
- [Household domain](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Household/PantryCloud.Household.Core/Entities/Household.cs): `src/Services/PantryCloud.Household/PantryCloud.Household.Core/Entities/Household.cs`
- [Household queries](https://github.com/kubasamanek/pantrycloud/tree/master/src/Services/PantryCloud.Household/PantryCloud.Household.Application/Queries/Handlers): `src/Services/PantryCloud.Household/PantryCloud.Household.Application/Queries/Handlers`

### Pantry services

- [Pantry API](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Pantry/PantryCloud.Pantry.Presentation/Controllers/PantryController.cs): `src/Services/PantryCloud.Pantry/PantryCloud.Pantry.Presentation/Controllers/PantryController.cs`
- [Pantry queries](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Pantry/PantryCloud.Pantry.Application/Queries/Handlers/ListPantryItemsQueryHandler.cs): `src/Services/PantryCloud.Pantry/PantryCloud.Pantry.Application/Queries/Handlers/ListPantryItemsQueryHandler.cs`
- [Recipe API](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Recipe/PantryCloud.Recipe.Presentation/Controllers/RecipeController.cs): `src/Services/PantryCloud.Recipe/PantryCloud.Recipe.Presentation/Controllers/RecipeController.cs`
- [Recipe queries](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Recipe/PantryCloud.Recipe.Application/Queries/Handlers/GetRecipeQueryHandler.cs): `src/Services/PantryCloud.Recipe/PantryCloud.Recipe.Application/Queries/Handlers/GetRecipeQueryHandler.cs`
- [Recipe search](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Recipe/PantryCloud.Recipe.Infrastructure/Services/LocalMongoRecipeSearchService.cs): `src/Services/PantryCloud.Recipe/PantryCloud.Recipe.Infrastructure/Services/LocalMongoRecipeSearchService.cs`
- [Shopping API](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.ShoppingList/PantryCloud.ShoppingList.Presentation/Controllers/ShoppingListController.cs): `src/Services/PantryCloud.ShoppingList/PantryCloud.ShoppingList.Presentation/Controllers/ShoppingListController.cs`
- [Shopping queries](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.ShoppingList/PantryCloud.ShoppingList.Application/Queries/Handlers/GetShoppingListQueryHandler.cs): `src/Services/PantryCloud.ShoppingList/PantryCloud.ShoppingList.Application/Queries/Handlers/GetShoppingListQueryHandler.cs`
- [Shopping list model](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.ShoppingList/PantryCloud.ShoppingList.Core/Entities/ShoppingList.cs): `src/Services/PantryCloud.ShoppingList/PantryCloud.ShoppingList.Core/Entities/ShoppingList.cs`

### Identity services

- [Identity API](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Identity/PantryCloud.Identity.Presentation/Controllers/AuthController.cs): `src/Services/PantryCloud.Identity/PantryCloud.Identity.Presentation/Controllers/AuthController.cs`

### Supporting services

- [Notification API](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Notification/PantryCloud.Notification.Presentation/Controllers/NotificationsController.cs): `src/Services/PantryCloud.Notification/PantryCloud.Notification.Presentation/Controllers/NotificationsController.cs`
- [Notification query](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Notification/PantryCloud.Notification.Application/Queries/GetMyNotificationsQueryHandler.cs): `src/Services/PantryCloud.Notification/PantryCloud.Notification.Application/Queries/GetMyNotificationsQueryHandler.cs`
- [Audit API](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Audit/PantryCloud.Audit.Presentation/Controllers/AuditController.cs): `src/Services/PantryCloud.Audit/PantryCloud.Audit.Presentation/Controllers/AuditController.cs`
- [Audit query handler](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Audit/PantryCloud.Audit.Application/Queries/Handlers/ListHouseholdAuditEntriesQueryHandler.cs): `src/Services/PantryCloud.Audit/PantryCloud.Audit.Application/Queries/Handlers/ListHouseholdAuditEntriesQueryHandler.cs`
- [Audit query service](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Audit/PantryCloud.Audit.Infrastructure/Services/AuditQueryService.cs): `src/Services/PantryCloud.Audit/PantryCloud.Audit.Infrastructure/Services/AuditQueryService.cs`
- [Audit database context](https://github.com/kubasamanek/pantrycloud/blob/master/src/Services/PantryCloud.Audit/PantryCloud.Audit.Infrastructure/Persistence/AuditDbContext.cs): `src/Services/PantryCloud.Audit/PantryCloud.Audit.Infrastructure/Persistence/AuditDbContext.cs`

### Other components

- **Household user**

## Connections

- Household user → Web frontend: uses
- Web frontend → API gateway: sends API requests
- API gateway → Identity API: routes identity (evidence: `src/Gateways/PantryCloud.ApiGateway/PantryCloud.ApiGateway.Infrastructure/ServiceCollectionExtensions.cs`)
- API gateway → Household API: routes household (evidence: `src/Gateways/PantryCloud.ApiGateway/PantryCloud.ApiGateway.Infrastructure/ServiceCollectionExtensions.cs`)
- API gateway → Recipe API: routes recipes (evidence: `src/Gateways/PantryCloud.ApiGateway/PantryCloud.ApiGateway.Infrastructure/ServiceCollectionExtensions.cs`)
- API gateway → Shopping API: routes lists (evidence: `src/Gateways/PantryCloud.ApiGateway/PantryCloud.ApiGateway.Infrastructure/ServiceCollectionExtensions.cs`)
- API gateway → Notification API: routes notifications (evidence: `src/Gateways/PantryCloud.ApiGateway/PantryCloud.ApiGateway.Infrastructure/ServiceCollectionExtensions.cs`)
- API gateway → Audit API: routes audit (evidence: `src/Gateways/PantryCloud.ApiGateway/PantryCloud.ApiGateway.Infrastructure/ServiceCollectionExtensions.cs`)
- Auth client → API gateway: calls auth API
- Auth client → Token storage: stores tokens
- Household queries → Household domain: queries domain (evidence: `src/Services/PantryCloud.Household/PantryCloud.Household.Application/Queries/Handlers/GetHouseholdMembersPreferencesQueryHandler.cs`)
- Recipe queries → Recipe search: uses search
- Shopping queries → Shopping list model: queries domain (evidence: `src/Services/PantryCloud.ShoppingList/PantryCloud.ShoppingList.Application/Queries/Handlers/GetShoppingListQueryHandler.cs`)
- Notification query → Notification API: serves query
- Audit API → Audit query handler: dispatches query
- Audit query handler → Audit query service: delegates query (evidence: `src/Services/PantryCloud.Audit/PantryCloud.Audit.Application/Queries/Handlers/ListHouseholdAuditEntriesQueryHandler.cs`)
- Audit query service → Audit database context: queries entries (evidence: `src/Services/PantryCloud.Audit/PantryCloud.Audit.Infrastructure/Services/AuditQueryService.cs`)
