This repository implements a comprehensive Telegram bot for managing VPN subscriptions via Remnawave panel integration, featuring a web-based admin cabinet (cabinet) and public API (webapi). The system handles user subscriptions, payments (20+ gateways), referrals, promotional systems, contests, news, and support tickets. Architected with modular layers: Telegram bot handlers (aiogram), cabinet/web API routes (FastAPI), service-layer business logic, and SQLAlchemy ORM with Alembic migrations. Key entry points include main.py (application bootstrap), bot.py (Telegram setup), and unified_app.py (combined web server). Data flows involve Telegram interactions β handler processing β service execution β database CRUD operations, with webhook handlers for payment gateway callbacks and panel synchronization. External dependencies include Telegram Bot API, Remnawave API, PostgreSQL, Redis, SMTP, and numerous payment processors (Yookassa, CryptoBot, etc.). The codebase demonstrates strong engineering practices: clean separation of concerns, dependency injection, structured logging (structlog), and reusable patterns like event emitters, caching utilities, and retry queues. Payment processing abstraction shows particular skill with uniform CRUD interfaces across gateways. Active maintenance is evident through frequent releases, Dependabot integration, and responsive issue triage. While complexity arises from extensive feature set and payment integrations, the modular design contains coupling effectively. Technical drift is low due to current Python version (3.13), updated dependencies, and proactive schema migrations.
Universal Notifier is a Home Assistant custom integration that acts as a centralized notification router. It exposes a single `universal_notifier.send` service that fans out messages to multiple channelsβtext (Telegram, mobile app) and voice (Alexa, Google Home via TTS)βwith context-aware features: time-of-day greetings, per-slot volume control, weekday/weekend Do Not Disturb schedules, priority bypass, and a FIFO async queue for serialized voice announcements. The integration also provides monitoring entities (volume sensor, family presence sensor, DND binary sensor) and runtime controls (priority volume select, text format select, voice buffer number, DND override switch, last-message text). Configuration is fully UI-driven via a multi-step config flow and an options menu for post-setup edits. Architecturally, the component is a typical Home Assistant custom component with modular entity platforms (sensor, binary_sensor, select, number, switch, text) and a core `__init__.py` that registers the service, manages the voice queue worker, and handles snapshot/resume of media players. The code is well-organized, uses standard HA patterns (config entries, entity registry, service registrations), and includes a solid test suite with high coverage. The main service handler is long and somewhat monolithic, but it is subdivided into labeled sections and handles many edge cases (e.g., `notify.send_message` target kwargs, Telegram chat IDs, MarkdownV2 escaping, SSML preservation for TTS). The utils module contains genuinely reusable text-processing and time-slot helper functions. Dependencies are minimal (only HA core), and the project uses `uv` for Python management and CI with GitHub Actions (tests, HACS validation, hassfest). It targets Python 3.13+ and requires HA 2025.12.1 or newer, indicating an up-to-date stack. External integrations like Telegram, Alexa Media Player, or TTS must be installed separately; this component merely routes to them. The repository is actively maintained with frequent releases and a changelog, and it supports multiple languages (READMEs and translations).