Thank you for your interest in contributing to PulseCheck! This guide will help you understand the project structure and development workflow.
PulseCheck is a distributed service health monitoring system built in Go. It uses a worker-pool architecture to monitor multiple HTTP services concurrently, demonstrating Go's concurrency model with goroutines and channels.
- Worker Pool Pattern: Producer-consumer pattern with buffered channels for URLs and a fixed number of workers
- Concurrent URL Checking: Goroutines to visit multiple URLs simultaneously
- Channel Communication: Channels distribute work to workers and collect results
- Database Integration: SQLite for persistent storage of URLs and check results
- Notification System: Interface-based system supporting Slack, Discord, and Email
- REST API: HTTP API for programmatic access
- Scheduler: Time-based scheduling for periodic URL checks
cmd/
├── pulsecheck/ # CLI application
│ ├── main.go
│ └── cli/ # CLI commands
└── pulsecheck-server/ # REST API server
└── main.go
internal/
├── api/ # REST API endpoints
├── checker/ # Worker pool & URL checking
├── config/ # Configuration management
├── database/ # SQLite operations
├── notifier/ # Notification system
├── scheduler/ # Check scheduling
└── urlmanager/ # Data structures
- Go 1.25 or higher
- Git
# Clone the repository
git clone https://github.com/gyaan/pulse-check.git
cd pulse-check
# Install dependencies
go mod download
# Build the project
make build
# Run tests
make test# Build both binaries
make build
# Run tests
make test
# Clean build artifacts
make clean
# Run the CLI
./pulsecheck-cli --help
# Run the server
./pulsecheck-server-api- Follow standard Go conventions (use
gofmtandgo vet) - Write clear, descriptive commit messages
- Add tests for new functionality
- Update documentation as needed
All new features should include tests:
# Run all tests
go test ./...
# Run tests with coverage
go test -cover ./...
# Run tests for specific package
go test ./internal/checker -v- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make your changes
- Run tests:
make test - Commit your changes:
git commit -m "Add: description of changes" - Push to your fork:
git push origin feature/your-feature - Submit a Pull Request
The system uses:
- Buffered channels for work distribution
- WaitGroups for synchronization
- Goroutines for concurrent execution
- Context for cancellation
SQLite integration:
- Pure Go driver (no CGO required)
- WAL mode for better concurrency
- Transaction support for atomic operations
- Prepared queries for security
The configuration system supports:
- YAML files
- Environment variables
- Command-line flags
- Sensible defaults
Priority: Flags > Environment > Config File > Defaults
- Use a single database connection with proper locking
- Wrap related operations in transactions
- Enable WAL mode for concurrent reads/writes
- Plan for backward-compatible schema changes
- Always ensure proper cleanup of goroutines
- Use
deferfor resource cleanup - Implement graceful shutdown handling
- Track goroutines with WaitGroups
- Reuse buffers and limit channel sizes appropriately
- Monitor resource usage
- Use connection pooling where appropriate
- Profile before optimizing
- Validate all user input
- Use parameterized queries
- Implement SSRF protection for URL checking
- Handle secrets via environment variables
- Educational: Demonstrate Go concurrency patterns
- Practical: Provide useful service monitoring
- Production-Ready: Include enterprise features
- Well-Documented: Clear code and documentation
- Tested: Comprehensive test coverage
- Open an issue for bugs or feature requests
- Check existing issues before creating new ones
- Provide clear reproduction steps for bugs
- Include relevant logs and configuration
- Be respectful and inclusive
- Welcome newcomers
- Focus on constructive feedback
- Collaborate openly
Thank you for contributing to PulseCheck!