Skip to content

Victoryoola/pre-bill

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pre-Billing Notification System

A distributed, event-driven notification system that schedules and delivers notifications to users before subscription billing events.

Features

  • REST API for scheduling and managing notifications
  • Redis-based message queue for reliable job persistence
  • Horizontally scalable worker services
  • Multi-channel delivery (email, webhook, SMS)
  • Automatic retry with exponential backoff
  • Comprehensive monitoring and health checks

Tech Stack

  • Runtime: Node.js with TypeScript
  • API Framework: Express
  • Message Queue: Redis (using ioredis)
  • Testing: Jest with fast-check for property-based testing

Project Structure

src/
├── api/         # REST API endpoints
├── worker/      # Background worker service
├── queue/       # Redis queue operations
├── channels/    # Notification delivery channels
├── models/      # Data models and types
└── utils/       # Utility functions

Getting Started

Prerequisites

  • Node.js 18+
  • Redis 6+

Installation

npm install

Development

# Build the project
npm run build

# Run tests
npm test

# Run tests in watch mode
npm run test:watch

# Start API server (development)
npm run dev:api

# Start worker service (development)
npm run dev:worker

Configuration

Configuration is managed through environment variables. See .env.example for available options.

Testing

The project uses a dual testing approach:

  • Unit Tests: Verify specific examples and edge cases
  • Property-Based Tests: Verify universal properties across randomized inputs using fast-check

Run tests with:

npm test

License

MIT

About

This is a custom notification system that improves subscription plan transparency and it drives customer satisfaction on subscription plans. Prebill reduces chargebacks and refunds from customers, no surprise charges to users. All these advantages help with better brand image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors