๐ค Dynamic Notification System Documentation
๐ Overview
The Dynamic Notification System is a platform designed for managing โฐ jobs and sending ๐ง via multiple ๐ก. It supports:
- ๐ฅ Dynamic ๐ for various ๐ฌ methods.
- Managing โฐ jobs through a โฑ๏ธ-based scheduler.
- ๐ APIs for creating and managing jobs.
โญ Features
- ๐ Multi-platform Support: Send notifications via ๐ง, Slack, SMS, and Webhooks.
- ๐ Dynamic Plugin System: Load ๐ฌ ๐ dynamically based on the โ๏ธ.
- ๐๏ธ Database Integration: Store โฐ jobs and their execution ๐ in a ๐ฌ database.
- โฑ๏ธ Scheduler: Manage job โฐ and ensure timely execution.
- ๐ API:
- โ๏ธ Create new jobs.
- ๐ Retrieve existing jobs.
- โ ๏ธ Error Handling: Gracefully handle ๐จ and ๐ issues.
๐๏ธ Architecture
๐งฉ Components
-
โ๏ธ Configuration Loader:
- ๐ ๏ธ Reads settings from a ๐๏ธ YAML โ๏ธ file.
- Configures ๐ฌ, ๐, and ๐ฅ๏ธ behavior.
-
๐๏ธ Database:
- ๐ ๏ธ Stores job metadata, including โฐ expressions, ๐ฌ details, and execution ๐.
-
๐ Plugins:
- Dynamically loaded ๐ฌ ๐ to send ๐จ through different ๐ก (e.g., ๐ง, ๐ฉ, ๐ฌ).
-
โฑ๏ธ Scheduler:
- Based on the
cron๐ ๏ธ. - Executes โฐ jobs at specified ๐.
- Based on the
-
๐ API:
- Built with
Gorilla Muxfor ๐ฃ๏ธ. - Provides ๐ for job management.
- Built with
๐ ๏ธ Setup and Installation
๐งพ Prerequisites
- ๐น Go (version 1.23+)
- ๐ฌ MySQL database (docker compose includes one)
- ๐๏ธ YAML โ๏ธ file
๐ฆ Installation Steps
- Clone the repository:
- Build the application:
- Configure the application:
- Create a
config.yamlfile:
scheduler: true database: host: localhost port: 3306 user: root password: password name: notifications channels: email: enabled: true smtp_server: "smtp.example.com" smtp_port: 587 username: "your-email@example.com" password: "your-password" sms: enabled: false provider_api: "https://sms-provider.com/api" api_key: "your-sms-api-key" ๐ Table of Contents
- Getting Started
- Usage
- Developer Guide
- Main Module
- Scheduler Module
- Notifier Module
- Config Module
- Contributing
๐ API Endpoints
๐ค POST /jobs
- ๐ Description: Create a new scheduled job.
- ๐ Request Body:
- ๐ฌ Response:
๐ GET /jobs
- ๐ Description: Retrieve all scheduled jobs.
- ๐ฌ Response:
๐ ๏ธ Development
๐ Libraries Used
github.com/gorilla/mux: For API routing.github.com/robfig/cron/v3: For job scheduling.github.com/go-sql-driver/mysql: For MySQL database integration.
๐ Future Enhancements
- Support for additional channels (e.g., WhatsApp, Telegram).
- Role-based access control (RBAC) for APIs.
- Enhanced logging and monitoring tools.