Skip to content

BillPay is a secure and reliable bill payment service built with NestJS, Prisma ORM, PostgreSQL, and Redis, using Interswitch as the payment processor and biller aggregator. With BillPay, users can conveniently purchase airtime, data bundles, cable TV subscriptions, and electricity tokens.

Notifications You must be signed in to change notification settings

deveasyclick/billpay

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

91 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

image image image

🧾 Billpay

Link: Billpay

The Billpay monorepo powers a complete bill payment platform consisting of:

  • πŸ’³ Backend Service – Handles payments, validation, reconciliation, and provider integrations (Interswitch, VTPass).
  • πŸ’» Frontend Application – Modern Next.js interface for managing and completing payments (airtime, data, TV, electricity).

This repository is organized as a pnpm workspace to streamline dependency management, code sharing, and developer experience.


βš™οΈ Tech Stack

Layer Technologies
Frontend Next.js 16 β€’ TypeScript β€’ Shadcn/ui β€’ TailwindCSS β€’ pnpm β€’ Biome (Linting/Formatting)
Backend NestJS β€’ TypeScript β€’ Prisma β€’ PostgreSQL β€’ Redis β€’ BullMQ
Tooling Docker β€’ pnpm Workspaces β€’ NVM (Node Version Manager) β€’ Biome β€’ Concurrently

πŸ“¦ Structure

.
β”œβ”€β”€ backend      # NestJS + Prisma Bill Payment Service
β”œβ”€β”€ frontend     # Next.js Frontend Application
β”œβ”€β”€ package.json # Shared workspace scripts and metadata
β”œβ”€β”€ pnpm-lock.yaml
└── pnpm-workspace.yaml

pnpm Workspace Configuration

# pnpm-workspace.yaml
packages:
  - 'frontend'
  - 'backend'

πŸš€ Getting Started

Prerequisites

  • Node.js β‰₯ 24 (managed via .nvmrc)
  • pnpm β‰₯ 10
  • PostgreSQL
  • Redis (for background jobs, queues, and reconciliation)

Installation

From the monorepo root:

pnpm install

This installs dependencies for both the frontend and backend.


🧩 Running the Apps

Start both apps (in parallel)

pnpm dev

This runs both the frontend and backend together using concurrently, with color-coded logs (like Turborepo).

Or start individually

Frontend

pnpm --filter frontend dev
# β†’ http://localhost:3001

Backend

pnpm --filter backend dev
# β†’ http://localhost:3000/docs

Build all packages

pnpm --filter './*' build

Lint all packages

pnpm --filter './*' lint

πŸ—‚ Folder Summaries

πŸ–₯️ Frontend (frontend/)

A Next.js 16 application using the App Router. Provides a modern UI for bill payment workflows.

Key Features:

  • Modular component structure per bill category (airtime, data, TV, electricity)
  • Type-safe Zod schemas
  • Reusable UI components
  • Integration with backend REST APIs

πŸ“˜ Read more: Frontend README β†’


βš™οΈ Backend (backend/)

A NestJS service responsible for:

  • Payment validation and routing to providers
  • Retry & reconciliation (BullMQ + Redis)
  • Provider plan synchronization (Cron jobs)
  • Prisma + PostgreSQL persistence
  • Auto-generated Swagger documentation

πŸ“˜ Read more: Backend README β†’


🧠 Development Workflow

Typical local setup:

# 1. Install all dependencies
pnpm install

# 2. Setup backend environment
cd backend && cp .env.example .env

# 3. Run database migrations
pnpm dlx prisma migrate dev

# 4. Run backend and frontend in separate terminals
pnpm --filter backend dev
pnpm --filter frontend dev

πŸ” Environment Management

Each app defines its own .env file. Keep sensitive credentials (DB_URL, API keys, secrets) out of version control.

Example backend .env:

NODE_ENV=development
DATABASE_URL=postgresql://user:password@localhost:5432/billpay
REDIS_URL=redis://localhost:6379
INTERSWITCH_CLIENT_ID=...
VTPASS_API_KEY=...

πŸ§ͺ Testing

Backend

pnpm --filter backend test

Frontend

pnpm --filter frontend test

(Adjust for your test runner: Jest, Vitest, or Playwright.)


🧱 Project Goals

  • Unified development β€” Shared tooling across backend & frontend
  • Type safety β€” End-to-end TypeScript
  • Scalability β€” Clear separation of concerns
  • Resilience β€” Retry & reconciliation for payment flows

🧭 Contributing

  1. Create a new branch

    git checkout -b feat/your-feature
  2. Run linter before committing

    pnpm lint
  3. Follow Conventional Commits

    feat: add electricity payment API
  4. Open a PR with a clear, descriptive message.


πŸͺͺ License

Licensed under the MIT License. See LICENSE for more details.


πŸ“š References

About

BillPay is a secure and reliable bill payment service built with NestJS, Prisma ORM, PostgreSQL, and Redis, using Interswitch as the payment processor and biller aggregator. With BillPay, users can conveniently purchase airtime, data bundles, cable TV subscriptions, and electricity tokens.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages