# arslanansari1629-blip/ai architecture

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

- Interactive diagram: https://gitdiagram.com/arslanansari1629-blip/ai
- Repository: https://github.com/arslanansari1629-blip/ai

## Overview

BotForge is a browser-only Telegram bot authoring and hosting tool. Users create a bot in the visual builder, save it locally, test rules in the simulator or against Telegram, then generate code and follow deployment guidance. Other documented capabilities include starter templates, portable backups, ZIP downloads, and offline PWA support. The README documents these responsibilities; the only inspected source excerpt is the service worker, so most application links below rely on README statements rather than inspected call sites.

Main entry points: [`assets/js/main.js`](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/main.js) (App router), [`assets/js/views/deploy.js`](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/views/deploy.js) (Deploy guide), [`assets/js/views/builder.js`](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/views/builder.js) (Visual builder), [`assets/js/runtime.js`](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/runtime.js) (Polling runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Bot authoring"]
  node_app["App router<br/>[main.js]"]
  node_builder["Visual builder<br/>[builder.js]"]
  node_store[("Bot store and rules<br/>[store.js]")]
  node_templates["Starter templates<br/>[templates.js]"]
  node_template_view["Template browser<br/>[templates.js]"]
end

subgraph group_execution["Bot execution"]
  node_chat["Rule simulator<br/>[chat.js]"]
  node_runtime_view["Runtime screen<br/>[runtime.js]"]
  node_runtime["Polling runtime<br/>[runtime.js]"]
  node_telegram_client["Telegram client<br/>[telegram.js]"]
end

subgraph group_delivery["Code and deployment"]
  node_codegen["Code generators<br/>[codegen.js]"]
  node_deploy_view["Deploy guide<br/>[deploy.js]"]
  node_deploy["Deploy helpers<br/>[deploy.js]"]
  node_io["JSON backup<br/>[io.js]"]
  node_zip["ZIP download<br/>[zip.js]"]
end

subgraph group_platform["Browser platform"]
  node_browser_storage[("Browser localStorage")]
  node_service_worker["Offline service worker<br/>[sw.js]"]
  node_browser_cache[("Static asset cache")]
end

node_user(("Bot creator"))
node_telegram_api{{"Telegram Bot API"}}
node_hosting{{"Bot hosting targets"}}

node_user -->|"opens"| node_app
node_app -->|"routes to"| node_builder
node_app -->|"routes to"| node_template_view
node_app -->|"routes to"| node_runtime_view
node_app -->|"routes to"| node_deploy_view
node_builder -->|"saves bot"| node_store
node_store -->|"stores locally"| node_browser_storage
node_template_view -->|"offers"| node_templates
node_builder -->|"tests rules"| node_chat
node_runtime_view -->|"starts"| node_runtime
node_runtime -->|"uses bot rules"| node_store
node_runtime -->|"polls and replies"| node_telegram_client
node_telegram_client -->|"calls"| node_telegram_api
node_deploy_view -->|"generates targets"| node_codegen
node_deploy_view -->|"uses guidance"| node_deploy
node_deploy_view -->|"guides deployment"| node_hosting
node_user -->|"exports or imports"| node_io
node_user -->|"downloads bot"| node_zip
node_service_worker -->|"caches shell assets"| node_browser_cache

click node_app "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/main.js"
click node_builder "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/views/builder.js"
click node_store "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/store.js"
click node_templates "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/templates.js"
click node_template_view "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/views/templates.js"
click node_chat "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/chat.js"
click node_runtime_view "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/views/runtime.js"
click node_runtime "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/runtime.js"
click node_telegram_client "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/telegram.js"
click node_codegen "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/codegen.js"
click node_deploy_view "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/views/deploy.js"
click node_deploy "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/deploy.js"
click node_io "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/io.js"
click node_zip "https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/zip.js"
click node_service_worker "https://github.com/arslanansari1629-blip/ai/blob/main/sw.js"

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_app,node_builder,node_store,node_templates,node_template_view toneBlue
class node_chat,node_runtime_view,node_runtime,node_telegram_client toneAmber
class node_codegen,node_deploy_view,node_deploy,node_io,node_zip,node_telegram_api toneMint
class node_browser_storage,node_service_worker,node_browser_cache toneRose
class node_user,node_hosting toneIndigo
```

## Components

### Bot authoring

- [App router](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/main.js): `assets/js/main.js`
- [Visual builder](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/views/builder.js): `assets/js/views/builder.js`
- [Bot store and rules](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/store.js): `assets/js/store.js`
- [Starter templates](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/templates.js): `assets/js/templates.js`
- [Template browser](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/views/templates.js): `assets/js/views/templates.js`

### Bot execution

- [Rule simulator](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/chat.js): `assets/js/chat.js`
- [Runtime screen](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/views/runtime.js): `assets/js/views/runtime.js`
- [Polling runtime](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/runtime.js): `assets/js/runtime.js`
- [Telegram client](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/telegram.js): `assets/js/telegram.js`

### Code and deployment

- [Code generators](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/codegen.js): `assets/js/codegen.js`
- [Deploy guide](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/views/deploy.js): `assets/js/views/deploy.js`
- [Deploy helpers](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/deploy.js): `assets/js/deploy.js`
- [JSON backup](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/io.js): `assets/js/io.js`
- [ZIP download](https://github.com/arslanansari1629-blip/ai/blob/main/assets/js/zip.js): `assets/js/zip.js`

### Browser platform

- **Browser localStorage**
- [Offline service worker](https://github.com/arslanansari1629-blip/ai/blob/main/sw.js): `sw.js`
- **Static asset cache**

### Other components

- **Bot creator**
- **Telegram Bot API**
- **Bot hosting targets**

## Connections

- Bot creator → App router: opens (evidence: `README.md`)
- App router → Visual builder: routes to (evidence: `README.md`)
- App router → Template browser: routes to (evidence: `README.md`)
- App router → Runtime screen: routes to (evidence: `README.md`)
- App router → Deploy guide: routes to (evidence: `README.md`)
- Visual builder → Bot store and rules: saves bot (evidence: `README.md`)
- Bot store and rules → Browser localStorage: stores locally (evidence: `README.md`)
- Template browser → Starter templates: offers (evidence: `README.md`)
- Visual builder → Rule simulator: tests rules (evidence: `README.md`)
- Runtime screen → Polling runtime: starts (evidence: `README.md`)
- Polling runtime → Bot store and rules: uses bot rules (evidence: `README.md`)
- Polling runtime → Telegram client: polls and replies (evidence: `README.md`)
- Telegram client → Telegram Bot API: calls (evidence: `README.md`)
- Deploy guide → Code generators: generates targets (evidence: `README.md`)
- Deploy guide → Deploy helpers: uses guidance (evidence: `README.md`)
- Deploy guide → Bot hosting targets: guides deployment (evidence: `README.md`)
- Bot creator → JSON backup: exports or imports (evidence: `README.md`)
- Bot creator → ZIP download: downloads bot (evidence: `README.md`)
- Offline service worker → Static asset cache: caches shell assets (evidence: `sw.js`)
