A production-grade, event-driven notification platform built with Golang, Apache Kafka, and PostgreSQL.
The Notification Service is responsible for consuming business events from Kafka and delivering notifications across multiple channels such as Email, SMS, Push Notifications, Slack, Microsoft Teams, WhatsApp, and Webhooks.
Rather than being tightly coupled with business services, this platform follows an Event-Driven Architecture (EDA) where services publish domain events and the Notification Service reacts asynchronously.
The long-term goal of this project is to evolve into a highly scalable Event Processing Platform capable of handling millions of events per day with reliability, observability, and fault tolerance.
Every business produces events.
Course Created
Payment Successful
Order Delivered
Password Changed
User Registered
Subscription Expired
Invoice Generated
Instead of every microservice sending emails, SMS, or push notifications directly, each service simply publishes an event.
Producer
β
Kafka
β
Notification Platform
β
Email
SMS
Push
Slack
WhatsApp
Webhooks
This creates loosely coupled systems that are easier to scale and maintain.
Build an enterprise-grade notification platform demonstrating:
- Event-Driven Architecture
- Domain Driven Design
- Clean Architecture
- SOLID Principles
- Kafka Consumer Groups
- Horizontal Scalability
- High Availability
- Fault Tolerance
- Idempotent Processing
- Retry Mechanisms
- Dead Letter Queues
- Transactional Outbox Pattern
- Distributed Systems Best Practices
+----------------------+
| Course Service |
+----------+-----------+
|
|
course.created
|
βΌ
+----------------------+
| Apache Kafka |
+----------+-----------+
|
+--------------------+-------------------+
| | |
βΌ βΌ βΌ
Notification Service Analytics Service Search Service
|
βΌ
+---------------------------+
| Notification Engine |
+-------------+-------------+
|
+---------+---------+
| | |
βΌ βΌ βΌ
Email SMS Push
- Golang
- Apache Kafka
- PostgreSQL
- Docker
- Docker Compose
- slog (Structured Logging)
- Prometheus
- Grafana
- OpenTelemetry
- Jaeger
- Kubernetes
- Helm
- Istio
notification-service/
βββ api/
βββ cmd/
β βββ server/
β βββ main.go
β
βββ domain/
β
βββ events/
β
βββ handler/
β βββ consumer/
β βββ http/
β
βββ internal/
β βββ app/
β βββ config/
β βββ constants/
β βββ database/
β βββ kafka/
β βββ logger/
β βββ mapper/
β βββ router/
β βββ usecase/
β
βββ repository/
β
βββ service/
β
βββ shared/
β
βββ migrations/
- Kafka Consumer
- Structured Logging
- Graceful Shutdown
- Configurable Consumer Groups
- PostgreSQL Integration
- Event Deserialization
- Consume Kafka Events
- Process Course Created Events
- Worker Pool
- Configurable Consumers
- Email Notifications
- SMS Notifications
- Push Notifications
- Slack Notifications
- Retry Topics
- Dead Letter Queue (DLQ)
- Exponential Backoff
- Poison Message Handling
- Idempotent Consumers
- Duplicate Event Detection
- Exactly Once Processing
- Transactional Outbox Pattern
- Event Replay
- Audit Logs
- Event Versioning
- Prometheus Metrics
- Grafana Dashboards
- Distributed Tracing
- OpenTelemetry
- Kubernetes Deployment
- Helm Charts
- Auto Scaling
- Rolling Updates
- Multi Tenant Support
- Notification Templates
- Template Versioning
- Dynamic Variables
Example:
Hello {{first_name}}
A new course "{{course_name}}" has been published.
- User Notification Preferences
Example
User A
β Email
β SMS
β Push
β Slack
- Scheduling Notifications
Send immediately
Send after 30 minutes
Send tomorrow morning
Send every Monday
- Workflow Engine
Example
User Registered
β
Send Welcome Email
β
Wait 2 Days
β
Send Discount Coupon
β
Wait 7 Days
β
Notify Sales Team
-
AI Powered Notifications
-
Smart Send Time
-
AI Generated Email Content
-
Personalized Messages
-
Language Translation
-
Spam Prediction
- 100K+ Events / Minute
- Horizontal Scaling
- Zero Downtime Deployments
- At-Least-Once Delivery
- Configurable Retry Strategy
- High Throughput
- Low Latency
- Consumer Groups
- Manual Offset Commit
- Retry Topics
- Dead Letter Queue
- Idempotent Consumers
- Circuit Breakers
- Graceful Shutdown
- Backpressure Handling
- TLS Communication
- SASL Authentication
- JWT Authentication
- Secrets Management
- RBAC
- Audit Logs
- Prometheus
- Grafana
- OpenTelemetry
- Jaeger
- Structured Logs
- Health Checks
- Readiness Probes
- Liveness Probes
- Amazon SES
- SendGrid
- Twilio
- Firebase Cloud Messaging
- OneSignal
- Slack
- Microsoft Teams
- Discord
- WhatsApp Business API
- Webhooks
This project is not just a notification microservice.
The long-term objective is to evolve it into a Cloud Native Event Processing Platform capable of serving as the communication backbone for large-scale distributed systems.
The platform will support:
- Multi-channel notifications
- Event orchestration
- Workflow automation
- Event replay
- Analytics
- AI-assisted notification delivery
- Multi-tenant SaaS deployments
- Enterprise observability
- Kubernetes-native deployments
- High availability and fault tolerance
Ultimately, this platform can be extended into a commercial SaaS offering where organizations publish business events once and configure how, when, and where notifications are deliveredβwithout modifying their business services.