1.6 KiB
1.6 KiB
Contributing to DB Monitor
Thank you for your interest in contributing to DB Monitor!
Development Setup
Prerequisites
- Go 1.21+
- Docker & Docker Compose
- A PostgreSQL instance for testing
Local Development
# Clone
git clone https://github.com/mahmoud/db-monitor.git
cd db-monitor
# Set up environment
cp .env.example .env
# Edit .env with your test PostgreSQL connection
# Run locally
go run .
# Or with Docker
docker compose up --build
Project Structure
├── main.go # Entry point
├── config/ # Configuration
├── collector/ # PostgreSQL metrics collection
├── storage/ # SQLite time-series storage
├── api/ # REST API handlers
├── alert/ # Alert engine
└── web/ # Web dashboard (HTML/CSS/JS)
How to Contribute
- Fork the repository
- Create a feature branch:
git checkout -b feature/my-feature - Make your changes
- Test with
docker compose up --build - Commit:
git commit -m "feat: add my feature" - Push:
git push origin feature/my-feature - Open a Pull Request
Code Style
- Follow standard Go conventions (
gofmt,golint) - Keep functions focused and well-documented
- Web UI changes should maintain the existing design language
Ideas for Contributions
- MySQL / Redis / MongoDB collectors
- Additional alerting channels (Slack, Discord, webhook)
- Authentication / multi-user support
- Custom dashboard layouts
- Data export (CSV, JSON)
License
By contributing, you agree that your contributions will be licensed under the MIT License.