Skip to content

Open-source plugin-based notification orchestration engine for developers who value control

License

Notifications You must be signed in to change notification settings

SimpleNotificationSystem/simplens-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

180 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

SimpleNS

Open-source plugin-based notification orchestration engine for developers who value control

Scalable β€’ Reliable β€’ Extensible

Features β€’ Architecture β€’ Quick Start β€’ Dashboard β€’ Website β€’ Documentation


SimpleNS is a self-hosted notification orchestration engine that manages delivery workflowsβ€”retries, scheduling, crash recovery, and scalingβ€”while delegating the actual sending to plugins. Build your own providers or use community plugins to support any channel: Email, SMS, WhatsApp, Push, and beyond.


Why SimpleNS?

❌ The Problem βœ… How SimpleNS Solves It
Locked into a single notification provider Plugin architecture β€” swap providers without code changes
Notifications fail silently Exponential backoff retries with configurable limits
Crashes leave messages stuck Crash recovery service detects & rescues orphaned notifications
Single point of failure Horizontally scalable workers and processors
Complex scheduling logic Built-in scheduled delivery with Redis-backed queues
Different APIs for each channel Unified API for all notification channels

Key Features

  • πŸ”Œ Plugin-Based Delivery β€” Delegate sending to any provider plugin
  • πŸ”„ Exponential Backoff Retries β€” Automatic retry with increasing delays
  • πŸ›‘οΈ Crash Recovery β€” Detect and rescue orphaned notifications
  • ⏰ Scheduled Delivery β€” Queue notifications for future delivery
  • πŸ“ˆ Horizontal Scaling β€” Scale processors independently per channel
  • πŸ“‘ Multi-Channel Support β€” Email, WhatsApp, SMS, Push via plugins
  • 🚦 Rate Limiting β€” Per-provider token bucket algorithm
  • πŸ”” Webhook Callbacks β€” Real-time delivery status updates
  • πŸ“Š Admin Dashboard β€” Monitor, search, and retry notifications
  • πŸ“‹ Observability β€” Centralized logging with Grafana + Loki

Architecture

SimpleNS Architecture

Component Description
API Server REST API for notification ingestion (/api/notification, /api/notification/batch)
Background Worker Polls outbox, publishes to Kafka, consumes status updates
Unified Processor Plugin-based notification delivery with rate limiting
Delayed Processor Handles scheduled notifications via Redis ZSET queue
Recovery Service Detects stuck notifications and reschedules them

Plugin System

SimpleNS Core handles orchestration; plugins handle delivery.

Plugins are automatically installed at runtime based on your simplens.config.yaml configuration. Use the Config Generator CLI to create or update your config:

# Generate config for a plugin
npx @simplens/config-gen generate @simplens/mock

# Generate config for multiple plugins
npx @simplens/config-gen gen @simplens/nodemailer-gmail @simplens/twilio-sms

# Add a plugin to existing config
npx @simplens/config-gen gen @simplens/nodemailer-gmail -c simplens.config.yaml

# List available official plugins
npx @simplens/config-gen list --offical

#List available community plugins
npx @simplens/config-gen list --community

Building Custom Plugins

The @simplens/create-simplens-plugin CLI scaffolds a plugin project:

npx @simplens/create-simplens-plugin

This generates the boilerplate so you only write the delivery logic:

import { SimpleNSProvider, ProviderManifest } from '@simplens/sdk';

class MyProvider implements SimpleNSProvider {
  readonly manifest: ProviderManifest = {
    name: 'my-provider',
    channel: 'email',
    requiredCredentials: ['API_KEY'],
    // ...
  };
  
  async send(notification) {
    // Your delivery logic
    return { success: true, messageId: 'msg-123' };
  }
}

Quick Start

Prerequisites

  • Docker & Docker Compose

1. Create Project Directory

mkdir my-simplens && cd my-simplens

2. Configure the .env file

  • Copy the .env.example file into .env in your my-simplens dir and configure the required fields

3. Generate Plugin Configuration

Use the config generator CLI to create simplens.config.yaml:

# Generate config for the mock plugin (for testing)
npx @simplens/config-gen generate @simplens/mock

# Or generate config for email
npx @simplens/config-gen generate @simplens/nodemailer-gmail

The generated config includes comments explaining each field. Set the corresponding environment variables in .env.

4. Copy Docker-Compose files

  • Copy docker-compose.yaml (for appliciation services) and docker-compose.infra.yaml file (for infrastrucutre services if you dont want to use cloud providers for infrastrucutre)

Note: You'll also need MongoDB, Redis, and Kafka. See the full documentation for infrastructure setup.

5. Start Services

docker-compose -f docker-compose.infra.yaml up -d #If you don't want to use cloud providers for infrastructure
docker-compose up -d

Plugins listed in simplens.config.yaml are automatically installed at container startup.

6. Send a Notification

The request schema can be easily obtained from the Payload Studio in the admin dashboard.

curl -X POST http://localhost:3000/api/notification \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_NS_API_KEY" \
  -d '{
    "request_id": "<UUIDV4>",
    "client_id": "<UUIDV4>",
    "channel": ["email"],
    "recipient": {
      "user_id": "<string>",
      "email": "<valid email>"
    },
    "content": {
      "email": {
        "subject": "Hello from SimpleNS!",
        "message": "<h1>Welcome!</h1><p>Your notification system is working.</p>"
      }
    }
  }'

7. Check the Dashboard

Open http://localhost:3002 and login with your configured credentials:

  • Username: admin (default, configurable via ADMIN_USERNAME)
  • Password: admin (default, configurable via ADMIN_PASSWORD)

Admin Dashboard

Admin Dashboard

The Admin Dashboard provides a modern interface for monitoring and managing notifications:

  • 🏠 Dashboard Home β€” Overview with status cards showing total, delivered, pending, and failed counts
  • πŸ“‘ Channel Cards β€” Visual cards for each configured channel (Email, WhatsApp, etc.) with quick navigation
  • πŸ“‹ Events Explorer β€” Paginated event table with filtering, search, and status indicators
  • πŸ”΄ Failed Events β€” Dedicated view for failed notifications with retry capabilities
  • 🚨 Alerts β€” System alerts for orphaned notifications and recovery events requiring attention
  • πŸ“ˆ Analytics β€” Charts and visualizations for notification status and channel distribution
  • πŸ”Œ Plugins β€” View installed plugins, their channels, and provider configurations
  • πŸ”§ Payload Studio β€” Interactive schema explorer for building and notification payloads

License

MIT License β€” see LICENSE for details.


Built with ❀️ for developers who need reliable notifications