# illiagerega/concert.in.ua architecture

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

- Interactive diagram: https://gitdiagram.com/illiagerega/concert.in.ua
- Repository: https://github.com/illiagerega/concert.in.ua

## Overview

concert.in.ua is a Telegram ticket-sales bot. Users start the bot, provide contact details for their profile, browse events by city and event, choose ticket type and quantity, and proceed through payment; successful-payment handling creates tickets. Users can also view their profile and existing tickets, and contact support. The graph separates bot workflows, ticket and profile data, and shared utilities. The excerpts show SQLite access and several calls, but omit parts of the purchase handlers, so unshown relationships are not inferred.

Main entry points: [`main.py`](https://github.com/illiagerega/concert.in.ua/blob/main/main.py) (Bot handlers), [`logs.py`](https://github.com/illiagerega/concert.in.ua/blob/main/logs.py) (Activity logging), [`profile.py`](https://github.com/illiagerega/concert.in.ua/blob/main/profile.py) (Profile operations), [`db.py`](https://github.com/illiagerega/concert.in.ua/blob/main/db.py) (Ticket operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bot_workflows["Bot workflows"]
  node_bot["Bot handlers<br/>[main.py]"]
  node_profile_flow["Profile and contact<br/>[main.py]"]
  node_event_browse["City and event browse<br/>[main.py]"]
  node_ticket_select["Ticket selection<br/>[main.py]"]
  node_payment["Payment handling<br/>[main.py]"]
  node_ticket_view["View tickets<br/>[main.py]"]
  node_support["Support menu<br/>[main.py]"]
end

subgraph group_domain_data["Ticket and profile data"]
  node_profile_data["Profile operations<br/>[profile.py]"]
  node_ticket_data["Ticket operations<br/>[db.py]"]
  node_sqlite[("SQLite database<br/>[db.db]")]
end

subgraph group_shared["Shared utilities"]
  node_logging["Activity logging<br/>[logs.py]"]
  node_ticket_helpers["Ticket ID and time<br/>[ticket.py]"]
  node_config["Bot and DB config<br/>[config.py]"]
end

node_user(("Telegram user"))
node_telegram["Telegram platform"]

node_user -->|"sends commands"| node_bot
node_bot -->|"sends messages"| node_telegram
node_bot -->|"routes profile actions"| node_profile_flow
node_bot -->|"routes buy flow"| node_event_browse
node_bot -->|"routes selections"| node_ticket_select
node_bot -->|"handles payment"| node_payment
node_bot -->|"loads tickets"| node_ticket_view
node_bot -->|"shows help"| node_support
node_bot -->|"calls profile operations"| node_profile_data
node_bot -->|"calls ticket operations"| node_ticket_data
node_bot -->|"records user actions"| node_logging
node_profile_data -->|"reads and writes"| node_sqlite
node_profile_data -->|"gets current time"| node_ticket_helpers
node_profile_data -->|"logs operations"| node_logging
node_ticket_data -->|"reads and writes"| node_sqlite
node_ticket_data -->|"generates ID and time"| node_ticket_helpers
node_ticket_data -->|"logs operations"| node_logging
node_logging -->|"writes log records"| node_sqlite
node_logging -->|"gets current time"| node_ticket_helpers
node_profile_data -->|"uses DB config"| node_config
node_ticket_data -->|"uses DB config"| node_config
node_logging -->|"uses DB config"| node_config
node_bot -->|"uses bot config"| node_config

click node_bot "https://github.com/illiagerega/concert.in.ua/blob/main/main.py"
click node_profile_flow "https://github.com/illiagerega/concert.in.ua/blob/main/main.py"
click node_event_browse "https://github.com/illiagerega/concert.in.ua/blob/main/main.py"
click node_ticket_select "https://github.com/illiagerega/concert.in.ua/blob/main/main.py"
click node_payment "https://github.com/illiagerega/concert.in.ua/blob/main/main.py"
click node_ticket_view "https://github.com/illiagerega/concert.in.ua/blob/main/main.py"
click node_support "https://github.com/illiagerega/concert.in.ua/blob/main/main.py"
click node_profile_data "https://github.com/illiagerega/concert.in.ua/blob/main/profile.py"
click node_ticket_data "https://github.com/illiagerega/concert.in.ua/blob/main/db.py"
click node_sqlite "https://github.com/illiagerega/concert.in.ua/blob/main/db.db"
click node_logging "https://github.com/illiagerega/concert.in.ua/blob/main/logs.py"
click node_ticket_helpers "https://github.com/illiagerega/concert.in.ua/blob/main/ticket.py"
click node_config "https://github.com/illiagerega/concert.in.ua/blob/main/config.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_profile_flow,node_event_browse,node_ticket_select,node_payment,node_ticket_view,node_support,node_user toneBlue
class node_profile_data,node_ticket_data,node_sqlite toneAmber
class node_logging,node_ticket_helpers,node_config toneMint
class node_telegram toneIndigo
```

## Components

### Bot workflows

- [Bot handlers](https://github.com/illiagerega/concert.in.ua/blob/main/main.py): `main.py`
- [Profile and contact](https://github.com/illiagerega/concert.in.ua/blob/main/main.py): `main.py`
- [City and event browse](https://github.com/illiagerega/concert.in.ua/blob/main/main.py): `main.py`
- [Ticket selection](https://github.com/illiagerega/concert.in.ua/blob/main/main.py): `main.py`
- [Payment handling](https://github.com/illiagerega/concert.in.ua/blob/main/main.py): `main.py`
- [View tickets](https://github.com/illiagerega/concert.in.ua/blob/main/main.py): `main.py`
- [Support menu](https://github.com/illiagerega/concert.in.ua/blob/main/main.py): `main.py`

### Ticket and profile data

- [Profile operations](https://github.com/illiagerega/concert.in.ua/blob/main/profile.py): `profile.py`
- [Ticket operations](https://github.com/illiagerega/concert.in.ua/blob/main/db.py): `db.py`
- [SQLite database](https://github.com/illiagerega/concert.in.ua/blob/main/db.db): `db.db`

### Shared utilities

- [Activity logging](https://github.com/illiagerega/concert.in.ua/blob/main/logs.py): `logs.py`
- [Ticket ID and time](https://github.com/illiagerega/concert.in.ua/blob/main/ticket.py): `ticket.py`
- [Bot and DB config](https://github.com/illiagerega/concert.in.ua/blob/main/config.py): `config.py`

### Other components

- **Telegram user**
- **Telegram platform**

## Connections

- Telegram user → Bot handlers: sends commands (evidence: `main.py`)
- Bot handlers → Telegram platform: sends messages (evidence: `main.py`)
- Bot handlers → Profile and contact: routes profile actions (evidence: `main.py`)
- Bot handlers → City and event browse: routes buy flow (evidence: `main.py`)
- Bot handlers → Ticket selection: routes selections (evidence: `main.py`)
- Bot handlers → Payment handling: handles payment (evidence: `main.py`)
- Bot handlers → View tickets: loads tickets (evidence: `main.py`)
- Bot handlers → Support menu: shows help (evidence: `main.py`)
- Bot handlers → Profile operations: calls profile operations (evidence: `main.py`)
- Bot handlers → Ticket operations: calls ticket operations (evidence: `main.py`)
- Bot handlers → Activity logging: records user actions (evidence: `main.py`)
- Profile operations → SQLite database: reads and writes (evidence: `profile.py`)
- Profile operations → Ticket ID and time: gets current time (evidence: `profile.py`)
- Profile operations → Activity logging: logs operations (evidence: `profile.py`)
- Ticket operations → SQLite database: reads and writes (evidence: `db.py`)
- Ticket operations → Ticket ID and time: generates ID and time (evidence: `db.py`)
- Ticket operations → Activity logging: logs operations (evidence: `db.py`)
- Activity logging → SQLite database: writes log records (evidence: `logs.py`)
- Activity logging → Ticket ID and time: gets current time (evidence: `logs.py`)
- Profile operations → Bot and DB config: uses DB config (evidence: `profile.py`)
- Ticket operations → Bot and DB config: uses DB config (evidence: `db.py`)
- Activity logging → Bot and DB config: uses DB config (evidence: `logs.py`)
- Bot handlers → Bot and DB config: uses bot config (evidence: `main.py`)
