A production-style event-driven microservices architecture built using Django, Kafka, and MongoDB. This system captures events from multiple services and processes them asynchronously to generate user notifications.
Auth Service → Kafka
Payment Service → Kafka
Email Service → Kafka
↓
Notification Service (Consumer)
↓
MongoDB
↓
Notification APIs
- Backend: Django, Django REST Framework
- Messaging: Apache Kafka
- Database: MongoDB
- Containerization: Docker & Docker Compose
- API Testing: Postman
- Event-driven architecture using Kafka
- Multiple producer microservices (Auth, Payment, Email)
- Asynchronous event processing via Kafka consumer
- Rule-based notification engine
- MongoDB for scalable event + notification storage
- REST APIs for fetching notifications
- Dockerized setup (one command run)
- Kafka UI for topic inspection
- Consumes events from Kafka
- Applies rule engine
- Stores events & notifications in MongoDB
- Emits
USER_LOGINevents
- Emits
PAYMENT_SUCCESS/PAYMENT_FAILED - Triggers notifications
- Emits
EMAIL_SENTevents
- Producer services send events to Kafka
- Kafka stores and streams events
- Notification service consumes events
- Rule engine evaluates events
- Notifications stored in MongoDB
- APIs expose notifications
docker-compose up --buildPOST http://localhost:8001/api/login/
POST http://localhost:8002/api/pay/
POST http://localhost:8003/api/send-email/
GET http://localhost:8000/api/notifications/
GET http://localhost:8000/api/notifications/?user_id=123
Access Kafka UI at:
http://localhost:8080
Connect via:
mongodb://localhost:27018
{
"event_type": "PAYMENT_FAILED",
"user_id": "123",
"status": "FAILURE"
}- Event-driven architecture
- Microservices communication via Kafka
- Asynchronous processing
- Decoupled system design
- Scalable backend patterns
- Retry mechanism & dead-letter queue
- WebSocket-based real-time notifications
- Authentication & authorization
- Monitoring & logging (Prometheus, Grafana)
Shivam
- 🔗 LinkedIn: https://www.linkedin.com/in/programmer-shivam/
- 💻 GitHub: https://github.com/shane-Coder
Give it a star ⭐ and feel free to fork or contribute!