Skip to content

This Tracer Bot Can Notify You About Events In Your Public Repositories. You Can Also Reply To Its Messages To Post Comments To GitHub Right From Telegram !!

License

Notifications You must be signed in to change notification settings

i8o8i-Developer/GitTracker_Bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

18 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

GitTracker Bot πŸ€–

A Sophisticated Telegram Bot For Tracking GitHub Repository Events With Real-Time Notifications, Comprehensive Logging, And Production-Grade Deployment Capabilities.

Telegram GitTracker Bot - Real-Time GitHub Notifications Straight To Telegram | Product Hunt Telegram GitTracker Bot - Real-Time GitHub Notifications Straight To Telegram | Product Hunt

Python Flask Telegram MySQL Docker Coolify

✨ Features

  • Real-Time GitHub Tracking: Monitor Push Events, Pull Requests, Issues, and Releases
  • Telegram Notifications: Beautiful, Formatted Messages With Emojis And Developer Branding
  • Webhook Security: HMAC Signature Verification For GitHub Webhooks
  • Database Integration: MySQL With Connection Pooling For Reliable Data Storage
  • Comprehensive Logging: Structured Logging With File Rotation and Multiple Log Levels
  • Health Monitoring: Built-In Health Checks and Monitoring Endpoints
  • Docker Support: Containerized Deployment With Multi-Stage Builds
  • Coolify Deployment: One-Click Deployment With Coolify Platform
  • Environment Configuration: Secure Configuration Management Via Environment Variables
  • Error Handling: Robust Error Handling With Graceful Degradation

πŸš€ Quick Start

Prerequisites

  • Python 3.11+
  • MySQL 8.0+
  • Telegram Bot Token (From @BotFather)
  • GitHub OAuth App Credentials

Local Development

  1. Clone The Repository

    git clone https://github.com/i8o8i-Developer/GitTracker_Bot.git
    cd GitTracker_Bot
  2. Create Environment File

    cp .env.example .env
    # Edit .env with your configuration
  3. Install Dependencies

    pip install -r Requirements.txt
  4. Setup Database

    mysql -u root -p < Database.sql
  5. Run The Bot

    python Bot.py

🐳 Docker Deployment

Build And Run With Docker Compose

# Build The Image
docker build -t gittracker-bot .

# Run With Docker Compose (If You Have docker-compose.yml)
docker-compose up -d

Coolify Deployment

  1. Connect Your Repository To Coolify
  2. Use The Provided coolify.yaml Configuration
  3. Set Environment Variables In Coolify Dashboard
  4. Deploy!

βš™οΈ Configuration

Environment Variables

Variable Description Required Default
TELEGRAM_TOKEN Telegram Bot Token From BotFather βœ… -
DB_HOST MySQL Database Host ❌ 127.0.0.1
DB_PORT MySQL Database Port ❌ 3306
DB_NAME MySQL Database Name ❌ Tracer_Bot
DB_USER MySQL Database User ❌ root
DB_PASSWORD MySQL Database Password ❌ ""
GITHUB_CLIENT_ID GitHub OAuth App Client ID βœ… -
GITHUB_CLIENT_SECRET GitHub OAuth App Client Secret βœ… -
GITHUB_WEBHOOK_SECRET GitHub Webhook Secret For Signature Verification ❌ -
WEBHOOK_URL Public URL For Webhooks βœ… -
SERVER_HOST Server Bind Host ❌ 0.0.0.0
SERVER_PORT Server Bind Port ❌ 5000
DEBUG Enable Debug Mode ❌ false
LOG_LEVEL Logging Level (DEBUG, INFO, WARNING, ERROR) ❌ INFO

Database Schema

The Bot Uses The Following Main Tables:

  • Users: Telegram User Information
  • Repositories: Tracked GitHub Repositories
  • Events: GitHub Webhook Events Log

πŸ“± Usage

Telegram Commands

  • /start - Initialize The Bot And Get Welcome Message
  • /help - Show Available Commands
  • /track <repo> - Start Tracking A GitHub Repository
  • /untrack <repo> - Stop Tracking A Repository
  • /list - List All Tracked Repositories
  • /status - Show Bot Status and Statistics

Webhook Integration

Set Up GitHub Webhooks For Your Repositories:

  1. Go To Repository Settings β†’ Webhooks
  2. Add Webhook URL: https://your-domain.com/webhook
  3. Content Type: application/json
  4. Secret: Your Webhook Secret
  5. Events: Push, Pull Request, Issues, Releases

πŸ—οΈ Project Structure

GitTracker_Bot/
β”œβ”€β”€ Bot.py                 # Main Application File
β”œβ”€β”€ Config.py              # Configuration Management
β”œβ”€β”€ DataBase.py            # Database Operations
β”œβ”€β”€ Logging_Config.py      # Logging Configuration
β”œβ”€β”€ Requirements.txt       # Python Dependencies
β”œβ”€β”€ Database.sql           # Database Schema
β”œβ”€β”€ Dockerfile             # Docker Configuration
β”œβ”€β”€ .env.example           # Environment Variables Template
β”œβ”€β”€ README.md              # Project Documentation
└── Logs/                  # Application Logs (Created At Runtime)

πŸ”§ Development

Code Quality

  • Type Hints: Full Type Annotation Support
  • Error Handling: Comprehensive Exception Handling
  • Logging: Structured Logging With Multiple Levels
  • Security: Input Validation And Secure Practices

Testing

# Run Tests (When Implemented)
python -m pytest tests/

# Check Code Quality
python -m flake8
python -m mypy

Contributing

  1. Fork The Repository
  2. Create A Feature Branch (git checkout -b feature/amazing-feature)
  3. Commit Your Changes (git commit -m 'Add Amazing Feature')
  4. Push To The Branch (git push origin feature/amazing-feature)
  5. Open A Pull Request

πŸ“Š Monitoring

Health Checks

The Application Provides Health Check Endpoints:

  • GET /health - General Health Status
  • GET /health/db - Database Connectivity Check
  • GET /health/telegram - Telegram Bot Connectivity Check

Logs

Logs Are Written To:

  • Console (For Development)
  • logs/bot.log (Rotating File Logs)
  • Structured JSON Format For Production Monitoring

πŸš€ Deployment Options

Coolify (Recommended)

  1. Import Your Repository Into Coolify
  2. Use The Provided coolify.yaml Configuration
  3. Configure Environment Variables
  4. Deploy With One Click

Docker

# Build Image
docker build -t gittracker-bot .

# Run Container
docker run -d \
  --name gittracker-bot \
  -p 5000:5000 \
  -e TELEGRAM_TOKEN=your_token \
  -e DB_HOST=your_db_host \
  gittracker-bot

Manual Deployment

  1. Set Up MySQL Database
  2. Configure Environment Variables
  3. Install Dependencies: pip install -r Requirements.txt
  4. Run: python Bot.py

πŸ›‘οΈ Security

  • Webhook Verification: HMAC Signature Validation
  • Input Sanitization: All User Inputs Are Validated
  • Secure Configuration: Sensitive Data Via Environment Variables
  • Database Security: Prepared Statements And Connection Pooling
  • Logging Security: No Sensitive Data In Logs

πŸ“„ License

This Project Is Licensed Under The MIT License - See The LICENSE File For Details.

πŸ‘¨β€πŸ’» Developer

I8O8I DEVELOPER


Made With ❀️ By I8O8I DEVELOPER

Now You Can Do Your Edits And Changes In New Branch Named Developement

About

This Tracer Bot Can Notify You About Events In Your Public Repositories. You Can Also Reply To Its Messages To Post Comments To GitHub Right From Telegram !!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published