How luuccaaaa/gittrack-discord-bot works
Project type and purpose
• GitTrack is an open-source backend service (a Discord bot) that listens for GitHub webhooks, processes events, and sends notifications to Discord servers via slash commands and real-time messages. It is not a traditional “full-stack” web app with a user GUI, but rather a message-oriented integration service.
File structure
• Top-level folders:
• config/ – configuration files (e.g., nodemon settings)
• docker/ – Dockerfiles and Compose files for dev and prod
• docs/ – contributing docs and internal design notes
• prisma/ – database schema definition and migrations
• scripts/ – deployment scripts (deploy.sh, deploy-prod.sh)
• src/
– bot.js: initializes the Discord.js client and registers slash commands
– index.js: application entry point, sets up the HTTP server and webhook route
– commands/: handlers for each Discord slash command (setup, link, unlink, status, etc.)
– handlers/: GitHub webhook event processors (checks, PR, milestone, workflow, generic)
– functions/: reusable utilities (branch matching, limit checking, permission checking)
• Configuration files (.env.example, docker-compose, Prisma schema) control environment variables, database connections, and deployment settings.
README for additional insights
• The “🏗️ Architecture” section already outlines major modules: Discord Bot, Webhook Handler, Limit Checker, Database Layer (Prisma + PostgreSQL).
• Tech stack: Node.js 18+, Discord.js 14, Prisma ORM, PostgreSQL, Docker.
Detail without overthinking
• Environment/configuration as side notes (ENV vars, Docker Compose).