# zhaba1337228/max-university-event-bot architecture

> Architecture diagram of the GitHub repository zhaba1337228/max-university-event-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zhaba1337228/max-university-event-bot
- Repository: https://github.com/zhaba1337228/max-university-event-bot

## Overview

This is a MAX university-events registration bot with a web administration console. Attendees browse events, complete a consent-and-details dialogue, confirm registration, and receive a short code and QR invitation; capacity and waitlists, later check-in, and reminders support the event lifecycle. Organizers manage events and participants, check attendees in, broadcast messages, and use AI helpers. The graph reflects README capabilities and sampled wiring; several feature-specific handler and service interactions are documented but their source was not sampled, so uncertain links are omitted.

Main entry points: [`internal/transport/adminapi/server.go`](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/transport/adminapi/server.go) (Admin REST API), [`internal/bot/handlers.go`](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers.go) (Bot routing), [`internal/repo`](https://github.com/zhaba1337228/max-university-event-bot/tree/main/internal/repo) (Persistence layer), [`internal/bot/handlers/registration.go`](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers/registration.go) (Registration dialogue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bot["MAX bot"]
  node_bot_ingress["Update ingress<br/>[longpoll.go]"]
  node_webhook["Webhook ingress<br/>[server.go]"]
  node_dispatcher["Bot dispatcher<br/>[dispatcher.go]"]
  node_bot_routes["Bot routing<br/>[handlers.go]"]
  node_registration_flow["Registration dialogue<br/>[registration.go]"]
  node_event_browsing["Event discovery<br/>[events.go]"]
  node_my_registration["My registration<br/>[my_registration.go]"]
  node_organizer_bot["Organizer bot tools<br/>[organizer.go]"]
  node_bot_delivery["MAX messaging<br/>[client.go]"]
end

subgraph group_core["Event services"]
  node_event_service["Event management<br/>[event.go]"]
  node_registration_service["Registration lifecycle<br/>[registration.go]"]
  node_attendance_service["Check-in<br/>[attendance.go]"]
  node_qr_service["QR invitations<br/>[qr.go]"]
  node_notification_service["Notifications<br/>[notification.go]"]
  node_ai_service["AI features<br/>[ai.go]"]
  node_repositories["Persistence layer"]
end

subgraph group_admin["Admin console"]
  node_web_ui["Web admin"]
  node_web_api_client["Web API client<br/>[api.ts]"]
  node_admin_api["Admin REST API<br/>[server.go]"]
  node_auth_service["Admin authentication<br/>[auth.go]"]
end

subgraph group_infra["Runtime and integrations"]
  node_postgres[("PostgreSQL")]
  node_scheduler["Reminder scheduler<br/>[scheduler.go]"]
  node_gigachat{{"GigaChat<br/>[client.go]"}}
end

node_attendee(("Attendee"))
node_organizer(("Organizer"))
node_max{{"MAX platform"}}

node_attendee -->|"sends updates"| node_max
node_max -->|"delivers updates"| node_bot_ingress
node_bot_ingress -->|"forwards updates"| node_dispatcher
node_webhook -.->|"queues updates"| node_dispatcher
node_dispatcher -->|"dispatches updates"| node_bot_routes
node_bot_routes -->|"routes event actions"| node_event_browsing
node_bot_routes -->|"routes dialogue"| node_registration_flow
node_bot_routes -->|"routes registration actions"| node_my_registration
node_bot_routes -->|"routes organizer actions"| node_organizer_bot
node_event_browsing -->|"lists events"| node_event_service
node_registration_flow -->|"creates registration"| node_registration_service
node_registration_flow -->|"requests invitation QR"| node_qr_service
node_my_registration -->|"requests QR again"| node_qr_service
node_registration_flow -->|"sends confirmation"| node_bot_delivery
node_qr_service -->|"delivers QR"| node_bot_delivery
node_organizer -->|"uses console"| node_web_ui
node_web_ui -->|"requests admin data"| node_web_api_client
node_web_api_client -->|"calls REST API"| node_admin_api
node_admin_api -->|"exchanges magic link"| node_auth_service
node_admin_api -->|"manages events"| node_event_service
node_admin_api -->|"manages registrations"| node_registration_service
node_admin_api -->|"checks in attendees"| node_attendance_service
node_admin_api -->|"broadcasts messages"| node_notification_service
node_admin_api -->|"requests AI helpers"| node_ai_service
node_registration_service -->|"persists registrations"| node_repositories
node_event_service -->|"reads and writes events"| node_repositories
node_attendance_service -->|"records attendance"| node_repositories
node_repositories -->|"reads and writes"| node_postgres
node_scheduler -->|"plans and loads notifications"| node_repositories
node_scheduler -->|"dispatches reminders"| node_notification_service
node_notification_service -->|"sends notifications"| node_bot_delivery
node_bot_delivery -->|"sends messages"| node_max
node_ai_service -.->|"requests generation"| node_gigachat
node_ai_service -.->|"uses event context"| node_event_service
node_attendance_service -.->|"triggers post-check-in feed"| node_notification_service

click node_bot_ingress "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/transport/longpoll/longpoll.go"
click node_webhook "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/transport/webhook/server.go"
click node_dispatcher "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/dispatcher.go"
click node_bot_routes "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers.go"
click node_registration_flow "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers/registration.go"
click node_event_browsing "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers/events.go"
click node_my_registration "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers/my_registration.go"
click node_organizer_bot "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers/organizer.go"
click node_bot_delivery "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/external/maxclient/client.go"
click node_event_service "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/event.go"
click node_registration_service "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/registration.go"
click node_attendance_service "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/attendance.go"
click node_qr_service "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/qr.go"
click node_notification_service "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/notification.go"
click node_ai_service "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/ai.go"
click node_repositories "https://github.com/zhaba1337228/max-university-event-bot/tree/main/internal/repo"
click node_scheduler "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/scheduler/scheduler.go"
click node_gigachat "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/external/gigachat/client.go"
click node_web_ui "https://github.com/zhaba1337228/max-university-event-bot/tree/main/web/app/(authenticated)"
click node_web_api_client "https://github.com/zhaba1337228/max-university-event-bot/blob/main/web/lib/api.ts"
click node_admin_api "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/transport/adminapi/server.go"
click node_auth_service "https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/auth.go"

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_ingress,node_webhook,node_dispatcher,node_bot_routes,node_registration_flow,node_event_browsing,node_my_registration,node_organizer_bot,node_bot_delivery toneBlue
class node_event_service,node_registration_service,node_attendance_service,node_qr_service,node_notification_service,node_ai_service,node_repositories toneAmber
class node_web_ui,node_web_api_client,node_admin_api,node_auth_service toneMint
class node_postgres,node_scheduler,node_gigachat toneRose
class node_attendee,node_organizer,node_max toneIndigo
```

## Components

### MAX bot

- [Update ingress](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/transport/longpoll/longpoll.go): `internal/transport/longpoll/longpoll.go`
- [Webhook ingress](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/transport/webhook/server.go): `internal/transport/webhook/server.go`
- [Bot dispatcher](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/dispatcher.go): `internal/bot/dispatcher.go`
- [Bot routing](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers.go): `internal/bot/handlers.go`
- [Registration dialogue](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers/registration.go): `internal/bot/handlers/registration.go`
- [Event discovery](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers/events.go): `internal/bot/handlers/events.go`
- [My registration](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers/my_registration.go): `internal/bot/handlers/my_registration.go`
- [Organizer bot tools](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/bot/handlers/organizer.go): `internal/bot/handlers/organizer.go`
- [MAX messaging](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/external/maxclient/client.go): `internal/external/maxclient/client.go`

### Event services

- [Event management](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/event.go): `internal/service/event.go`
- [Registration lifecycle](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/registration.go): `internal/service/registration.go`
- [Check-in](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/attendance.go): `internal/service/attendance.go`
- [QR invitations](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/qr.go): `internal/service/qr.go`
- [Notifications](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/notification.go): `internal/service/notification.go`
- [AI features](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/ai.go): `internal/service/ai.go`
- [Persistence layer](https://github.com/zhaba1337228/max-university-event-bot/tree/main/internal/repo): `internal/repo`

### Admin console

- [Web admin](https://github.com/zhaba1337228/max-university-event-bot/tree/main/web/app/(authenticated)): `web/app/(authenticated)`
- [Web API client](https://github.com/zhaba1337228/max-university-event-bot/blob/main/web/lib/api.ts): `web/lib/api.ts`
- [Admin REST API](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/transport/adminapi/server.go): `internal/transport/adminapi/server.go`
- [Admin authentication](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/service/auth.go): `internal/service/auth.go`

### Runtime and integrations

- **PostgreSQL**
- [Reminder scheduler](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/scheduler/scheduler.go): `internal/scheduler/scheduler.go`
- [GigaChat](https://github.com/zhaba1337228/max-university-event-bot/blob/main/internal/external/gigachat/client.go): `internal/external/gigachat/client.go`

### Other components

- **Attendee**
- **Organizer**
- **MAX platform**

## Connections

- Attendee → MAX platform: sends updates
- MAX platform → Update ingress: delivers updates
- Update ingress → Bot dispatcher: forwards updates
- Webhook ingress → Bot dispatcher: queues updates
- Bot dispatcher → Bot routing: dispatches updates
- Bot routing → Event discovery: routes event actions
- Bot routing → Registration dialogue: routes dialogue
- Bot routing → My registration: routes registration actions
- Bot routing → Organizer bot tools: routes organizer actions
- Event discovery → Event management: lists events
- Registration dialogue → Registration lifecycle: creates registration
- Registration dialogue → QR invitations: requests invitation QR
- My registration → QR invitations: requests QR again
- Registration dialogue → MAX messaging: sends confirmation
- QR invitations → MAX messaging: delivers QR
- Organizer → Web admin: uses console
- Web admin → Web API client: requests admin data
- Web API client → Admin REST API: calls REST API
- Admin REST API → Admin authentication: exchanges magic link
- Admin REST API → Event management: manages events
- Admin REST API → Registration lifecycle: manages registrations
- Admin REST API → Check-in: checks in attendees
- Admin REST API → Notifications: broadcasts messages
- Admin REST API → AI features: requests AI helpers
- Registration lifecycle → Persistence layer: persists registrations
- Event management → Persistence layer: reads and writes events
- Check-in → Persistence layer: records attendance
- Persistence layer → PostgreSQL: reads and writes
- Reminder scheduler → Persistence layer: plans and loads notifications
- Reminder scheduler → Notifications: dispatches reminders
- Notifications → MAX messaging: sends notifications
- MAX messaging → MAX platform: sends messages
- AI features → GigaChat: requests generation
- AI features → Event management: uses event context
- Check-in → Notifications: triggers post-check-in feed
