# didar-code/customer-maui-api architecture

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

- Interactive diagram: https://gitdiagram.com/didar-code/customer-maui-api
- Repository: https://github.com/didar-code/customer-maui-api

## Overview

Customer Manager is a cross-platform MAUI CRM client backed by an ASP.NET Core API and EF Core. The user workflow is to browse customers, inspect a profile and order history, then create or edit a customer, maintain local order entries, and optionally upload a photo. The API exposes customer, customer-type and order capabilities, with SQL-backed customer/order/type data and server-stored images. The sampled code confirms customer CRUD and image upload; order endpoint behavior and some UI interactions are documented but not fully sampled.

Main entry points: [`CustomerApp/Services/CustomerService.cs`](https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Services/CustomerService.cs) (Customer service), [`MauiApp.Api/Data/AppDbContext.cs`](https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Data/AppDbContext.cs) (EF Core context), [`MauiApp.Api/Controllers/CustomersController.cs`](https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Controllers/CustomersController.cs) (Customer endpoints), [`CustomerApp/Pages/Customers/CustomerFormPage.xaml.cs`](https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Pages/Customers/CustomerFormPage.xaml.cs) (Customer and order form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["MAUI Client"]
  node_list["Customer list"]
  node_details["Customer details"]
  node_form["Customer and order form"]
  node_customer_service["Customer service<br/>[CustomerService.cs]"]
  node_api_service["HTTP client<br/>[ApiService.cs]"]
  node_api_config["API and image URLs<br/>[ApiConstants.cs]"]
  node_client_models["Client DTOs"]
  node_converters["Status and image converters"]
end

subgraph group_api["Web API"]
  node_api_runtime["ASP.NET API runtime<br/>[Program.cs]"]
  node_customers_api["Customer endpoints"]
  node_types_api["Customer type endpoint"]
  node_orders_api["Order endpoints"]
end

subgraph group_data["Persistence and Media"]
  node_entities["CRM entities<br/>[Customer.cs]"]
  node_types_entity["Customer type entity<br/>[CustomerType.cs]"]
  node_order_entity["Order entity<br/>[Order.cs]"]
  node_db_context["EF Core context<br/>[AppDbContext.cs]"]
  node_sql[("SQL Server")]
  node_image_files[("Uploaded customer images<br/>[customers]")]
end

node_business(("Business user"))

node_business -->|"browses"| node_list
node_list -->|"requests customers"| node_customer_service
node_details -->|"loads profile"| node_customer_service
node_form -->|"saves and loads"| node_customer_service
node_form -->|"builds requests"| node_client_models
node_customer_service -->|"calls HTTP methods"| node_api_service
node_api_service -->|"sets base URL"| node_api_config
node_customer_service -->|"sends customer requests"| node_customers_api
node_customer_service -.->|"requests types"| node_types_api
node_customer_service -.->|"uses order routes"| node_orders_api
node_api_runtime -.->|"serves endpoints"| node_customers_api
node_customers_api -->|"queries and saves"| node_db_context
node_types_api -->|"queries types"| node_db_context
node_orders_api -->|"queries and saves"| node_db_context
node_db_context -->|"maps customers"| node_entities
node_db_context -->|"maps and seeds"| node_types_entity
node_db_context -->|"maps orders"| node_order_entity
node_db_context -.->|"persists records"| node_sql
node_customers_api -->|"writes uploads"| node_image_files
node_form -.->|"resolves image display"| node_converters
node_api_config -.->|"builds image URLs"| node_image_files

click node_list "https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Pages/Customers/CustomerListPage.xaml.cs"
click node_details "https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Pages/Customers/CustomerDetailsPage.xaml.cs"
click node_form "https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Pages/Customers/CustomerFormPage.xaml.cs"
click node_customer_service "https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Services/CustomerService.cs"
click node_api_service "https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Services/ApiService.cs"
click node_api_config "https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Services/ApiConstants.cs"
click node_client_models "https://github.com/didar-code/customer-maui-api/tree/main/CustomerApp/Models"
click node_converters "https://github.com/didar-code/customer-maui-api/tree/main/CustomerApp/Converters"
click node_api_runtime "https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Program.cs"
click node_customers_api "https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Controllers/CustomersController.cs"
click node_types_api "https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Controllers/CustomerTypesController.cs"
click node_orders_api "https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Controllers/OrdersController.cs"
click node_entities "https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Models/Customer.cs"
click node_types_entity "https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Models/CustomerType.cs"
click node_order_entity "https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Models/Order.cs"
click node_db_context "https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Data/AppDbContext.cs"
click node_image_files "https://github.com/didar-code/customer-maui-api/tree/main/MauiApp.Api/wwwroot/uploads/customers"

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_list,node_details,node_form,node_customer_service,node_api_service,node_api_config,node_client_models,node_converters,node_business toneBlue
class node_api_runtime,node_customers_api,node_types_api,node_orders_api toneAmber
class node_entities,node_types_entity,node_order_entity,node_db_context,node_sql,node_image_files toneMint
```

## Components

### MAUI Client

- [Customer list](https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Pages/Customers/CustomerListPage.xaml.cs): `CustomerApp/Pages/Customers/CustomerListPage.xaml.cs`
- [Customer details](https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Pages/Customers/CustomerDetailsPage.xaml.cs): `CustomerApp/Pages/Customers/CustomerDetailsPage.xaml.cs`
- [Customer and order form](https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Pages/Customers/CustomerFormPage.xaml.cs): `CustomerApp/Pages/Customers/CustomerFormPage.xaml.cs`
- [Customer service](https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Services/CustomerService.cs): `CustomerApp/Services/CustomerService.cs`
- [HTTP client](https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Services/ApiService.cs): `CustomerApp/Services/ApiService.cs`
- [API and image URLs](https://github.com/didar-code/customer-maui-api/blob/main/CustomerApp/Services/ApiConstants.cs): `CustomerApp/Services/ApiConstants.cs`
- [Client DTOs](https://github.com/didar-code/customer-maui-api/tree/main/CustomerApp/Models): `CustomerApp/Models`
- [Status and image converters](https://github.com/didar-code/customer-maui-api/tree/main/CustomerApp/Converters): `CustomerApp/Converters`

### Web API

- [ASP.NET API runtime](https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Program.cs): `MauiApp.Api/Program.cs`
- [Customer endpoints](https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Controllers/CustomersController.cs): `MauiApp.Api/Controllers/CustomersController.cs`
- [Customer type endpoint](https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Controllers/CustomerTypesController.cs): `MauiApp.Api/Controllers/CustomerTypesController.cs`
- [Order endpoints](https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Controllers/OrdersController.cs): `MauiApp.Api/Controllers/OrdersController.cs`

### Persistence and Media

- [CRM entities](https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Models/Customer.cs): `MauiApp.Api/Models/Customer.cs`
- [Customer type entity](https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Models/CustomerType.cs): `MauiApp.Api/Models/CustomerType.cs`
- [Order entity](https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Models/Order.cs): `MauiApp.Api/Models/Order.cs`
- [EF Core context](https://github.com/didar-code/customer-maui-api/blob/main/MauiApp.Api/Data/AppDbContext.cs): `MauiApp.Api/Data/AppDbContext.cs`
- **SQL Server**
- [Uploaded customer images](https://github.com/didar-code/customer-maui-api/tree/main/MauiApp.Api/wwwroot/uploads/customers): `MauiApp.Api/wwwroot/uploads/customers`

### Other components

- **Business user**

## Connections

- Business user → Customer list: browses (evidence: `README.md`)
- Customer list → Customer service: requests customers (evidence: `CustomerApp/Pages/Customers/CustomerListPage.xaml.cs`)
- Customer details → Customer service: loads profile (evidence: `CustomerApp/Pages/Customers/CustomerDetailsPage.xaml.cs`)
- Customer and order form → Customer service: saves and loads (evidence: `CustomerApp/Pages/Customers/CustomerFormPage.xaml.cs`)
- Customer and order form → Client DTOs: builds requests (evidence: `CustomerApp/Pages/Customers/CustomerFormPage.xaml.cs`)
- Customer service → HTTP client: calls HTTP methods (evidence: `CustomerApp/Services/CustomerService.cs`)
- HTTP client → API and image URLs: sets base URL (evidence: `CustomerApp/Services/ApiService.cs`)
- Customer service → Customer endpoints: sends customer requests (evidence: `CustomerApp/Services/CustomerService.cs`)
- Customer service → Customer type endpoint: requests types (evidence: `README.md`)
- Customer service → Order endpoints: uses order routes (evidence: `README.md`)
- ASP.NET API runtime → Customer endpoints: serves endpoints
- Customer endpoints → EF Core context: queries and saves (evidence: `MauiApp.Api/Controllers/CustomersController.cs`)
- Customer type endpoint → EF Core context: queries types (evidence: `MauiApp.Api/Controllers/CustomerTypesController.cs`)
- Order endpoints → EF Core context: queries and saves (evidence: `MauiApp.Api/Controllers/OrdersController.cs`)
- EF Core context → CRM entities: maps customers (evidence: `MauiApp.Api/Data/AppDbContext.cs`)
- EF Core context → Customer type entity: maps and seeds (evidence: `MauiApp.Api/Data/AppDbContext.cs`)
- EF Core context → Order entity: maps orders (evidence: `MauiApp.Api/Data/AppDbContext.cs`)
- EF Core context → SQL Server: persists records (evidence: `README.md`)
- Customer endpoints → Uploaded customer images: writes uploads (evidence: `MauiApp.Api/Controllers/CustomersController.cs`)
- Customer and order form → Status and image converters: resolves image display (evidence: `README.md`)
- API and image URLs → Uploaded customer images: builds image URLs (evidence: `README.md`)
