A self-hosted, lightweight notification system powered by PostgreSQL and Kafka. Easily plug this service into your existing applications to manage topic-based notifications, client subscriptions, and real-time event delivery.
- Dockerized and ready for production
- Topic-based subscription model
- Built on PostgreSQL + Kafka
- Type-safe queries using
sqlc - Simple Makefile-based control interface
git clone https://github.com/CodegeassBala/notify.git
cd notifications-serviceCreate a .env file or export the following env variables:
DB_URL=postgres://<username>:<password>@localhost:5432/notify?sslmode=disable
KAFKA_BROKER=localhost:9092You may also adjust config values inside the Makefile as needed.
Use the provided Makefile to start the app and dependencies:
make start # Start all containers
make dev # Run the app in dev mode
make clean # Stop all containers and processesNote: This will spin up PostgreSQL, Kafka (via KRaft or ZooKeeper), and the notifications service container.
Once running, your other services can interact with the notifications service via exposed HTTP endpoints (or any messaging integration you’ve configured). Example flows include:
- Create a Topic
- Subscribe Clients to Topics
- Send Notifications to Topics
- Receive Events in Real Time
- DB access and migrations handled via
sqlc - Uses Go modules, pgx (or lib/pq), and clean module separation
- Add your queries inside the
query.sqland regenerate with:
make dev