How f1lrotto/igorbot works
Main Components
A. Discord Integration Layer
• Discord Bot Service (src/services/discordBot.js)
• Discord Webhook Service (src/services/discordWebhook.js)
• Command Handler System (src/commands/*)
B. Data Layer
• MongoDB Database
• Multiple MongoDB Models:
• Server Configuration
• Articles
• Formula
• Morning News
• Train Information
• User Data
C. Controller Layer
• Main Controller
• Formula Controller
• Morning Report Controller
• News Controller
• News Feed Controller
• Train Controller
D. Services Layer
• Message Distributor
• News Scraper (SME Scraper)
• Command Deployment Service
E. View Layer
• Handlebars Templates
Component Relationships
• Discord Bot → Command Handler → Controllers
• Controllers ↔ MongoDB Models
• News Scraper → News Controller → MongoDB
• Message Distributor → Discord Webhook
• Controllers → View Layer (Handlebars)
┌─ External Services ─┐ ┌─ Application Core ─┐ ┌─ Data Layer ─┐
• Discord │ │ - Controllers │ │ - MongoDB │
• News Sources │ → │ - Services │ → │ - Models │
• ┘ └──────────────────┘ └─────────────┘
Data Flow Indicators
Key flows:
• News Scraping Flow: News Source → Scraper → Controller → Database
• Command Processing Flow: Discord → Bot → Command Handler → Controller → Database
• Morning Report Flow: Database → Controller → Message Distributor → Discord Webhook
Additional Elements
Components in a separate section:
• Configuration Management
• Command Deployment Process
• Template Rendering System
Key Recommendations: