# 3252a8/remnawave-minishop architecture

> Architecture diagram of the GitHub repository 3252a8/remnawave-minishop, 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/3252a8/remnawave-minishop
- Repository: https://github.com/3252a8/remnawave-minishop

## Overview

Remnawave Minishop sells and manages Remnawave subscriptions through a Telegram bot and a browser-based Mini App, with a separate web admin panel. The main user journey is registration or sign-in, subscription selection and payment, then viewing subscription status and connection details. The backend also supports admin operations, payment providers, and theme packages. The excerpts show route registration and database setup; other feature relationships below rely on README statements or the source index, so unsampled implementation links are omitted or marked unverified.

Main entry points: [`backend/bot/main_bot.py`](https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/main_bot.py) (Telegram bot), [`backend/bot/app/controllers/dispatcher_controller.py`](https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/controllers/dispatcher_controller.py) (Update dispatcher), [`backend/bot/app/web/admin_api_impl/routes.py`](https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/web/admin_api_impl/routes.py) (Admin API), [`backend/bot/app/web/webapp/routes.py`](https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/web/webapp/routes.py) (Mini App routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry points"]
  node_bot["Telegram bot<br/>[main_bot.py]"]
  node_bot_dispatch["Update dispatcher"]
  node_user_handlers["User journeys"]
  node_webapp_ui["Mini App UI<br/>[App.svelte]"]
  node_webapp_routes["Mini App routes<br/>[routes.py]"]
  node_web_server["Web server<br/>[web_server.py]"]
end

subgraph group_commerce["Subscription commerce"]
  node_billing["Billing flows<br/>[billing.py]"]
  node_payment_providers["Payment providers"]
  node_subscription["Subscription services"]
end

subgraph group_operations["Admin operations"]
  node_admin_api["Admin API<br/>[routes.py]"]
  node_admin_ui["Admin panel UI"]
  node_theme_packages["Theme packages"]
end

subgraph group_platform["Platform services"]
  node_database[("PostgreSQL data<br/>[models.py]")]
  node_payment_dal["Payment persistence<br/>[payment_dal.py]"]
  node_settings["Runtime settings<br/>[settings.py]"]
  node_plugins["Plugin packages<br/>[packages.py]"]
end

node_telegram_user(("Telegram user"))
node_miniapp_user(("Mini App user"))
node_admin(("Administrator"))
node_remnawave["Remnawave Panel"]
node_redis[("Redis")]

node_telegram_user -->|"starts journey"| node_bot
node_bot -->|"dispatches updates"| node_bot_dispatch
node_bot_dispatch -.->|"routes interactions"| node_user_handlers
node_miniapp_user -->|"uses Mini App"| node_webapp_ui
node_webapp_ui -.->|"requests app data"| node_webapp_routes
node_web_server -.->|"registers routes"| node_webapp_routes
node_admin -->|"manages shop"| node_admin_ui
node_admin_ui -.->|"calls API"| node_admin_api
node_webapp_routes -->|"imports billing"| node_billing
node_billing -.->|"initiates payment"| node_payment_providers
node_telegram_user -.->|"pays through"| node_payment_providers
node_payment_providers -->|"records payments"| node_payment_dal
node_payment_dal -->|"reads and writes"| node_database
node_subscription -.->|"syncs subscriptions"| node_remnawave
node_admin_api -.->|"syncs panel data"| node_remnawave
node_admin_api -.->|"administers themes"| node_theme_packages
node_theme_packages -.->|"stores registry files"| node_database
node_bot_dispatch -->|"loads configuration"| node_settings
node_bot -.->|"loads extensions"| node_plugins
node_bot -.->|"uses cache and queue"| node_redis

click node_bot "https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/main_bot.py"
click node_bot_dispatch "https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/controllers/dispatcher_controller.py"
click node_user_handlers "https://github.com/3252a8/remnawave-minishop/tree/main/backend/bot/handlers/user"
click node_webapp_ui "https://github.com/3252a8/remnawave-minishop/blob/main/frontend/src/App.svelte"
click node_webapp_routes "https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/web/webapp/routes.py"
click node_web_server "https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/web/web_server.py"
click node_billing "https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/web/webapp/billing.py"
click node_payment_providers "https://github.com/3252a8/remnawave-minishop/tree/main/backend/bot/payment_providers"
click node_subscription "https://github.com/3252a8/remnawave-minishop/tree/main/backend/bot/services"
click node_admin_api "https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/web/admin_api_impl/routes.py"
click node_admin_ui "https://github.com/3252a8/remnawave-minishop/tree/main/frontend/src/admin"
click node_theme_packages "https://github.com/3252a8/remnawave-minishop/tree/main/backend/config/theme_packages"
click node_database "https://github.com/3252a8/remnawave-minishop/blob/main/backend/db/models.py"
click node_payment_dal "https://github.com/3252a8/remnawave-minishop/blob/main/backend/db/dal/payment_dal.py"
click node_settings "https://github.com/3252a8/remnawave-minishop/blob/main/backend/config/settings.py"
click node_plugins "https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/plugins/packages.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_bot,node_bot_dispatch,node_user_handlers,node_webapp_ui,node_webapp_routes,node_web_server,node_telegram_user,node_miniapp_user toneBlue
class node_billing,node_payment_providers,node_subscription,node_redis toneAmber
class node_admin_api,node_admin_ui,node_theme_packages toneMint
class node_database,node_payment_dal,node_settings,node_plugins toneRose
class node_admin,node_remnawave toneIndigo
```

## Components

### User entry points

- [Telegram bot](https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/main_bot.py): `backend/bot/main_bot.py`
- [Update dispatcher](https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/controllers/dispatcher_controller.py): `backend/bot/app/controllers/dispatcher_controller.py`
- [User journeys](https://github.com/3252a8/remnawave-minishop/tree/main/backend/bot/handlers/user): `backend/bot/handlers/user`
- [Mini App UI](https://github.com/3252a8/remnawave-minishop/blob/main/frontend/src/App.svelte): `frontend/src/App.svelte`
- [Mini App routes](https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/web/webapp/routes.py): `backend/bot/app/web/webapp/routes.py`
- [Web server](https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/web/web_server.py): `backend/bot/app/web/web_server.py`

### Subscription commerce

- [Billing flows](https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/web/webapp/billing.py): `backend/bot/app/web/webapp/billing.py`
- [Payment providers](https://github.com/3252a8/remnawave-minishop/tree/main/backend/bot/payment_providers): `backend/bot/payment_providers`
- [Subscription services](https://github.com/3252a8/remnawave-minishop/tree/main/backend/bot/services): `backend/bot/services`

### Admin operations

- [Admin API](https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/app/web/admin_api_impl/routes.py): `backend/bot/app/web/admin_api_impl/routes.py`
- [Admin panel UI](https://github.com/3252a8/remnawave-minishop/tree/main/frontend/src/admin): `frontend/src/admin`
- [Theme packages](https://github.com/3252a8/remnawave-minishop/tree/main/backend/config/theme_packages): `backend/config/theme_packages`

### Platform services

- [PostgreSQL data](https://github.com/3252a8/remnawave-minishop/blob/main/backend/db/models.py): `backend/db/models.py`
- [Payment persistence](https://github.com/3252a8/remnawave-minishop/blob/main/backend/db/dal/payment_dal.py): `backend/db/dal/payment_dal.py`
- [Runtime settings](https://github.com/3252a8/remnawave-minishop/blob/main/backend/config/settings.py): `backend/config/settings.py`
- [Plugin packages](https://github.com/3252a8/remnawave-minishop/blob/main/backend/bot/plugins/packages.py): `backend/bot/plugins/packages.py`

### Other components

- **Telegram user**
- **Mini App user**
- **Administrator**
- **Remnawave Panel**
- **Redis**

## Connections

- Telegram user → Telegram bot: starts journey (evidence: `README.md`)
- Telegram bot → Update dispatcher: dispatches updates (evidence: `backend/bot/app/controllers/dispatcher_controller.py`)
- Update dispatcher → User journeys: routes interactions
- Mini App user → Mini App UI: uses Mini App (evidence: `README.md`)
- Mini App UI → Mini App routes: requests app data
- Web server → Mini App routes: registers routes
- Administrator → Admin panel UI: manages shop (evidence: `README.md`)
- Admin panel UI → Admin API: calls API
- Mini App routes → Billing flows: imports billing (evidence: `backend/bot/app/web/webapp/routes.py`)
- Billing flows → Payment providers: initiates payment
- Telegram user → Payment providers: pays through (evidence: `README.md`)
- Payment providers → Payment persistence: records payments (evidence: `backend/bot/payment_providers/yookassa/service.py`)
- Payment persistence → PostgreSQL data: reads and writes (evidence: `backend/db/dal/payment_dal.py`)
- Subscription services → Remnawave Panel: syncs subscriptions (evidence: `README.md`)
- Admin API → Remnawave Panel: syncs panel data (evidence: `README.md`)
- Admin API → Theme packages: administers themes
- Theme packages → PostgreSQL data: stores registry files
- Update dispatcher → Runtime settings: loads configuration (evidence: `backend/bot/app/controllers/dispatcher_controller.py`)
- Telegram bot → Plugin packages: loads extensions
- Telegram bot → Redis: uses cache and queue (evidence: `README.md`)
