How drotyk/btwseptember works
BTW is a Telegram registration bot paired with a protected admin panel. The main participant workflow is private-chat registration: collect and validate participant details, training selections, and consent; persist the completed form and resumable session in PostgreSQL. Administrators authenticate to manage registrations, speakers, and scheduled notifications, while a worker delivers notifications through Telegram. README capabilities provide the broad subsystem map; sampled source confirms startup, session storage, authentication, speaker services, and notification delivery, but not every handler-to-service route.
Main entry points: handlers Bot handlers · web.ts HTTP panel and APIs · main.ts Application startup · create-bot.ts Bot setup
Components 24
Registration bot
- Bot setup
src/bot/create-bot.ts - Bot handlers
src/bot/handlers - Registration state
src/bot/registration-state.ts - Registration rules
src/services/registration.service.ts - Training form
src/form.ts - Rules and consent
src/services/rules.service.ts
Admin panel
- HTTP panel and APIs
src/web.ts - Admin authentication
src/web/auth.ts - Admin interface
public/app.js
Speakers and messaging
- Speaker management
src/services/speaker.service.ts - Speaker carousel
src/services/telegram-speaker.service.ts - Notification worker
src/workers/notification.worker.ts
Persistence and runtime
- Application startup
src/main.ts - Participant records
src/repositories/users.repository.ts - Bot sessions
src/repositories/sessions.repository.ts - Admin sessions
src/repositories/admin-sessions.repository.ts - Speaker records
src/repositories/speakers.repository.ts - Notification records
src/repositories/notifications.repository.ts - Schema migrations
src/migrations.ts
Other components
- Participant
- Telegram API
- Administrator
- Admin browser
- PostgreSQL
Connections 31
- Participant → Telegram API: sends updates
- Telegram API → Bot setup: delivers updates
- Application startup → Bot setup: creates bot
- Bot setup → Bot handlers: dispatches updates
- Bot handlers → Registration state: advances steps
- Bot handlers → Registration rules: submits registration
- Registration rules → Training form: checks training IDs
- Bot handlers → Rules and consent: handles rules
- Registration rules → Participant records: saves participant
- Bot setup → Bot sessions: stores resumable state
- Administrator → Admin browser: uses panel
- Admin browser → HTTP panel and APIs: calls panel APIs
- HTTP panel and APIs → Admin authentication: checks access
- Admin authentication → Admin sessions: validates sessions
- HTTP panel and APIs → Participant records: serves registration data
- HTTP panel and APIs → Speaker management: manages speakers
- Speaker management → Speaker records: reads and writes
- Bot handlers → Speaker carousel: handles speaker actions
- Speaker carousel → Speaker records: loads active speakers
- Speaker carousel → Telegram API: sends carousel
- HTTP panel and APIs → Notification records: manages notifications
- Application startup → Notification worker: starts worker
- Notification worker → Notification records: claims and updates deliveries
- Notification worker → Telegram API: sends messages
- Application startup → Schema migrations: runs migrations
- Application startup → PostgreSQL: creates database pool
- Participant records → PostgreSQL: queries records
- Bot sessions → PostgreSQL: queries sessions
- Admin sessions → PostgreSQL: queries sessions
- Speaker records → PostgreSQL: queries speakers
- Notification records → PostgreSQL: queries deliveries