How sophannlearning-wq/tpmtelev2 works
TPM Master Training Bot manages role-based training workflows through Telegram: users submit requests or Excel files, the bot routes them to training operations, and results are stored or returned as messages and workbooks. The main entry point also loads configuration, initializes the database, imports bootstrap data, and schedules reminders. The graph separates interaction, training operations, and persistence. README capabilities are represented where source excerpts are incomplete; links among unsampled handler details are limited to the registrations shown in app/main.py.
Main entry points: main.py Bot entry and routing · db.py Database sessions · training.py Plan and status logic · reminders.py Reminder service
Components 17
Telegram interaction
- Bot entry and routing
app/main.py - Role menus
app/keyboards/menus.py
Training operations
- Linking and profiles
app/handlers/core.py - Dashboards and plans
app/handlers/core.py - Score updates
app/handlers/core.py - Schedule management
app/handlers/core.py - Attendance uploads
app/handlers/core.py - Follow-up training
app/handlers/core.py - Training reports
app/services/reports.py - Reminder service
app/services/reminders.py - Plan and status logic
app/services/training.py
Data and persistence
- Excel bootstrap import
app/services/importer.py - Database sessions
app/database/db.py - Training records
app/database/models.py
Runtime setup
- Runtime settings
app/config.py
Other components
- Admin, staff, supervisors
- Telegram
Connections 28
- Admin, staff, supervisors → Telegram: send requests
README.md - Telegram → Bot entry and routing: deliver updates
app/main.py - Bot entry and routing → Telegram: poll updates
app/main.py - Bot entry and routing → Runtime settings: loads settings
app/main.py - Bot entry and routing → Database sessions: configures database
app/main.py - Database sessions → Training records: creates tables
app/database/db.py - Bot entry and routing → Excel bootstrap import: imports bootstrap data
app/main.py - Bot entry and routing → Linking and profiles: routes conversations
app/main.py - Bot entry and routing → Dashboards and plans: routes views
app/main.py - Bot entry and routing → Score updates: routes uploads
app/main.py - Bot entry and routing → Schedule management: routes scheduling
app/main.py - Bot entry and routing → Attendance uploads: routes uploads
app/main.py - Bot entry and routing → Follow-up training: routes follow-up
app/main.py - Bot entry and routing → Training reports: routes reports
app/main.py - Bot entry and routing → Reminder service: schedules reminder job
app/main.py - Bot entry and routing → Role menus: uses menus
- Linking and profiles → Database sessions: queries records
app/handlers/core.py - Dashboards and plans → Plan and status logic: calculates plans
app/handlers/core.py - Score updates → Database sessions: stores scores
app/handlers/core.py - Schedule management → Database sessions: updates schedules
app/handlers/core.py - Attendance uploads → Database sessions: stores attendance
app/handlers/core.py - Follow-up training → Training reports: creates workbooks
app/handlers/core.py - Training reports → Plan and status logic: uses plan status
app/services/reports.py - Reminder service → Plan and status logic: checks training status
app/services/reminders.py - Reminder service → Database sessions: reads and records
app/services/reminders.py - Excel bootstrap import → Database sessions: imports records
app/services/importer.py - Plan and status logic → Training records: reads training records
app/services/training.py - Role menus → Admin, staff, supervisors: presents options