Skip to content

redlin/notifygate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NotifyGate

Self-hosted notification routing and delivery platform. Ingest events from any source, apply rules, and deliver notifications to your team via Slack, Discord, email, webhooks, and more.

Features

  • Event ingestion via REST API and inbound webhooks
  • Rule-based routing — conditions, throttle, mute, escalate, and transform actions
  • Multi-channel delivery — Slack, Discord, Microsoft Teams, Telegram, Email, Webhooks, Feishu, Push
  • Multi-tenant workspaces with role-based access (owner / admin / editor / viewer)
  • Message templates with variable interpolation
  • Event deduplication and fingerprinting
  • Throttle & mute windows to control notification volume
  • Audit trails — activity logs and event logs
  • API key authentication for programmatic access
  • Oban-powered background job processing

Architecture

Your App ──HTTP──► /api/v1/events
                        │
                   Rules Engine
                        │
              ┌─────────┴─────────┐
           Connectors          Templates
              │
    Slack / Discord / Email / Webhook / ...

Prerequisites

  • Elixir 1.15+
  • PostgreSQL 15+
  • Node.js 18+ (for asset builds)

Quick Start

git clone https://github.com/redlin/notifygate
cd notifygate

# Install dependencies, create DB, run migrations, build assets
mix setup

# Start the server
mix phx.server

Visit http://localhost:4000 to get started.

Production deployment: set the required environment variables listed below before running mix setup or starting a release.

Configuration

All configuration is done via environment variables.

Required

Variable Description
DATABASE_URL PostgreSQL connection string — ecto://user:pass@host/dbname
SECRET_KEY_BASE Phoenix secret key (generate with mix phx.gen.secret)
TOKEN_SIGNING_SECRET JWT signing secret (generate with mix phx.gen.secret)
PHX_HOST Hostname for URL generation (e.g. notify.example.com)
PORT HTTP port (default: 4000)

Email (SMTP)

Variable Description
SMTP_HOST SMTP server hostname
SMTP_PORT SMTP port (default: 587)
SMTP_USERNAME SMTP username
SMTP_PASSWORD SMTP password

In development, emails are captured locally and viewable at /dev/mailbox.

Optional

Variable Description
PHX_SERVER Set to true to start the HTTP server (required for releases)
POOL_SIZE Database connection pool size (default: 10)
ECTO_IPV6 Set to true to enable IPv6 for database connections
DATABASE_SSL Set to false to disable SSL for database (default: true)
OBAN_QUEUES Set to false to disable background job processing
LOG_LEVEL Runtime log level — debug, info, warning, error
DNS_CLUSTER_QUERY DNS query for Elixir cluster formation

Supported Channels

Channel Notes
Slack Incoming webhook or Bot token
Discord Incoming webhook
Microsoft Teams Incoming webhook
Telegram Bot API token + chat ID
Email Via configured SMTP
Webhook HTTP POST to any URL
Feishu / Lark Incoming webhook
Push Generic push notifications

Deployment

Manual / VPS

# Build a release
MIX_ENV=prod mix assets.deploy
MIX_ENV=prod mix release

# Run migrations
_build/prod/rel/notify_gate/bin/notify_gate eval "NotifyGate.Release.migrate()"

# Start
PHX_SERVER=true _build/prod/rel/notify_gate/bin/notify_gate start

A sample systemd service file and nginx config are provided in the deploy/ directory.

Docker

Generate a Dockerfile with:

mix phx.gen.release --docker

Then build and run:

docker build -t notifygate .
docker run -e DATABASE_URL=... -e SECRET_KEY_BASE=... -p 4000:4000 notifygate

Fly.io

fly launch
fly secrets set DATABASE_URL=... SECRET_KEY_BASE=... TOKEN_SIGNING_SECRET=...
fly deploy

Development

# Start server with live reload
mix phx.server

# Run tests
mix test

# Run the full pre-commit check (compile, format, tests)
mix precommit

# View sent emails (dev only)
open http://localhost:4000/dev/mailbox

# View Oban job dashboard (dev only)
open http://localhost:4000/oban

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b my-feature)
  3. Make your changes and run mix precommit
  4. Open a pull request

License

MIT

About

One Gate for all your Notifications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors