# seivkhengkhun/bondom_account architecture

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

- Interactive diagram: https://gitdiagram.com/seivkhengkhun/bondom_account
- Repository: https://github.com/seivkhengkhun/bondom_account

## Overview

Bondom Account is a Cambodian digital-goods storefront spanning Telegram, a customer website, and an admin dashboard over a shared database. The principal flow is browse and authenticate, create an order, pay by Bakong KHQR or wallet, then deliver purchased credentials. The README documents shared identity and cross-channel delivery; source excerpts show web and bot calling shared services and the payment watcher. Pandora supplier fulfillment, SMS activation, and admin capabilities are documented or indexed, but their internal routes are not fully sampled, so uncertain links are omitted.

Main entry points: [`app/bot/handlers.py`](https://github.com/seivkhengkhun/bondom_account/blob/master/app/bot/handlers.py) (Telegram Bot), [`app/webshop/routes.py`](https://github.com/seivkhengkhun/bondom_account/blob/master/app/webshop/routes.py) (Customer Website), [`shared/database.py`](https://github.com/seivkhengkhun/bondom_account/blob/master/shared/database.py) (Shared Database), [`shared/services.py`](https://github.com/seivkhengkhun/bondom_account/blob/master/shared/services.py) (Catalog & Orders)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_channels["Storefront Channels"]
  node_telegram["Telegram Bot<br/>[handlers.py]"]
  node_website["Customer Website<br/>[routes.py]"]
  node_admin["Admin Dashboard<br/>[admin.py]"]
  node_api["FastAPI Interface<br/>[main.py]"]
  node_identity["Telegram Login<br/>[auth.py]"]
end

subgraph group_commerce["Commerce Services"]
  node_catalog["Catalog &amp; Orders<br/>[services.py]"]
  node_payments["KHQR Payments<br/>[payment_service.py]"]
  node_delivery["Order Delivery<br/>[handlers.py]"]
  node_wallet["Wallet &amp; Top-ups<br/>[services.py]"]
  node_sms["SMS Activation<br/>[sms_service.py]"]
  node_pandora["Supplier Fulfillment<br/>[pandora.py]"]
end

subgraph group_platform["Shared Platform"]
  node_database[("Shared Database<br/>[database.py]")]
  node_models["Store Records<br/>[models.py]"]
  node_settings["Configuration<br/>[config.py]"]
  node_appearance["Bot Appearance<br/>[appearance.py]"]
end

subgraph group_integrations["External Integrations"]
  node_bakong["Bakong Network"]
  node_sms_provider["SMS Reseller"]
  node_pandora_provider["Pandora Supplier"]
  node_telegram_service["Telegram Platform"]
end

node_customer(("Customer"))

node_customer -->|"shops via"| node_telegram
node_customer -->|"shops via"| node_website
node_customer -->|"authenticates with"| node_identity
node_identity -->|"verifies login"| node_website
node_telegram -->|"delegates orders"| node_catalog
node_website -->|"delegates orders"| node_catalog
node_admin -->|"manages store"| node_catalog
node_api -->|"serves requests"| node_catalog
node_telegram -->|"starts payment"| node_payments
node_website -->|"starts payment"| node_payments
node_payments -->|"verifies payment"| node_bakong
node_telegram -->|"launches watcher"| node_delivery
node_website -->|"launches watcher"| node_delivery
node_delivery -->|"sends credentials"| node_telegram_service
node_telegram -->|"uses wallet"| node_wallet
node_website -->|"offers activation"| node_sms
node_sms -->|"creates rentals"| node_sms_provider
node_pandora -->|"syncs and fulfills"| node_pandora_provider
node_catalog -->|"reads and writes"| node_database
node_payments -->|"stores sessions"| node_database
node_sms -->|"stores orders"| node_database
node_pandora -->|"stores mappings"| node_database
node_database -->|"persists"| node_models
node_api -->|"loads settings"| node_settings
node_telegram -->|"renders interface"| node_appearance
node_appearance -->|"loads appearance"| node_database

click node_telegram "https://github.com/seivkhengkhun/bondom_account/blob/master/app/bot/handlers.py"
click node_website "https://github.com/seivkhengkhun/bondom_account/blob/master/app/webshop/routes.py"
click node_admin "https://github.com/seivkhengkhun/bondom_account/blob/master/app/web/admin/admin.py"
click node_api "https://github.com/seivkhengkhun/bondom_account/blob/master/app/api/main.py"
click node_identity "https://github.com/seivkhengkhun/bondom_account/blob/master/app/webshop/auth.py"
click node_catalog "https://github.com/seivkhengkhun/bondom_account/blob/master/shared/services.py"
click node_payments "https://github.com/seivkhengkhun/bondom_account/blob/master/shared/payment_service.py"
click node_delivery "https://github.com/seivkhengkhun/bondom_account/blob/master/app/bot/handlers.py"
click node_wallet "https://github.com/seivkhengkhun/bondom_account/blob/master/shared/services.py"
click node_sms "https://github.com/seivkhengkhun/bondom_account/blob/master/shared/sms_service.py"
click node_pandora "https://github.com/seivkhengkhun/bondom_account/blob/master/shared/pandora.py"
click node_database "https://github.com/seivkhengkhun/bondom_account/blob/master/shared/database.py"
click node_models "https://github.com/seivkhengkhun/bondom_account/blob/master/shared/models.py"
click node_settings "https://github.com/seivkhengkhun/bondom_account/blob/master/shared/config.py"
click node_appearance "https://github.com/seivkhengkhun/bondom_account/blob/master/app/bot/appearance.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_telegram,node_website,node_admin,node_api,node_identity toneBlue
class node_catalog,node_payments,node_delivery,node_wallet,node_sms,node_pandora toneAmber
class node_database,node_models,node_settings,node_appearance toneMint
class node_bakong,node_sms_provider,node_pandora_provider,node_telegram_service toneRose
class node_customer toneIndigo
```

## Components

### Storefront Channels

- [Telegram Bot](https://github.com/seivkhengkhun/bondom_account/blob/master/app/bot/handlers.py): `app/bot/handlers.py`
- [Customer Website](https://github.com/seivkhengkhun/bondom_account/blob/master/app/webshop/routes.py): `app/webshop/routes.py`
- [Admin Dashboard](https://github.com/seivkhengkhun/bondom_account/blob/master/app/web/admin/admin.py): `app/web/admin/admin.py`
- [FastAPI Interface](https://github.com/seivkhengkhun/bondom_account/blob/master/app/api/main.py): `app/api/main.py`
- [Telegram Login](https://github.com/seivkhengkhun/bondom_account/blob/master/app/webshop/auth.py): `app/webshop/auth.py`

### Commerce Services

- [Catalog & Orders](https://github.com/seivkhengkhun/bondom_account/blob/master/shared/services.py): `shared/services.py`
- [KHQR Payments](https://github.com/seivkhengkhun/bondom_account/blob/master/shared/payment_service.py): `shared/payment_service.py`
- [Order Delivery](https://github.com/seivkhengkhun/bondom_account/blob/master/app/bot/handlers.py): `app/bot/handlers.py`
- [Wallet & Top-ups](https://github.com/seivkhengkhun/bondom_account/blob/master/shared/services.py): `shared/services.py`
- [SMS Activation](https://github.com/seivkhengkhun/bondom_account/blob/master/shared/sms_service.py): `shared/sms_service.py`
- [Supplier Fulfillment](https://github.com/seivkhengkhun/bondom_account/blob/master/shared/pandora.py): `shared/pandora.py`

### Shared Platform

- [Shared Database](https://github.com/seivkhengkhun/bondom_account/blob/master/shared/database.py): `shared/database.py`
- [Store Records](https://github.com/seivkhengkhun/bondom_account/blob/master/shared/models.py): `shared/models.py`
- [Configuration](https://github.com/seivkhengkhun/bondom_account/blob/master/shared/config.py): `shared/config.py`
- [Bot Appearance](https://github.com/seivkhengkhun/bondom_account/blob/master/app/bot/appearance.py): `app/bot/appearance.py`

### External Integrations

- **Bakong Network**
- **SMS Reseller**
- **Pandora Supplier**
- **Telegram Platform**

### Other components

- **Customer**

## Connections

- Customer → Telegram Bot: shops via
- Customer → Customer Website: shops via
- Customer → Telegram Login: authenticates with
- Telegram Login → Customer Website: verifies login (evidence: `app/webshop/routes.py`)
- Telegram Bot → Catalog & Orders: delegates orders (evidence: `app/bot/handlers.py`)
- Customer Website → Catalog & Orders: delegates orders (evidence: `app/webshop/routes.py`)
- Admin Dashboard → Catalog & Orders: manages store (evidence: `app/web/admin/admin.py`)
- FastAPI Interface → Catalog & Orders: serves requests (evidence: `app/api/main.py`)
- Telegram Bot → KHQR Payments: starts payment (evidence: `app/bot/handlers.py`)
- Customer Website → KHQR Payments: starts payment (evidence: `app/webshop/routes.py`)
- KHQR Payments → Bakong Network: verifies payment
- Telegram Bot → Order Delivery: launches watcher (evidence: `app/bot/handlers.py`)
- Customer Website → Order Delivery: launches watcher (evidence: `app/webshop/routes.py`)
- Order Delivery → Telegram Platform: sends credentials
- Telegram Bot → Wallet & Top-ups: uses wallet (evidence: `app/bot/handlers.py`)
- Customer Website → SMS Activation: offers activation (evidence: `app/webshop/routes.py`)
- SMS Activation → SMS Reseller: creates rentals (evidence: `shared/sms_service.py`)
- Supplier Fulfillment → Pandora Supplier: syncs and fulfills (evidence: `shared/pandora.py`)
- Catalog & Orders → Shared Database: reads and writes (evidence: `shared/services.py`)
- KHQR Payments → Shared Database: stores sessions (evidence: `shared/payment_service.py`)
- SMS Activation → Shared Database: stores orders (evidence: `shared/sms_service.py`)
- Supplier Fulfillment → Shared Database: stores mappings (evidence: `shared/pandora.py`)
- Shared Database → Store Records: persists (evidence: `shared/models.py`)
- FastAPI Interface → Configuration: loads settings (evidence: `app/api/main.py`)
- Telegram Bot → Bot Appearance: renders interface (evidence: `app/bot/runner.py`)
- Bot Appearance → Shared Database: loads appearance (evidence: `app/bot/appearance.py`)
