# ahsanhabibhamim/bojro architecture

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

- Interactive diagram: https://gitdiagram.com/ahsanhabibhamim/bojro
- Repository: https://github.com/ahsanhabibhamim/bojro

## Overview

Bojro is a Bangla-first commerce platform: shoppers browse products, manage carts and checkout, then track orders; administrators manage catalog, content, promotions, media, and operations. The Next.js experience fronts a FastAPI API, with PostgreSQL-backed domain state and Redis-supported runtime services; an ARQ worker handles background work. The tree and README establish the product’s major areas, while sampled sources confirm API registration and selected UI, storage, and webhook behavior. Many domain handlers were not sampled, so those internal links are omitted rather than inferred.

Main entry points: [`backend/app/main.py`](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/main.py) (FastAPI application), [`frontend/src/app/[locale]/(storefront)`](https://github.com/ahsanhabibhamim/bojro/tree/main/frontend/src/app/%5Blocale%5D/(storefront)) (Storefront experience), [`backend/app/services/webhooks.py`](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/services/webhooks.py) (Webhook processing), [`backend/app/api/v1/router.py`](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/api/v1/router.py) (Versioned route registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_storefront["Storefront"]
  node_storefront_ui["Storefront experience"]
  node_catalog_ui["Catalog browsing"]
  node_cart_ui["Cart and checkout"]
  node_account_ui["Customer account<br/>[account-client.tsx]"]
end

subgraph group_admin["Administration"]
  node_admin_ui["Admin workspace"]
  node_admin_catalog["Catalog management"]
  node_admin_home["Homepage management"]
  node_admin_media["Media management<br/>[media-manager.tsx]"]
  node_media_uploader["Media uploader<br/>[media-uploader.tsx]"]
end

subgraph group_api["Commerce API"]
  node_api_entry["FastAPI application<br/>[main.py]"]
  node_route_registry["Versioned route registry<br/>[router.py]"]
  node_domain_routes["Commerce and account routes"]
  node_admin_routes["Admin routes"]
end

subgraph group_backend["Backend runtime"]
  node_domain_services["Commerce services"]
  node_repositories["Data repositories"]
  node_postgres[("PostgreSQL domain state<br/>[models.py]")]
  node_configuration["Runtime configuration<br/>[config.py]"]
  node_security["Security controls<br/>[security.py]"]
  node_domain_enums["Commerce state types<br/>[enums.py]"]
end

subgraph group_operations["Async and integrations"]
  node_payment_service["Payment processing<br/>[payments.py]"]
  node_provider_registry["Provider repository<br/>[providers.py]"]
  node_storage_service["Review-photo storage<br/>[storage.py]"]
  node_webhook_service["Webhook processing<br/>[webhooks.py]"]
  node_worker["ARQ background worker<br/>[review_photos.py]"]
  node_redis[("Redis")]
  node_payment_provider{{"Payment providers"}}
  node_courier_provider{{"Courier providers"}}
end

node_shopper(("Shopper"))

node_shopper -->|"browses and buys"| node_storefront_ui
node_storefront_ui -.->|"renders catalog"| node_catalog_ui
node_storefront_ui -.->|"enters checkout"| node_cart_ui
node_storefront_ui -.->|"opens account"| node_account_ui
node_storefront_ui -.->|"requests API"| node_api_entry
node_admin_ui -.->|"admin requests"| node_api_entry
node_admin_catalog -.->|"uses workspace"| node_admin_ui
node_admin_home -.->|"uses workspace"| node_admin_ui
node_admin_media -->|"renders uploader"| node_media_uploader
node_media_uploader -.->|"uploads media"| node_api_entry
node_api_entry -->|"mounts routes"| node_route_registry
node_route_registry -->|"registers routes"| node_domain_routes
node_route_registry -->|"registers routes"| node_admin_routes
node_domain_routes -.->|"dispatches requests"| node_domain_services
node_admin_routes -.->|"dispatches requests"| node_domain_services
node_domain_services -.->|"accesses data"| node_repositories
node_repositories -.->|"reads and writes"| node_postgres
node_api_entry -->|"loads settings"| node_configuration
node_api_entry -->|"connects optionally"| node_redis
node_domain_routes -.->|"uses protections"| node_security
node_payment_service -.->|"resolves providers"| node_provider_registry
node_webhook_service -->|"loads webhook provider"| node_provider_registry
node_webhook_service -->|"uses payment service"| node_payment_service
node_webhook_service -.->|"verifies events"| node_payment_provider
node_webhook_service -.->|"verifies events"| node_courier_provider
node_worker -->|"processes events"| node_webhook_service
node_worker -->|"heartbeats"| node_redis
node_storage_service -->|"uses settings"| node_configuration

click node_storefront_ui "https://github.com/ahsanhabibhamim/bojro/tree/main/frontend/src/app/%5Blocale%5D/(storefront)"
click node_catalog_ui "https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/catalog/catalog-listing.tsx"
click node_cart_ui "https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/checkout/checkout-client.tsx"
click node_account_ui "https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/account/account-client.tsx"
click node_admin_ui "https://github.com/ahsanhabibhamim/bojro/tree/main/frontend/src/components/admin"
click node_admin_catalog "https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/admin/catalog/taxonomy-manager.tsx"
click node_admin_home "https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/admin/homepage/homepage-manager.tsx"
click node_admin_media "https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/admin/media/media-manager.tsx"
click node_media_uploader "https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/admin/media/media-uploader.tsx"
click node_api_entry "https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/main.py"
click node_route_registry "https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/api/v1/router.py"
click node_domain_routes "https://github.com/ahsanhabibhamim/bojro/tree/main/backend/app/api/v1"
click node_admin_routes "https://github.com/ahsanhabibhamim/bojro/tree/main/backend/app/api/v1"
click node_domain_services "https://github.com/ahsanhabibhamim/bojro/tree/main/backend/app/services"
click node_repositories "https://github.com/ahsanhabibhamim/bojro/tree/main/backend/app/repositories"
click node_postgres "https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/db/models.py"
click node_configuration "https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/core/config.py"
click node_security "https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/core/security.py"
click node_domain_enums "https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/db/enums.py"
click node_payment_service "https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/services/payments.py"
click node_provider_registry "https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/repositories/providers.py"
click node_storage_service "https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/services/storage.py"
click node_webhook_service "https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/services/webhooks.py"
click node_worker "https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/workers/review_photos.py"

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_storefront_ui,node_catalog_ui,node_cart_ui,node_account_ui toneBlue
class node_admin_ui,node_admin_catalog,node_admin_home,node_admin_media,node_media_uploader toneAmber
class node_api_entry,node_route_registry,node_domain_routes,node_admin_routes toneMint
class node_domain_services,node_repositories,node_postgres,node_configuration,node_security,node_domain_enums toneRose
class node_payment_service,node_provider_registry,node_storage_service,node_webhook_service,node_worker,node_redis,node_payment_provider,node_courier_provider,node_shopper toneIndigo
```

## Components

### Storefront

- [Storefront experience](https://github.com/ahsanhabibhamim/bojro/tree/main/frontend/src/app/%5Blocale%5D/(storefront)): `frontend/src/app/[locale]/(storefront)`
- [Catalog browsing](https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/catalog/catalog-listing.tsx): `frontend/src/components/catalog/catalog-listing.tsx`
- [Cart and checkout](https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/checkout/checkout-client.tsx): `frontend/src/components/checkout/checkout-client.tsx`
- [Customer account](https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/account/account-client.tsx): `frontend/src/components/account/account-client.tsx`

### Administration

- [Admin workspace](https://github.com/ahsanhabibhamim/bojro/tree/main/frontend/src/components/admin): `frontend/src/components/admin`
- [Catalog management](https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/admin/catalog/taxonomy-manager.tsx): `frontend/src/components/admin/catalog/taxonomy-manager.tsx`
- [Homepage management](https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/admin/homepage/homepage-manager.tsx): `frontend/src/components/admin/homepage/homepage-manager.tsx`
- [Media management](https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/admin/media/media-manager.tsx): `frontend/src/components/admin/media/media-manager.tsx`
- [Media uploader](https://github.com/ahsanhabibhamim/bojro/blob/main/frontend/src/components/admin/media/media-uploader.tsx): `frontend/src/components/admin/media/media-uploader.tsx`

### Commerce API

- [FastAPI application](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/main.py): `backend/app/main.py`
- [Versioned route registry](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/api/v1/router.py): `backend/app/api/v1/router.py`
- [Commerce and account routes](https://github.com/ahsanhabibhamim/bojro/tree/main/backend/app/api/v1): `backend/app/api/v1`
- [Admin routes](https://github.com/ahsanhabibhamim/bojro/tree/main/backend/app/api/v1): `backend/app/api/v1`

### Backend runtime

- [Commerce services](https://github.com/ahsanhabibhamim/bojro/tree/main/backend/app/services): `backend/app/services`
- [Data repositories](https://github.com/ahsanhabibhamim/bojro/tree/main/backend/app/repositories): `backend/app/repositories`
- [PostgreSQL domain state](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/db/models.py): `backend/app/db/models.py`
- [Runtime configuration](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/core/config.py): `backend/app/core/config.py`
- [Security controls](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/core/security.py): `backend/app/core/security.py`
- [Commerce state types](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/db/enums.py): `backend/app/db/enums.py`

### Async and integrations

- [Payment processing](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/services/payments.py): `backend/app/services/payments.py`
- [Provider repository](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/repositories/providers.py): `backend/app/repositories/providers.py`
- [Review-photo storage](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/services/storage.py): `backend/app/services/storage.py`
- [Webhook processing](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/services/webhooks.py): `backend/app/services/webhooks.py`
- [ARQ background worker](https://github.com/ahsanhabibhamim/bojro/blob/main/backend/app/workers/review_photos.py): `backend/app/workers/review_photos.py`
- **Redis**
- **Payment providers**
- **Courier providers**

### Other components

- **Shopper**

## Connections

- Shopper → Storefront experience: browses and buys
- Storefront experience → Catalog browsing: renders catalog
- Storefront experience → Cart and checkout: enters checkout
- Storefront experience → Customer account: opens account
- Storefront experience → FastAPI application: requests API
- Admin workspace → FastAPI application: admin requests
- Catalog management → Admin workspace: uses workspace (evidence: `frontend/src/components/admin/catalog/taxonomy-manager.tsx`)
- Homepage management → Admin workspace: uses workspace (evidence: `frontend/src/components/admin/homepage/homepage-manager.tsx`)
- Media management → Media uploader: renders uploader (evidence: `frontend/src/components/admin/media/media-manager.tsx`)
- Media uploader → FastAPI application: uploads media
- FastAPI application → Versioned route registry: mounts routes (evidence: `backend/app/main.py`)
- Versioned route registry → Commerce and account routes: registers routes (evidence: `backend/app/api/v1/router.py`)
- Versioned route registry → Admin routes: registers routes (evidence: `backend/app/api/v1/router.py`)
- Commerce and account routes → Commerce services: dispatches requests
- Admin routes → Commerce services: dispatches requests
- Commerce services → Data repositories: accesses data (evidence: `backend/app/services/webhooks.py`)
- Data repositories → PostgreSQL domain state: reads and writes (evidence: `backend/app/repositories/auth.py`)
- FastAPI application → Runtime configuration: loads settings (evidence: `backend/app/main.py`)
- FastAPI application → Redis: connects optionally (evidence: `backend/app/main.py`)
- Commerce and account routes → Security controls: uses protections
- Payment processing → Provider repository: resolves providers
- Webhook processing → Provider repository: loads webhook provider (evidence: `backend/app/services/webhooks.py`)
- Webhook processing → Payment processing: uses payment service (evidence: `backend/app/services/webhooks.py`)
- Webhook processing → Payment providers: verifies events
- Webhook processing → Courier providers: verifies events
- ARQ background worker → Webhook processing: processes events (evidence: `backend/app/workers/review_photos.py`)
- ARQ background worker → Redis: heartbeats (evidence: `backend/app/workers/review_photos.py`)
- Review-photo storage → Runtime configuration: uses settings (evidence: `backend/app/services/storage.py`)
