This project is a simple Notification Service built with Flask and RabbitMQ. It provides an API to send notifications to users via Email, SMS, or in-app messages using a queue-based system for reliability and scalability.
- REST API with endpoints to send notifications and retrieve user notifications.
- Supports multiple notification types: Email, SMS, and In-app.
- Uses RabbitMQ as a message queue to handle notifications asynchronously.
- Retry mechanism for failed notifications (can be extended).
- Simulated sending of notifications (prints messages to the console).
- Python 3.8+
- RabbitMQ installed and running locally (Download here)
- Git (optional, for cloning repo)
- Clone the repository:
git clone https://github.com/CloudDev777/SMS_Notification_Service.git
cd SMS_Notification_Service
- Create and activate a virtual environment:
On Windows PowerShell:
python -m venv venv
.\venv\Scripts\Activate.ps1
- Install dependencies:
pip install -r requirements.txt
- Start RabbitMQ server (make sure it is running locally).
- Run the Flask app (API server):
python app.py
- In a new terminal window, start the RabbitMQ worker to process notification messages:
python notifications/queue_worker.py
-
Send Notification
POST /notifications
Request JSON:{ "user_id": 1, "type": "email", "message": "Hello from Rit!" }
Response:
{ "status": "queued" }
-
Get User Notifications
GET /users/{id}/notifications
- Actual sending of emails or SMS is simulated via console print statements.
- RabbitMQ runs on
localhost
with default ports. - No persistent database; notifications are stored in-memory (can be extended).
- No authentication or authorization implemented.
- Retry mechanism for failed notifications is a placeholder and can be enhanced.
MIT License