# sharlayvlad/adaptlink_support architecture

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

- Interactive diagram: https://gitdiagram.com/sharlayvlad/adaptlink_support
- Repository: https://github.com/sharlayvlad/adaptlink_support

## Overview

AdaptLink is a Telegram support-request product with a Telegram bot and a React Mini App. Users register, submit requests or suggestions, and exchange messages with an administrator after the request is accepted; administrators manage request status and conversations. The Mini App uses the Express API, while the bot also handles registration, notifications, and instruction delivery. Persistent domain data is implemented in db.js. Some subsystem details are documented in the README but their implementation was not sampled, so those relationships are shown only where documented.

Main entry points: [`index.js`](https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js) (Telegram bot), [`apps/web/src/App.tsx`](https://github.com/sharlayvlad/adaptlink_support/blob/main/apps/web/src/App.tsx) (Mini App), [`db.js`](https://github.com/sharlayvlad/adaptlink_support/blob/main/db.js) (Domain data store), [`instructions_html`](https://github.com/sharlayvlad/adaptlink_support/tree/main/instructions_html) (HTML instructions)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["User interfaces"]
  node_miniapp["Mini App<br/>[App.tsx]"]
end

subgraph group_service["Bot and API"]
  node_bot["Telegram bot<br/>[index.js]"]
  node_api["HTTP API<br/>[index.js]"]
  node_instructions["Instruction delivery<br/>[index.js]"]
end

subgraph group_domain["Support workflows"]
  node_registration["Registration and roles<br/>[index.js]"]
  node_requests["Request lifecycle<br/>[index.js]"]
  node_suggestions["Suggestions<br/>[index.js]"]
  node_conversations["Request conversations<br/>[index.js]"]
  node_notifications["Notifications<br/>[index.js]"]
end

subgraph group_persistence["Persistence and guidance"]
  node_store[("Domain data store<br/>[db.js]")]
  node_instruction_files["HTML instructions"]
end

node_user(("User"))
node_admin(("Administrator"))
node_telegram(("Telegram"))

node_user -->|"uses"| node_telegram
node_telegram -->|"sends updates"| node_bot
node_user -->|"opens"| node_miniapp
node_admin -->|"manages requests"| node_miniapp
node_miniapp -->|"calls"| node_api
node_bot -->|"handles registration"| node_registration
node_api -.->|"serves registration"| node_registration
node_bot -->|"handles requests"| node_requests
node_api -->|"serves request actions"| node_requests
node_bot -->|"accepts suggestions"| node_suggestions
node_api -.->|"serves suggestions"| node_suggestions
node_api -->|"serves messages"| node_conversations
node_bot -->|"sends alerts"| node_notifications
node_api -.->|"notifies users"| node_notifications
node_bot -->|"uses"| node_store
node_api -->|"reads and writes"| node_store
node_bot -->|"routes instruction requests"| node_instructions
node_api -->|"serves instructions"| node_instructions
node_instructions -->|"sends HTML files"| node_instruction_files
node_bot -->|"sends messages"| node_telegram

click node_miniapp "https://github.com/sharlayvlad/adaptlink_support/blob/main/apps/web/src/App.tsx"
click node_bot "https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js"
click node_api "https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js"
click node_registration "https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js"
click node_requests "https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js"
click node_suggestions "https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js"
click node_conversations "https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js"
click node_notifications "https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js"
click node_store "https://github.com/sharlayvlad/adaptlink_support/blob/main/db.js"
click node_instructions "https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js"
click node_instruction_files "https://github.com/sharlayvlad/adaptlink_support/tree/main/instructions_html"

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_miniapp,node_user toneBlue
class node_bot,node_api,node_instructions toneAmber
class node_registration,node_requests,node_suggestions,node_conversations,node_notifications toneMint
class node_store,node_instruction_files toneRose
class node_admin,node_telegram toneIndigo
```

## Components

### User interfaces

- [Mini App](https://github.com/sharlayvlad/adaptlink_support/blob/main/apps/web/src/App.tsx): `apps/web/src/App.tsx`

### Bot and API

- [Telegram bot](https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js): `index.js`
- [HTTP API](https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js): `index.js`
- [Instruction delivery](https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js): `index.js`

### Support workflows

- [Registration and roles](https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js): `index.js`
- [Request lifecycle](https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js): `index.js`
- [Suggestions](https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js): `index.js`
- [Request conversations](https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js): `index.js`
- [Notifications](https://github.com/sharlayvlad/adaptlink_support/blob/main/index.js): `index.js`

### Persistence and guidance

- [Domain data store](https://github.com/sharlayvlad/adaptlink_support/blob/main/db.js): `db.js`
- [HTML instructions](https://github.com/sharlayvlad/adaptlink_support/tree/main/instructions_html): `instructions_html`

### Other components

- **User**
- **Administrator**
- **Telegram**

## Connections

- User → Telegram: uses (evidence: `README.md`)
- Telegram → Telegram bot: sends updates (evidence: `README.md`)
- User → Mini App: opens (evidence: `README.md`)
- Administrator → Mini App: manages requests (evidence: `README.md`)
- Mini App → HTTP API: calls (evidence: `apps/web/src/App.tsx`)
- Telegram bot → Registration and roles: handles registration (evidence: `index.js`)
- HTTP API → Registration and roles: serves registration (evidence: `README.md`)
- Telegram bot → Request lifecycle: handles requests (evidence: `index.js`)
- HTTP API → Request lifecycle: serves request actions (evidence: `index.js`)
- Telegram bot → Suggestions: accepts suggestions (evidence: `README.md`)
- HTTP API → Suggestions: serves suggestions (evidence: `README.md`)
- HTTP API → Request conversations: serves messages (evidence: `index.js`)
- Telegram bot → Notifications: sends alerts (evidence: `index.js`)
- HTTP API → Notifications: notifies users (evidence: `README.md`)
- Telegram bot → Domain data store: uses (evidence: `index.js`)
- HTTP API → Domain data store: reads and writes (evidence: `index.js`)
- Telegram bot → Instruction delivery: routes instruction requests (evidence: `index.js`)
- HTTP API → Instruction delivery: serves instructions (evidence: `index.js`)
- Instruction delivery → HTML instructions: sends HTML files (evidence: `index.js`)
- Telegram bot → Telegram: sends messages (evidence: `README.md`)
