How rmfatemi/bitvoker works
Project type and purpose
• Type: Full-stack notification system (Python TCP/API server + React web UI).
• Purpose: Ingest arbitrary text messages over TCP, optionally summarize via AI, dispatch notifications to multiple channels, store history in a local database, and provide a real-time web dashboard for configuration and monitoring.
File structure
• bitvoker/: Core Python server modules:
• server.py: TCP listener
• api.py/router.py: HTTP/WS interface for the web UI
• handler.py: Orchestrates message flow
• ai.py: Optional AI summary component
• notifier.py: Channel adapters (Telegram, Discord, Slack, Gotify, etc.)
• database.py: SQLite persistence
• config.py/constants.py/logger.py/notifier.py: Supporting utilities
• data/: Configuration YAML and SQLite database file
• web/: React application (ports 8085):
• public/: static HTML/manifest
• src/: components (Dashboard, Logs, Settings, etc.)
• Dockerfile/entrypoint.sh/Makefile: Build and deployment
• .github/workflows/docker-publish.yml: CI for Docker image
README for additional insights
• Ports: 8084 for TCP/API, 8085 for web UI
• Features: real-time updates (implies WebSockets or Server-Sent Events), dynamic config, multi-channel dispatch, AI integration via Meta’s API
• Deployment: Docker, Compose, or standalone Python
a. Main components
• TCP Ingestor: Listens on port 8084, receives raw messages
• Processing Pipeline:
• Handler: Validates incoming text
• AI Summarizer (optional): Calls Meta AI API
• Router: Determines which notifier channels to use
• Database: SQLite (data/database.db) holds notification history, config, logs
• Notifier Adapters: Modules for Telegram, Discord, Slack, Gotify, etc.
• API/WebSocket Server: Exposes state, config endpoints, and real-time push to clients
• React Web UI: Dashboard, Logs, Settings pages served on port 8085
• External Services:
• Meta AI API (for summarization)
• Messaging platforms (Telegram, Discord, Slack, Gotify)
b. Relationships and interactions
1. Client (e.g., nc or script) → TCP Ingestor
2. Ingestor → Handler → (optional) AI Summarizer → Router
3. Router → Database (persist message + metadata)
4. Router → Notifier Adapters → External Messaging Services
5. Handler/API Server → WebSocket pushes update to React UI
6. React UI ↔ API Server (HTTP) for config changes
7. Config changes → Config module → dynamic reload in Pipeline
c. Architectural patterns / design principles
• Modular pipeline: clear separation of ingest → process → dispatch
• Pluggable adapters: each notifier is its own module
• Dynamic configuration: live reload without restart
• Event-driven updates: push notifications to web client in real time
d. Key technologies
• Python 3.11+, FastAPI-like API (api.py/router.py)
• SQLite for lightweight persistence
• Meta AI for summarization (unauthenticated HTTP calls)
• React (Create React App) for web dashboard
• Docker & Makefile for CI/CD