Skip to content

Latest commit

 

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Alerting & Notification Platform (MVP)

Overview

This project implements a backend system for alerts and notifications using FastAPI.

The system supports:

  • Admins: Configure alerts, set visibility (organization, team, or user), and ensure recurring reminders every 2 hours.
  • End Users: Receive alerts relevant to them, snooze alerts for the day, and manage their read/unread status.

It demonstrates state management (read/unread/snoozed), delivery strategies, reminders, and analytics.


Features

Admin Features

  • Create, update, and list alerts (/admin/alerts)
  • Define alert visibility:
    • Organization → visible to all users
    • Team → visible only to users of a team
    • User → visible only to selected users
  • Recurring reminders every 2 hours until user snoozes the alert
  • View delivery logs (/admin/deliveries)

End User Features

  • Fetch alerts relevant to the user (/users/{user_id}/alerts)
  • Mark alerts as read or unread
  • Snooze alerts until the end of the day

Analytics

  • /analytics endpoint shows:
    • Delivered vs Read alerts
    • Snoozed counts per alert
    • Alerts breakdown by severity

Tech Stack

  • Backend Framework: FastAPI
  • Language: Python 3.9+
  • Data Store: In-memory (Python dicts) for demo purposes
  • Run Server: Uvicorn

Setup & Run

  1. Install dependencies
    pip install fastapi uvicorn pydantic
  2. Run the server
    python alertNotification.py
  3. Interactive API Docs
    (http://127.0.0.1:8000/docs)
    

Example Endpoints

Admin

  • Create Alert
    POST /admin/alerts
  • List Alerts
    GET /admin/alerts
  • Trigger Reminders
    POST /system/trigger_reminders

User

  • List Alerts for a User
    GET /users/{user_id}/alerts
  • Snooze Alert
    POST /users/{user_id}/alerts/{alert_id}/snooze
  • Mark Read
    POST /users/{user_id}/alerts/{alert_id}/read
  • Mark Unread
    POST /users/{user_id}/alerts/{alert_id}/unread

Analytics

  • View Metrics
    GET /analytics

Demo Data (Seeded)

When the server starts, it automatically seeds demo data:

  • Teams:

    • Engineering
    • Marketing
  • Users:

    • Alice
    • Bob
    • Carol
  • Sample Alerts:

    • System Maintenance (Org-wide)
    • Engineering Standup Postponed (Team-specific)
    • Security Incident (User-specific for Alice)

Screenshots

image image image image image image image

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages