How yuldashevsardor/telegram-bot works
This is a Telegram bot that accepts font-conversion requests and returns fonts converted among TTF, OTF, WOFF, WOFF2, EOT, and SVG; FontForge performs conversion, while PostgreSQL stores users and sessions. The runtime path is represented from Telegram interaction through bot commands, validation, and conversion, with the outbox handling outbound delivery. Application bootstrap and persistence are separate internal layers. Several runtime modules were not sampled, so inferred links are dashed; documented product capabilities are retained without claiming their unsampled implementation details were inspected.
Main entry points: bot.ts Bot runtime · application.ts Application lifecycle · command Bot commands · outbox-message-processor.ts Outbox processor
Components 24
Telegram interaction
- Bot runtime
src/telegram/bot/bot.ts - Bot commands
src/telegram/command - Start conversation
src/telegram/conversation/start/start.conversation.ts - Request middleware
src/telegram/middleware
Font conversion
- Validator resolver
src/font-convertor/validator/font-validator-resolver.ts - Format validators
src/font-convertor/validator - Conversion service
src/font-convertor/font-convertor.ts - Converter factory
src/font-convertor/convertor/convertor-factory.ts - Format converters
src/font-convertor/convertor - FontForge
src/font-convertor/font-forge/font-forge.ts
Outbound delivery
- Outbox sender
src/telegram/outbox/outbox-sender.ts - Outbox processor
src/telegram/outbox/outbox-message-processor.ts - Failure handling
src/telegram/outbox/outbox-failure-handler.ts - Outbox store
src/telegram/outbox/store/outbox-store.ts - Task queue
src/telegram/outbound-queue/task-queue.ts
Persistence
- User service
src/telegram/user/service/user-service.ts - User repository
src/telegram/user/pgsql-repository/pgsql-user-repository.ts - Session storage
src/telegram/session/pgsql-storage.ts - PostgreSQL
src/platform/database/database.ts
Application platform
- Application lifecycle
src/bootstrap/application/application.ts - Configuration
src/bootstrap/config/container/config-container.ts - Process entrypoint
src/app.ts
Other components
- Telegram user
- Telegram API
Connections 26
- Telegram user → Telegram API: sends request
- Telegram API → Bot runtime: delivers updates
- Bot runtime → Bot commands: dispatches
- Bot runtime → Request middleware: runs through
- Bot runtime → Start conversation: routes conversation
- Bot commands → Validator resolver: validates input
- Validator resolver → Format validators: selects validator
- Bot commands → Conversion service: requests conversion
- Conversion service → Converter factory: creates converter
- Converter factory → Format converters: selects conversion
- Format converters → FontForge: delegates conversion
- Bot commands → Outbox sender: queues response
- Outbox sender → Outbox processor: dispatches message
- Outbox processor → Outbox store: reads and updates
- Outbox processor → Failure handling: handles failures
- Outbox processor → Telegram API: sends message
- Bot runtime → User service: updates user
- User service → User repository: uses repository
- User repository → PostgreSQL: queries users
src/telegram/user/pgsql-repository/pgsql-user-repository.ts - Bot runtime → Session storage: persists sessions
- Session storage → PostgreSQL: queries sessions
src/telegram/session/pgsql-storage.ts - Process entrypoint → Application lifecycle: bootstraps
src/app.ts - Application lifecycle → PostgreSQL: checks connection
src/bootstrap/application/application.ts - Application lifecycle → Task queue: drains queue
src/bootstrap/application/application.ts - Application lifecycle → Bot runtime: sets up and stops
src/bootstrap/application/application.ts - Application lifecycle → Configuration: assembles settings