How alexey-goloburdin/telegram-finance-bot works
Main Components
• Telegram API Integration: Shows how incoming messages from Telegram are filtered by the provided TELEGRAM_ACCESS_ID and processed using the provided TELEGRAM_API_TOKEN. Also, include the proxy settings (TELEGRAM_PROXY_URL, TELEGRAM_PROXY_LOGIN, TELEGRAM_PROXY_PASSWORD) because they affect outbound connections.
• Server and Bot Engine (server.py): This is the central module that starts up the bot, handles incoming requests, and delegates work.
• Middlewares (middlewares.py): Represent the layers that intercept and process messages before they reach the business logic.
• Expense Management & Category Handling: Include components such as expenses.py and categories.py that encapsulate the core financial tracking logic.
• Database Module (db.py and createdb.sql): Illustrate the interactions with the SQLite database (e.g., reading, writing, initializing via SQL scripts) stored in the “db/” folder.
Relationships and Interactions
• Database Access: Link the business logic modules (expenses, categories) to the database module to indicate CRUD operations with the SQLite database.
• Error Handling Path: Optionally show a pathway to the exceptions module wherever errors might be raised during processing.
• Deployment: Overlay a container layer that encapsulates all the above on a Docker container. Indicate that the container uses volume mounts so that the database (“db/finance.db”) persists data outside the container.
Architectural Patterns and Technologies
• Docker Containerization: Emphasize that the entire application runs inside a Docker container as configured in the Dockerfile.
• Use of Environment Variables: Note that critical configuration (API tokens, proxy credentials) are injected via environment variables, which govern the behavior of the Telegram bot.
• SQLite as a local datastore: Make sure the persistence mechanism (SQLite DB) is visually distinct as a file-based database.