How digitaljacob/booking_bot works
Booking Bot is a Telegram appointment-booking product for clients and small-business masters. Clients provide a consented profile, choose a service and an available time, then receive status updates and reminders; masters manage bookings, services, and schedules. Telegram handlers coordinate domain booking and availability rules with database repositories, while background reminder logic sends notifications. The README documents the Redis-backed FSM and schedule modes; sampled source confirms selected booking, notification, navigation, and repository relationships, but not every handler’s internal calls.
Main entry points: hub.py Hub navigation · booking.py Booking rules · repositories Repositories · reminders.py Reminder runner
Components 23
Telegram experience
- Bot runtime
app/bot/bot.py - Hub navigation
app/bot/handlers/common/hub.py - Sticky hub
app/bot/utils/hub_nav.py - Client booking
app/bot/handlers/client/booking.py - Client profile
app/bot/handlers/client/profile.py - Service catalog
app/bot/handlers/client/catalog.py - My bookings
app/bot/handlers/client/my_bookings.py - Master bookings
app/bot/handlers/master/bookings.py - Service management
app/bot/handlers/master/services.py - Schedule controls
app/bot/handlers/master - Dialog states
app/bot/states/states.py - User administration
app/bot/handlers/admin/users.py - Redis FSM store
Booking domain
- Booking rules
app/domain/services/booking.py - Availability rules
app/domain/services/availability.py - Domain models
app/domain/models
Persistence
- Repositories
app/infrastructure/database/repositories - PostgreSQL
app/infrastructure/database/connection.py - Update middleware
app/bot/middlewares/database.py
Reminders and operations
- Reminder timing
app/domain/services/reminders.py - Reminder runner
app/bot/reminders.py - Telegram notifications
app/bot/utils/notify.py
Other components
- Telegram users
Connections 26
- Telegram users → Bot runtime: sends updates
- Bot runtime → Hub navigation: routes updates
- Hub navigation → Sticky hub: refreshes hub
app/bot/handlers/master/services.py - Hub navigation → Client booking: opens booking
- Hub navigation → Client profile: opens profile
- Hub navigation → Service catalog: opens catalog
- Hub navigation → My bookings: opens bookings
- Hub navigation → Master bookings: opens bookings
app/bot/handlers/master/bookings.py - Hub navigation → Service management: opens services
app/bot/handlers/master/services.py - Hub navigation → Schedule controls: opens schedule
app/bot/handlers/master/services.py - Hub navigation → User administration: opens admin
- Client booking → Booking rules: requests booking
app/bot/handlers/client/booking.py - Client booking → Dialog states: tracks dialog
app/bot/handlers/client/booking.py - Booking rules → Availability rules: queries windows
app/domain/services/booking.py - Booking rules → Repositories: reads and writes
app/domain/services/booking.py - Booking rules → Domain models: uses models
app/domain/services/booking.py - Master bookings → Booking rules: changes status
app/bot/handlers/master/bookings.py - Master bookings → Telegram notifications: sends updates
app/bot/handlers/master/bookings.py - Service management → Repositories: manages services
app/bot/handlers/master/services.py - Update middleware → Repositories: provides repositories
app/bot/middlewares/database.py - Repositories → PostgreSQL: queries database
- Reminder runner → Reminder timing: checks due reminders
app/bot/reminders.py - Reminder runner → Repositories: loads appointments
app/bot/reminders.py - Reminder runner → Telegram notifications: sends reminders
app/bot/reminders.py - Telegram notifications → Telegram users: sends messages
app/bot/utils/notify.py - Bot runtime → Redis FSM store: stores FSM state