# fazaroot/app-telecore architecture

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

- Interactive diagram: https://gitdiagram.com/fazaroot/app-telecore
- Repository: https://github.com/fazaroot/app-telecore

## Overview

TeleCore is a Telegram bot control center with a React/Capacitor Android client and a separately running Rust backend. The main workflow is to configure bots and workflows in the app, connect to the backend, then have that backend poll Telegram, process updates, run automation or scheduled tasks, and deliver messages. The README also documents analytics, knowledge/AI, backups, migration, security, webhooks, and MCP. Some backend and Android subsystems are represented at their exact enclosing directories because their implementations were not excerpted; edges are limited to documented or indexed relationships.

Main entry points: [`backend/src/api`](https://github.com/fazaroot/app-telecore/tree/main/backend/src/api) (REST endpoints), [`backend/src/bot/telegram.rs`](https://github.com/fazaroot/app-telecore/blob/main/backend/src/bot/telegram.rs) (Telegram client), [`frontend/src/App.tsx`](https://github.com/fazaroot/app-telecore/blob/main/frontend/src/App.tsx) (App routes), [`backend`](https://github.com/fazaroot/app-telecore/tree/main/backend) (Rust backend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Android management app"]
  node_app["App routes<br/>[App.tsx]"]
  node_settings["Connection settings<br/>[settings.ts]"]
  node_pages["Management pages"]
  node_message_ui["Message composer<br/>[MessagesPage.tsx]"]
  node_workflow_ui["Workflow builder"]
  node_client_api["API client<br/>[client.ts]"]
  node_device_api["On-device bridge<br/>[onDeviceBackend.ts]"]
  node_android_supervisor["Local supervisor"]
end

subgraph group_runtime["Backend runtime"]
  node_backend["Rust backend"]
  node_rest["REST endpoints"]
  node_database[("SQLite database<br/>[db.rs]")]
  node_models["Domain models<br/>[models.rs]"]
  node_automation["Automation engine<br/>[engine.rs]"]
  node_scheduler["Scheduled tasks<br/>[runner.rs]"]
end

subgraph group_messaging["Telegram messaging"]
  node_telegram["Telegram client<br/>[telegram.rs]"]
  node_polling["Bot polling<br/>[polling.rs]"]
  node_updates["Update processing"]
end

subgraph group_operations["Operations and integrations"]
  node_ai_knowledge["AI and knowledge"]
  node_webhooks["Outgoing webhooks"]
  node_backup_migration["Backup and migration"]
  node_security["Security and tokens"]
  node_mcp["MCP integration<br/>[mcp.rs]"]
  node_analytics["Analytics and logs"]
end

node_operator(("Bot operator"))
node_telegram_service{{"Telegram Bot API"}}

node_operator -->|"configures bots"| node_app
node_app -->|"routes to"| node_pages
node_pages -.->|"requests backend"| node_client_api
node_message_ui -->|"sends messages"| node_client_api
node_workflow_ui -.->|"configures workflows"| node_client_api
node_settings -->|"selects backend mode"| node_device_api
node_device_api -->|"controls local backend"| node_android_supervisor
node_app -->|"connects by URL"| node_backend
node_backend -->|"serves REST API"| node_rest
node_backend -->|"uses SQLite"| node_database
node_polling -->|"polls updates"| node_telegram
node_telegram -->|"calls Bot API"| node_telegram_service
node_updates -.->|"processes workflows"| node_automation
node_automation -->|"sends actions"| node_telegram
node_scheduler -->|"runs scheduled tasks"| node_telegram
node_rest -->|"offers backup and migration"| node_backup_migration
node_rest -->|"offers AI and knowledge"| node_ai_knowledge
node_rest -->|"manages subscriptions"| node_webhooks
node_webhooks -.->|"sends webhook events"| node_telegram_service
node_rest -->|"exposes MCP"| node_mcp
node_rest -->|"offers analytics and logs"| node_analytics
node_rest -->|"applies security features"| node_security
node_rest -->|"uses domain data"| node_models

click node_app "https://github.com/fazaroot/app-telecore/blob/main/frontend/src/App.tsx"
click node_settings "https://github.com/fazaroot/app-telecore/blob/main/frontend/src/stores/settings.ts"
click node_pages "https://github.com/fazaroot/app-telecore/tree/main/frontend/src/pages"
click node_message_ui "https://github.com/fazaroot/app-telecore/blob/main/frontend/src/pages/MessagesPage.tsx"
click node_workflow_ui "https://github.com/fazaroot/app-telecore/blob/main/frontend/src/components/WorkflowBuilder.tsx"
click node_client_api "https://github.com/fazaroot/app-telecore/blob/main/frontend/src/api/client.ts"
click node_device_api "https://github.com/fazaroot/app-telecore/blob/main/frontend/src/api/onDeviceBackend.ts"
click node_android_supervisor "https://github.com/fazaroot/app-telecore/blob/main/android/app/src/main/java/com/telecore/app/TeleCoreBackendService.java"
click node_backend "https://github.com/fazaroot/app-telecore/tree/main/backend"
click node_rest "https://github.com/fazaroot/app-telecore/tree/main/backend/src/api"
click node_database "https://github.com/fazaroot/app-telecore/blob/main/backend/src/db.rs"
click node_models "https://github.com/fazaroot/app-telecore/blob/main/backend/src/models.rs"
click node_automation "https://github.com/fazaroot/app-telecore/blob/main/backend/src/automation/engine.rs"
click node_scheduler "https://github.com/fazaroot/app-telecore/blob/main/backend/src/scheduler/runner.rs"
click node_telegram "https://github.com/fazaroot/app-telecore/blob/main/backend/src/bot/telegram.rs"
click node_polling "https://github.com/fazaroot/app-telecore/blob/main/backend/src/bot/polling.rs"
click node_updates "https://github.com/fazaroot/app-telecore/blob/main/backend/src/services/update_processor.rs"
click node_ai_knowledge "https://github.com/fazaroot/app-telecore/tree/main/backend/src/services"
click node_webhooks "https://github.com/fazaroot/app-telecore/blob/main/backend/src/services/outgoing_webhooks.rs"
click node_backup_migration "https://github.com/fazaroot/app-telecore/tree/main/backend/src/api"
click node_security "https://github.com/fazaroot/app-telecore/tree/main/backend/src/security"
click node_mcp "https://github.com/fazaroot/app-telecore/blob/main/backend/src/api/mcp.rs"
click node_analytics "https://github.com/fazaroot/app-telecore/tree/main/backend/src/api"

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_settings,node_pages,node_message_ui,node_workflow_ui,node_client_api,node_device_api,node_android_supervisor toneBlue
class node_backend,node_rest,node_database,node_models,node_automation,node_scheduler toneAmber
class node_telegram,node_polling,node_updates,node_telegram_service toneMint
class node_ai_knowledge,node_webhooks,node_backup_migration,node_security,node_mcp,node_analytics toneRose
class node_operator toneIndigo
```

## Components

### Android management app

- [App routes](https://github.com/fazaroot/app-telecore/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Connection settings](https://github.com/fazaroot/app-telecore/blob/main/frontend/src/stores/settings.ts): `frontend/src/stores/settings.ts`
- [Management pages](https://github.com/fazaroot/app-telecore/tree/main/frontend/src/pages): `frontend/src/pages`
- [Message composer](https://github.com/fazaroot/app-telecore/blob/main/frontend/src/pages/MessagesPage.tsx): `frontend/src/pages/MessagesPage.tsx`
- [Workflow builder](https://github.com/fazaroot/app-telecore/blob/main/frontend/src/components/WorkflowBuilder.tsx): `frontend/src/components/WorkflowBuilder.tsx`
- [API client](https://github.com/fazaroot/app-telecore/blob/main/frontend/src/api/client.ts): `frontend/src/api/client.ts`
- [On-device bridge](https://github.com/fazaroot/app-telecore/blob/main/frontend/src/api/onDeviceBackend.ts): `frontend/src/api/onDeviceBackend.ts`
- [Local supervisor](https://github.com/fazaroot/app-telecore/blob/main/android/app/src/main/java/com/telecore/app/TeleCoreBackendService.java): `android/app/src/main/java/com/telecore/app/TeleCoreBackendService.java`

### Backend runtime

- [Rust backend](https://github.com/fazaroot/app-telecore/tree/main/backend): `backend`
- [REST endpoints](https://github.com/fazaroot/app-telecore/tree/main/backend/src/api): `backend/src/api`
- [SQLite database](https://github.com/fazaroot/app-telecore/blob/main/backend/src/db.rs): `backend/src/db.rs`
- [Domain models](https://github.com/fazaroot/app-telecore/blob/main/backend/src/models.rs): `backend/src/models.rs`
- [Automation engine](https://github.com/fazaroot/app-telecore/blob/main/backend/src/automation/engine.rs): `backend/src/automation/engine.rs`
- [Scheduled tasks](https://github.com/fazaroot/app-telecore/blob/main/backend/src/scheduler/runner.rs): `backend/src/scheduler/runner.rs`

### Telegram messaging

- [Telegram client](https://github.com/fazaroot/app-telecore/blob/main/backend/src/bot/telegram.rs): `backend/src/bot/telegram.rs`
- [Bot polling](https://github.com/fazaroot/app-telecore/blob/main/backend/src/bot/polling.rs): `backend/src/bot/polling.rs`
- [Update processing](https://github.com/fazaroot/app-telecore/blob/main/backend/src/services/update_processor.rs): `backend/src/services/update_processor.rs`

### Operations and integrations

- [AI and knowledge](https://github.com/fazaroot/app-telecore/tree/main/backend/src/services): `backend/src/services`
- [Outgoing webhooks](https://github.com/fazaroot/app-telecore/blob/main/backend/src/services/outgoing_webhooks.rs): `backend/src/services/outgoing_webhooks.rs`
- [Backup and migration](https://github.com/fazaroot/app-telecore/tree/main/backend/src/api): `backend/src/api`
- [Security and tokens](https://github.com/fazaroot/app-telecore/tree/main/backend/src/security): `backend/src/security`
- [MCP integration](https://github.com/fazaroot/app-telecore/blob/main/backend/src/api/mcp.rs): `backend/src/api/mcp.rs`
- [Analytics and logs](https://github.com/fazaroot/app-telecore/tree/main/backend/src/api): `backend/src/api`

### Other components

- **Bot operator**
- **Telegram Bot API**

## Connections

- Bot operator → App routes: configures bots
- App routes → Management pages: routes to (evidence: `frontend/src/App.tsx`)
- Management pages → API client: requests backend
- Message composer → API client: sends messages (evidence: `frontend/src/pages/MessagesPage.tsx`)
- Workflow builder → API client: configures workflows
- Connection settings → On-device bridge: selects backend mode (evidence: `frontend/src/api/onDeviceBackend.ts`)
- On-device bridge → Local supervisor: controls local backend
- App routes → Rust backend: connects by URL
- Rust backend → REST endpoints: serves REST API (evidence: `backend/src/automation/engine.rs`)
- Rust backend → SQLite database: uses SQLite (evidence: `backend/src/lib.rs`)
- Bot polling → Telegram client: polls updates
- Telegram client → Telegram Bot API: calls Bot API (evidence: `backend/src/bot/telegram.rs`)
- Update processing → Automation engine: processes workflows
- Automation engine → Telegram client: sends actions (evidence: `backend/src/automation/engine.rs`)
- Scheduled tasks → Telegram client: runs scheduled tasks (evidence: `backend/src/scheduler/runner.rs`)
- REST endpoints → Backup and migration: offers backup and migration
- REST endpoints → AI and knowledge: offers AI and knowledge (evidence: `backend/src/api/outgoing_webhooks.rs`)
- REST endpoints → Outgoing webhooks: manages subscriptions (evidence: `backend/src/api/outgoing_webhooks.rs`)
- Outgoing webhooks → Telegram Bot API: sends webhook events
- REST endpoints → MCP integration: exposes MCP
- REST endpoints → Analytics and logs: offers analytics and logs
- REST endpoints → Security and tokens: applies security features (evidence: `backend/src/api/notifications.rs`)
- REST endpoints → Domain models: uses domain data (evidence: `backend/src/api/notifications.rs`)
