# mohammedabozied/bekam-api-public architecture

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

- Interactive diagram: https://gitdiagram.com/mohammedabozied/bekam-api-public
- Repository: https://github.com/mohammedabozied/bekam-api-public

## Overview

Bekam is an ASP.NET Core e-commerce API. Shoppers browse a catalog, maintain guest or signed-in carts, then proceed to orders and Stripe payments; account authentication and administrative catalog/role management are parallel capabilities. The graph follows the documented Onion layers and includes persistence, Redis carts, and background/email services. Only selected source was excerpted or indexed, so edges for unsampled controllers and integrations are limited to relationships the README explicitly documents.

Main entry points: [`Bekam.API/Controllers/ProductsController.cs`](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/ProductsController.cs) (Catalog API), [`Bekam.Infrastructure/Persistence/_Data/AppDbContext.cs`](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Persistence/_Data/AppDbContext.cs) (Commerce database), [`Bekam.Application/Services/Cart/CartService.cs`](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Application/Services/Cart/CartService.cs) (Cart and merge), [`Bekam.Infrastructure/Services/AuthService.cs`](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/AuthService.cs) (Auth workflows)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API surface"]
  node_auth_api["Authentication API<br/>[AuthController.cs]"]
  node_catalog_api["Catalog API"]
  node_category_api["Category API"]
  node_cart_api["Cart API<br/>[CartController.cs]"]
  node_orders_api["Orders API"]
  node_payments_api["Payments API"]
  node_users_api["User administration<br/>[UsersController.cs]"]
  node_roles_api["Role administration<br/>[RolesController.cs]"]
end

subgraph group_application["Application workflows"]
  node_catalog["Product catalog<br/>[ProductService.cs]"]
  node_categories["Category management"]
  node_brands["Brand management<br/>[BrandsService.cs]"]
  node_cart["Cart and merge<br/>[CartService.cs]"]
  node_orders["Order workflows<br/>[OrderService.cs]"]
  node_payments["Payment processing<br/>[PaymentService.cs]"]
end

subgraph group_identity["Identity and access"]
  node_auth["Auth workflows<br/>[AuthService.cs]"]
  node_users["User management<br/>[UsersService.cs]"]
  node_roles["Roles and permissions<br/>[RolesService.cs]"]
end

subgraph group_infrastructure["Infrastructure"]
  node_sql[("Commerce database<br/>[AppDbContext.cs]")]
  node_identity_db[("Identity database")]
  node_redis[("Redis cart store<br/>[CartRepository.cs]")]
  node_jobs["Background jobs"]
  node_email["Email service<br/>[EmailService.cs]"]
end

node_shopper(("Shopper"))
node_admin(("Administrator"))
node_stripe["Stripe"]

node_shopper -->|"authenticates"| node_auth_api
node_shopper -->|"browses"| node_catalog_api
node_shopper -->|"manages cart"| node_cart_api
node_shopper -->|"checks out"| node_orders_api
node_admin -->|"manages catalog"| node_catalog_api
node_admin -->|"manages categories"| node_category_api
node_admin -->|"manages users"| node_users_api
node_admin -->|"manages access"| node_roles_api
node_auth_api -->|"invokes"| node_auth
node_auth -->|"uses identity"| node_identity_db
node_auth -->|"enqueues mail"| node_jobs
node_jobs -->|"dispatches"| node_email
node_users_api -->|"invokes"| node_users
node_roles_api -->|"invokes"| node_roles
node_users -->|"queries"| node_identity_db
node_catalog_api -.->|"routes catalog"| node_catalog
node_category_api -->|"invokes"| node_categories
node_catalog -->|"persists catalog"| node_sql
node_categories -->|"persists categories"| node_sql
node_admin -->|"manages brands"| node_brands
node_catalog_api -.->|"routes brand operations"| node_brands
node_cart_api -.->|"routes cart operations"| node_cart
node_cart -->|"reads and writes"| node_redis
node_cart -->|"looks up products"| node_sql
node_orders_api -.->|"routes order operations"| node_orders
node_orders -.->|"persists orders"| node_sql
node_payments_api -.->|"routes payment operations"| node_payments
node_payments -.->|"processes payments"| node_stripe

click node_auth_api "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/AuthController.cs"
click node_catalog_api "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/ProductsController.cs"
click node_category_api "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/CategoriesController.cs"
click node_cart_api "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/CartController.cs"
click node_orders_api "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/OrdersController.cs"
click node_payments_api "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/paymentsController.cs"
click node_users_api "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/UsersController.cs"
click node_roles_api "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/RolesController.cs"
click node_auth "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/AuthService.cs"
click node_users "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/Identity/UsersService.cs"
click node_catalog "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Application/Services/Products/ProductService.cs"
click node_categories "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Application/Services/Categories/CategoriesService.cs"
click node_brands "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Application/Services/Brands/BrandsService.cs"
click node_cart "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Application/Services/Cart/CartService.cs"
click node_orders "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Application/Services/Orders/OrderService.cs"
click node_payments "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/PaymentService.cs"
click node_roles "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/Identity/RolesService.cs"
click node_sql "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Persistence/_Data/AppDbContext.cs"
click node_identity_db "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Persistence/_Identity/IdentityDbContext.cs"
click node_redis "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Redis/CartRepository.cs"
click node_jobs "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/HangfireJobService.cs"
click node_email "https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/EmailService.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_auth_api,node_catalog_api,node_category_api,node_cart_api,node_orders_api,node_payments_api,node_users_api,node_roles_api toneBlue
class node_catalog,node_categories,node_brands,node_cart,node_orders,node_payments toneAmber
class node_auth,node_users,node_roles toneMint
class node_sql,node_identity_db,node_redis,node_jobs,node_email toneRose
class node_shopper,node_admin,node_stripe toneIndigo
```

## Components

### API surface

- [Authentication API](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/AuthController.cs): `Bekam.API/Controllers/AuthController.cs`
- [Catalog API](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/ProductsController.cs): `Bekam.API/Controllers/ProductsController.cs`
- [Category API](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/CategoriesController.cs): `Bekam.API/Controllers/CategoriesController.cs`
- [Cart API](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/CartController.cs): `Bekam.API/Controllers/CartController.cs`
- [Orders API](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/OrdersController.cs): `Bekam.API/Controllers/OrdersController.cs`
- [Payments API](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/paymentsController.cs): `Bekam.API/Controllers/paymentsController.cs`
- [User administration](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/UsersController.cs): `Bekam.API/Controllers/UsersController.cs`
- [Role administration](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.API/Controllers/RolesController.cs): `Bekam.API/Controllers/RolesController.cs`

### Application workflows

- [Product catalog](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Application/Services/Products/ProductService.cs): `Bekam.Application/Services/Products/ProductService.cs`
- [Category management](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Application/Services/Categories/CategoriesService.cs): `Bekam.Application/Services/Categories/CategoriesService.cs`
- [Brand management](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Application/Services/Brands/BrandsService.cs): `Bekam.Application/Services/Brands/BrandsService.cs`
- [Cart and merge](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Application/Services/Cart/CartService.cs): `Bekam.Application/Services/Cart/CartService.cs`
- [Order workflows](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Application/Services/Orders/OrderService.cs): `Bekam.Application/Services/Orders/OrderService.cs`
- [Payment processing](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/PaymentService.cs): `Bekam.Infrastructure/Services/PaymentService.cs`

### Identity and access

- [Auth workflows](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/AuthService.cs): `Bekam.Infrastructure/Services/AuthService.cs`
- [User management](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/Identity/UsersService.cs): `Bekam.Infrastructure/Services/Identity/UsersService.cs`
- [Roles and permissions](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/Identity/RolesService.cs): `Bekam.Infrastructure/Services/Identity/RolesService.cs`

### Infrastructure

- [Commerce database](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Persistence/_Data/AppDbContext.cs): `Bekam.Infrastructure/Persistence/_Data/AppDbContext.cs`
- [Identity database](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Persistence/_Identity/IdentityDbContext.cs): `Bekam.Infrastructure/Persistence/_Identity/IdentityDbContext.cs`
- [Redis cart store](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Redis/CartRepository.cs): `Bekam.Infrastructure/Redis/CartRepository.cs`
- [Background jobs](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/HangfireJobService.cs): `Bekam.Infrastructure/Services/HangfireJobService.cs`
- [Email service](https://github.com/mohammedabozied/bekam-api-public/blob/master/Bekam.Infrastructure/Services/EmailService.cs): `Bekam.Infrastructure/Services/EmailService.cs`

### Other components

- **Shopper**
- **Administrator**
- **Stripe**

## Connections

- Shopper → Authentication API: authenticates (evidence: `README.md`)
- Shopper → Catalog API: browses (evidence: `README.md`)
- Shopper → Cart API: manages cart (evidence: `README.md`)
- Shopper → Orders API: checks out (evidence: `README.md`)
- Administrator → Catalog API: manages catalog (evidence: `README.md`)
- Administrator → Category API: manages categories (evidence: `README.md`)
- Administrator → User administration: manages users (evidence: `README.md`)
- Administrator → Role administration: manages access (evidence: `README.md`)
- Authentication API → Auth workflows: invokes (evidence: `Bekam.API/Controllers/AuthController.cs`)
- Auth workflows → Identity database: uses identity (evidence: `Bekam.Infrastructure/Services/AuthService.cs`)
- Auth workflows → Background jobs: enqueues mail (evidence: `Bekam.Infrastructure/Services/AuthService.cs`)
- Background jobs → Email service: dispatches (evidence: `README.md`)
- User administration → User management: invokes (evidence: `Bekam.Infrastructure/Services/Identity/UsersService.cs`)
- Role administration → Roles and permissions: invokes (evidence: `Bekam.API/Controllers/RolesController.cs`)
- User management → Identity database: queries (evidence: `Bekam.Infrastructure/Services/Identity/UsersService.cs`)
- Catalog API → Product catalog: routes catalog (evidence: `README.md`)
- Category API → Category management: invokes (evidence: `Bekam.API/Controllers/CategoriesController.cs`)
- Product catalog → Commerce database: persists catalog (evidence: `Bekam.Application/Services/Products/ProductService.cs`)
- Category management → Commerce database: persists categories (evidence: `Bekam.Application/Services/Categories/CategoriesService.cs`)
- Administrator → Brand management: manages brands (evidence: `README.md`)
- Catalog API → Brand management: routes brand operations (evidence: `README.md`)
- Cart API → Cart and merge: routes cart operations (evidence: `README.md`)
- Cart and merge → Redis cart store: reads and writes (evidence: `Bekam.Application/Services/Cart/CartService.cs`)
- Cart and merge → Commerce database: looks up products (evidence: `Bekam.Application/Services/Cart/CartService.cs`)
- Orders API → Order workflows: routes order operations (evidence: `README.md`)
- Order workflows → Commerce database: persists orders (evidence: `README.md`)
- Payments API → Payment processing: routes payment operations (evidence: `README.md`)
- Payment processing → Stripe: processes payments (evidence: `README.md`)
