The Database Change Bot is an innovative application designed to monitor changes in MongoDB and PostgreSQL databases and notify these changes through Telegram messages. This bot makes it easier to keep track of database modifications in real-time, enhancing monitoring and response strategies for database administrators and development teams. π
- Database Monitoring: Listen to changes (inserts, updates, deletions) in MongoDB and PostgreSQL databases. π
- Telegram Notifications: Sends customized notifications to a Telegram group or channel to alert about the database changes. π¬
- Configurable: Easily configure database connections and Telegram group IDs through a simple JSON configuration. βοΈ
- Docker Support: Comes with Docker support for easy deployment and scalability. π³
- Node.js π¦
- MongoDB and/or PostgreSQL ποΈ
- A Telegram bot token (create one through BotFather in Telegram) π€
- Clone the repository:
git clone https://github.com/dongtranthien/database-change-bot.git- Install the dependencies:
cd database-change-bot
npm install-
Copy the
.env.sampleandconfig.json.samplefiles to.envandconfig.jsonrespectively and update them with your actual configuration details. -
Start the bot:
node app.js
Build and run the Docker container using:
docker build -t database-change-bot .
docker run -d --name database-change-bot --env-file .env database-change-bot
Edit config.json to include your database connection details and Telegram group ID. Refer to config.json.sample for the sample configuration.
TELEGRAM_GROUP_ID: Your Telegram group or channel ID where notifications will be sent. π¨
Once the bot is running, it will start monitoring the specified databases for changes and send notifications to the configured Telegram group or channel.
Contributions are welcome! Please feel free to submit a pull request.
This project is licensed under the MIT License - see the LICENSE.md file for details.