A microservices-based notification system that sends emails and push notifications using asynchronous message queues.
The system consists of 5 microservices:
- API Gateway Service - Entry point for all notification requests
- User Service - Manages user data and preferences
- Email Service - Handles email notifications via SMTP/SendGrid
- Push Service - Handles push notifications via FCM
- Template Service - Manages notification templates
- Language: Python 3.11+ with FastAPI
- Message Queue: RabbitMQ
- Databases: PostgreSQL (primary), Redis (caching)
- Containerization: Docker & Docker Compose
- API Documentation: Swagger/OpenAPI
- Docker and Docker Compose
- Python 3.11+ (for local development)
- Free tier accounts for:
- SendGrid (email) or Gmail SMTP
- Firebase Cloud Messaging (FCM) for push notifications
🚀 New to the project? See QUICKSTART.md for a step-by-step guide to get running in minutes!
# 1. Create .env file with your credentials
# 2. Start services
docker-compose up -d
# 3. Initialize data
python scripts/create_test_user.py
python scripts/init_templates.py
# 4. Access API Gateway
# http://localhost:8000/docsFor detailed instructions, see:
- QUICKSTART.md - Complete quick start guide
- SETUP.md - Detailed setup instructions
- DEPLOYMENT_SUMMARY.md - Deployment overview and recommendations
- 🚀 Quick Start: See
QUICKSTART.md- Get running in minutes! - Quick Setup: See
SETUP.mdfor basic setup instructions - 🚀 Deployment:
- DEPLOYMENT_SUMMARY.md - Overview and quick recommendations
- DEPLOYMENT_QUICK_START.md - Fastest deployment options (10-30 min)
- DEPLOYMENT_GUIDE.md - Comprehensive guide with 7 deployment options:
- ⭐ Render.com (Recommended) - Quick deployments with managed infrastructure
- Docker Compose (Single Server)
- Railway
- AWS (ECS/Fargate)
- Google Cloud Platform
- Kubernetes (Production)
- DigitalOcean App Platform
- FCM Migration: See
docs/FCM_MIGRATION.md- Migrate from Legacy to HTTP v1 API
POST /api/v1/notifications/- Create notificationGET /api/v1/notifications/{notification_id}/status- Get notification status
POST /api/v1/users/- Create userGET /api/v1/users/{user_id}- Get userPUT /api/v1/users/{user_id}- Update userPOST /api/v1/users/login- Login
POST /api/v1/templates/- Create templateGET /api/v1/templates/{template_code}- Get templatePUT /api/v1/templates/{template_code}- Update template
Each service can be run independently:
cd services/api_gateway
uvicorn main:app --reload --port 8000pytest🚀 Recommended: Deploy to Render.com
The easiest way to deploy is using Render's Blueprint feature with the provided render.yaml:
- Sign up at render.com
- Connect your GitHub repository
- Create a new Blueprint and select
render.yaml - Configure environment variables (see DEPLOYMENT_GUIDE.md)
- Deploy!
See DEPLOYMENT_GUIDE.md for complete instructions.
GitHub Actions workflows are configured in .github/workflows/. The pipeline:
- Runs tests
- Builds Docker images
- Deploys to server (when using
/request-server)
Render also supports automatic deployments from Git - just connect your repository!
See docs/system_design.md for detailed architecture diagrams and design decisions.
See docs/architecture_diagram.txt for diagram description to create visual architecture diagrams using Draw.io, Miro, or Lucidchart.
- Handle 1,000+ notifications per minute
- API Gateway response < 100ms
- 99.5% delivery success rate
- Horizontal scaling support
- ✅ Circuit Breaker pattern
- ✅ Retry with exponential backoff
- ✅ Dead Letter Queue
- ✅ Health checks
- ✅ Idempotency
- ✅ Service discovery
- ✅ Rate limiting
- ✅ Correlation IDs for logging
MIT