How stanislavstarr/compliment_bot works
Compliment Bot lets an author configure a personalized daily message for a recipient, who accepts an invitation and chooses delivery timing. Celery dispatches due schedules, queues deliveries, and delivers AI-generated or fallback messages through Telegram. The graph includes onboarding, feedback, settings, administration, persistence, and AI generation. Relationships are limited to README statements and source-index references; unsampled implementations are represented by their existing directories, and their exact internal wiring is not inferred.
Main entry points: routers Bot routers · delivery.py Message delivery · orders/service.py Order lifecycle · author_onboarding/service.py Author onboarding
Components 24
Telegram experience
- Telegram bot
app/infrastructure/telegram/bot.py - Bot routers
app/infrastructure/telegram/routers
Application workflows
- Author onboarding
app/application/author_onboarding/service.py - Recipient onboarding
app/application/recipient_onboarding/service.py - Invitations
app/application/invites/service.py - Order lifecycle
app/application/orders/service.py - Feedback
app/application/feedback/service.py - User settings
app/application/settings/service.py - Administration
app/application/admin/service.py
Scheduling and delivery
- Schedule dispatch
app/infrastructure/tasks/scheduler.py - Schedule calculator
app/application/scheduling/calculator.py - Message delivery
app/infrastructure/tasks/delivery.py
Message generation
- Generation workflow
app/application/generation/service.py - Prompt builder
app/infrastructure/ai/prompts/builder.py - AI provider
app/infrastructure/ai/base.py
Persistence and integrations
- PostgreSQL data
app/infrastructure/db/models - User repository
app/infrastructure/db/repositories/users.py - Order repository
app/infrastructure/db/repositories/orders.py - Schedule repository
app/infrastructure/db/repositories/schedules.py - Message repository
app/infrastructure/db/repositories/messages.py - Application config
app/config.py
Other components
- Author
- Recipient
- OpenAI
Connections 25
- Author → Telegram bot: uses
README.md - Recipient → Telegram bot: uses
README.md - Telegram bot → Bot routers: dispatches updates
- Bot routers → Author onboarding: handles setup
app/infrastructure/telegram/routers/author/portrait.py - Bot routers → Recipient onboarding: handles setup
- Author onboarding → Invitations: issues invites
app/application/author_onboarding/service.py - Author onboarding → Order lifecycle: configures order
app/application/author_onboarding/service.py - Recipient onboarding → Order lifecycle: accepts invite
app/application/recipient_onboarding/service.py - Bot routers → Feedback: collects feedback
- Bot routers → User settings: updates settings
app/infrastructure/telegram/routers/settings.py - User settings → Order lifecycle: cancels order
app/application/settings/service.py - User settings → Schedule calculator: computes next run
app/application/settings/service.py - Schedule dispatch → Schedule repository: claims due schedules
README.md - Schedule dispatch → Message delivery: queues delivery
README.md - Message delivery → Generation workflow: generates message
app/infrastructure/tasks/delivery.py - Generation workflow → Prompt builder: builds prompt
app/application/generation/service.py - Generation workflow → AI provider: requests generation
app/application/generation/service.py - AI provider → OpenAI: calls API
README.md - Message delivery → Message repository: persists message
README.md - Message delivery → Telegram bot: sends Telegram message
README.md - Author onboarding → User repository: loads user
app/application/author_onboarding/service.py - Order lifecycle → Order repository: loads orders
app/application/orders/service.py - Order lifecycle → Schedule repository: pauses schedule
app/application/orders/service.py - Administration → Message repository: reviews messages
app/application/admin/service.py - Message delivery → Application config: reads settings
app/infrastructure/tasks/delivery.py