How sid3612/vibe works
Project Type and Purpose
• This is a backend-only, monolithic Telegram bot (“Job Funnel Coach”) written in Python.
• Purpose: track job application funnels (active/passive), compute CVR metrics, store data locally (SQLite), send reminders, export CSVs, and serve an FAQ.
Main Components
a. Telegram Interface Layer
• main.py – Bot startup, polling or webhook setup
• keyboards.py – Inline keyboard definitions
• reflection_forms.py, reminder handlers, callback handlers
b. Business-Logic Layer
• cvr_analyzer.py / cvr_autoanalyzer.py – compute CVR metrics
• funnel_coach workflows (hypotheses_manager.py, metrics.py)
• reminders.py – scheduling and sending reminders
• faq.py – FAQ content
• export.py – CSV export functionality
c. Data-Access Layer
• db.py – SQLite wrapper, ORM or raw queries
• funnel_coach.db – local SQLite database
• validators.py – input validation before DB writes
d. Configuration & Environment
• config.py – reads BOT_TOKEN, can read .env
• pyproject.toml – dependency listing
e. Testing & Debugging
• test_*.py files – unit & integration tests
• simple_debug.py, debug_*.py – ad-hoc debugging scripts
Relationships & Data Flow
• Telegram User <–> Telegram Bot API (HTTPS)
• Bot API calls → main.py → dispatch to handlers (reflection_handlers.py, reminders.py, etc.)
• Handlers invoke Business Logic modules (cvr_analyzer, metrics)
• Business Logic reads/writes from/to Data Access Layer (db.py → SQLite)
• Export module reads DB, writes CSV to file system or sends it back via Telegram API
• Reminders module may rely on an internal scheduler or external cron → triggers Telegram API calls
• Tests exercise Business Logic and Data Access in isolation or end-to-end via a fake Telegram API
Architectural Patterns & Design Principles
• Layered architecture (Interface → Business Logic → Data Access)
• Single responsibility: each module has a clear domain (analyzer, export, reminders)
• Synchronous polling/webhook pattern for Telegram
• Local persistence (no external DB or microservices)