π GoNotify is a lightweight, event-driven notification system built with Golang and RabbitMQ, designed to seamlessly integrate with any backend server. It enables reliable, asynchronous notification delivery across multiple channels, ensuring scalability and high performance.
β
Seamless Integration β Works with any backend (REST, GraphQL, gRPC).
β
Event-Driven Architecture β Decoupled and scalable notification handling.
β
RabbitMQ-Based Queuing β Ensures reliable and asynchronous processing.
β
Multi-Channel Support β Easily extendable to Email, SMS, WebSockets, Push.
β
Observability β Built-in logging, metrics, and monitoring with Prometheus & Grafana.
β
High Performance & Scalability β Optimized for real-time event handling.
πΉ Golang β High-performance backend development
πΉ RabbitMQ β Message broker for async event processing
πΉ Prometheus & Grafana β Monitoring, logging, and observability
πΉ PostgreSQL β Notification status storage
πΉ Redis β Rate limiting notifications
Ideal for e-commerce, SaaS, fintech, and microservices, GoNotify enables real-time notifications for order updates, system alerts, and user engagement, ensuring a responsive and scalable event-driven architecture.
- RabbitMQ is chosen over Kafka for the following reasons:
- Message Acknowledgment & Delivery Guarantees: RabbitMQβs robust message acknowledgment mechanism ensures reliable message delivery.
- Routing & Fan-out Patterns: RabbitMQ supports Direct Exchange, useful for routing notifications (email, SMS, push).
- Lower Throughput Requirement: RabbitMQ is ideal for scenarios where the focus is on reliability over massive throughput.
- gRPC: Chosen for internal communication between microservices, offering better performance and bi-directional streaming.
- REST: Used for communication with third-party services like Twilio and SendGrid for external notifications.
- Decision: Hybrid Approach β gRPC for internal calls, REST for external third-party integrations.
- Queues: Separate queues per notification type (email, SMS, push).
- Exchanges: Direct, Topic, and Fan-out exchanges are configured for routing notifications to appropriate channels.
- Dead Letter Queue (DLQ): Implemented for retrying failed notifications.
- PostgreSQL: Used for storing notification logs, offering ACID properties and relational capabilities.
- Redis: Utilized for rate limiting, ensuring notifications are not sent too frequently.
- Prometheus and Grafana are used for metrics and monitoring, providing insights into system performance.
- Loki is used for logging, enabling efficient storage and querying of logs.
- Docker containers for consistent environments across development and production.
-
Clone this repository:
git clone https://github.com/your-username/go-notify.git cd go-notify -
Configure the environment: Update the configuration in config/config.yaml as needed. You can also refer to config/config.example.yaml for environment variable settings.
-
Run the services using Docker Compose:
make docker-up
This command will start RabbitMQ, PostgreSQL, gRPC server, worker, Prometheus, Grafana, and Loki.
-
Access the Services:
- gRPC Server: localhost:50051
- Prometheus Metrics: localhost:9090/metrics
- Grafana Dashboard: localhost:3000 (default login: admin/admin)
- RabbitMQ UI: localhost:15672
-
Run tests locally:
make test -
Generate Protobuf files:
make proto
This repository uses GitHub Actions for continuous integration and delivery. The workflow is defined in /.github/workflows/ci-cd.yml and covers:
- Linting
- Testing
- Building
- Docker image creation
Distributed under the MIT License. See LICENSE for more information.
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
