Skip to content

brainox/Distributed-Notification-System

Repository files navigation

πŸ”” Distributed Notification System

HNG Group 55 - Scalable Microservices Architecture

Build Status License Microservices Docker


πŸ“‹ Table of Contents


🎯 Overview

A highly scalable, distributed notification system built with microservices architecture. This system handles multi-channel notifications (email, push, SMS) with high throughput, reliability, and observability.

✨ Key Features

  • πŸš€ High Performance - Handles thousands of notifications per second
  • πŸ”„ Multi-Channel Support - Email, Push notifications, and more
  • πŸ›‘οΈ Resilience - Built-in circuit breakers, retries, and idempotency
  • πŸ“Š Full Observability - Metrics, logs, and distributed tracing
  • πŸ”Œ Event-Driven - RabbitMQ-based message streaming
  • 🐳 Container-Ready - Fully dockerized for easy deployment

πŸ—οΈ Architecture

This system follows a microservices architecture pattern with event-driven communication, leveraging RabbitMQ for reliable message streaming and Redis for caching and session management.


πŸ“ Project Structure

notification-system/
β”‚
β”œβ”€β”€ 🌐 api_gateway/              # API Gateway & routing layer
β”‚
β”œβ”€β”€ βš™οΈ  services/
β”‚   β”œβ”€β”€ user_service/            # User management & authentication
β”‚   β”œβ”€β”€ template_service/        # Notification template management
β”‚   β”œβ”€β”€ email_service/           # Email notification handler
β”‚   β”œβ”€β”€ push_service/            # Push notification handler
β”‚
β”œβ”€β”€ 🏒 infra/
β”‚   β”œβ”€β”€ rabbitmq/                # Message broker configuration
β”‚   β”œβ”€β”€ redis/                   # Caching & session store
β”‚   β”œβ”€β”€ postgres/                # Primary database
β”‚   β”œβ”€β”€ nginx/                   # Load balancer & reverse proxy
β”‚
β”œβ”€β”€ πŸ”§ shared/
β”‚   └── libs/
β”‚       β”œβ”€β”€ circuit_breaker/     # Circuit breaker pattern
β”‚       β”œβ”€β”€ idempotency/         # Idempotency handling
β”‚       β”œβ”€β”€ retry/               # Retry logic & backoff
β”‚       └── logging/             # Centralized logging utilities
β”‚
β”œβ”€β”€ πŸ“Š observability/
β”‚   β”œβ”€β”€ prometheus/              # Metrics collection
β”‚   β”œβ”€β”€ grafana/                 # Metrics visualization
β”‚   β”œβ”€β”€ loki/                    # Log aggregation
β”‚   β”œβ”€β”€ jaeger/                  # Distributed tracing
β”‚   └── alerting/                # Alert management
β”‚
β”œβ”€β”€ πŸš€ deployments/
β”‚   β”œβ”€β”€ docker/                  # Docker compose configurations
β”‚   β”œβ”€β”€ staging/                 # Staging environment configs
β”‚   └── production/              # Production environment configs
β”‚
β”œβ”€β”€ πŸ”„ .github/
β”‚   └── workflows/               # CI/CD pipelines
β”‚
└── πŸ“š docs/
    β”œβ”€β”€ architecture_diagram/    # System architecture diagrams
    β”œβ”€β”€ openapi_specs/           # API specifications
    └── readmes/                 # Additional documentation

πŸ”Œ Core Services

Service Description Port
API Gateway Entry point for all client requests, handles routing and authentication 8000
User Service Manages user accounts, preferences, and authentication 8001
Template Service Handles notification templates and personalization 8002
Email Service Processes and sends email notifications 8003
Push Service Handles push notifications to mobile devices 8004

🏒 Infrastructure

Message Broker

  • RabbitMQ - Reliable message broker for asynchronous communication

Data Storage

  • PostgreSQL - Primary relational database
  • Redis - High-performance caching and session management

Load Balancing

  • Nginx - Reverse proxy and load balancer

πŸ“Š Observability

Monitoring Stack

Tool Purpose
Prometheus Metrics collection and alerting
Grafana Metrics visualization and dashboards
Loki Log aggregation and querying
Jaeger Distributed request tracing

Key Metrics Tracked

  • Request throughput and latency
  • Service health and uptime
  • Queue depths and processing rates
  • Error rates and types
  • Resource utilization (CPU, memory, disk)

πŸš€ Getting Started

Prerequisites

  • Docker & Docker Compose
  • Node.js (v18+) or Python (v3.10+)
  • RabbitMQ
  • PostgreSQL
  • Redis

Quick Start

# Clone the repository
git clone https://github.com/brainox/hng-group55-distributed-notification-system.git
cd hng-group55-distributed-notification-system

# Start infrastructure services
docker-compose -f deployments/docker/docker-compose.yml up -d

# Start individual services (example)
cd services/email_service
npm install && npm start

Environment Setup

Each service requires its own environment configuration. Copy the example env files:

cp .env.example .env

Update the .env files with your specific configuration values.


πŸ“š Documentation


🀝 Contributing

Contributions are welcome! Please read our contributing guidelines before submitting pull requests.


πŸ“ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ‘₯ Team

HNG Group 55 - Building scalable notification systems


Made with ❀️ by HNG Group 55

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •