Skip to content

A Flask app that sends Email, SMS, and in-app notifications using RabbitMQ for asynchronous processing. It offers APIs to send and retrieve notifications, simulating delivery via console logs.

Notifications You must be signed in to change notification settings

Maksym-TopDev/SMS_Notification_Service

Repository files navigation

Notification Service

Overview

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.


Features

  • 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).

Setup Instructions

Prerequisites

  • Python 3.8+
  • RabbitMQ installed and running locally (Download here)
  • Git (optional, for cloning repo)

Installation

  1. Clone the repository:
git clone https://github.com/CloudDev777/SMS_Notification_Service.git
cd SMS_Notification_Service
  1. Create and activate a virtual environment:

On Windows PowerShell:

python -m venv venv
.\venv\Scripts\Activate.ps1
  1. Install dependencies:
pip install -r requirements.txt
  1. Start RabbitMQ server (make sure it is running locally).

Running the Application

  1. Run the Flask app (API server):
python app.py
  1. In a new terminal window, start the RabbitMQ worker to process notification messages:
python notifications/queue_worker.py

API Endpoints

  • 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


Assumptions and Notes

  • 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.

License

MIT License


About

A Flask app that sends Email, SMS, and in-app notifications using RabbitMQ for asynchronous processing. It offers APIs to send and retrieve notifications, simulating delivery via console logs.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages