Skip to content

puneetdixit200/payment-settlement-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’Ž PaySettle - Enterprise Payment Settlement Platform

PaySettle Logo

A Visa-Grade Payment Settlement & Reconciliation System

Node.js React PostgreSQL Tailwind CSS


✨ Features

🏦 Core Settlement Engine

  • Multi-Merchant Support - Onboard and manage multiple merchants
  • T+0/T+1/T+2 Settlement Cycles - Configurable per merchant
  • Double-Entry Ledger - Append-only accounting for all financial events
  • Batch Processing - Handle high-volume transaction settlement

πŸ”„ Reconciliation Engine

  • Exact Matching - 100% field match
  • Fuzzy Matching - Configurable tolerance for amounts
  • Partial Matching - Match on subset of fields
  • Manual Resolution - Admin override for edge cases

πŸ“Š Real-Time Analytics

  • Dashboard KPIs - Transaction volume, match rate, settlement status
  • 7-Day Trends - Volume and count charts
  • Alert System - Threshold-based notifications
  • Audit Trail - Immutable action logging

πŸ” Enterprise Security

  • JWT Authentication - Secure token-based auth
  • Role-Based Access Control - Admin, Finance Ops, Merchant roles
  • Rate Limiting - Protect against abuse
  • Idempotent Operations - Prevent duplicate transactions

🎨 Premium UI Theme

The platform features a Violet/Emerald gradient theme with:

  • 🌌 Mesh gradient backgrounds with animated floating elements
  • πŸ’œ Glassmorphism cards with violet glow effects
  • ✨ Gradient accents throughout the interface
  • 🎯 Responsive design for all screen sizes

πŸš€ Quick Start

Prerequisites

  • Node.js 18+
  • PostgreSQL 14+
  • npm or yarn

1. Clone & Install

# Clone repository
git clone https://github.com/yourusername/payment-settlement.git
cd payment-settlement

# Install backend dependencies
cd backend
npm install

# Install frontend dependencies
cd ../frontend
npm install

2. Configure Environment

Create .env file in /backend:

# Environment
NODE_ENV=development
PORT=3001

# Database
DATABASE_URL="postgresql://postgres:YOUR_PASSWORD@localhost:5432/payment_settlement?schema=public"

# JWT
JWT_SECRET=your-secure-secret-key
JWT_EXPIRES_IN=24h

# Settlement
SETTLEMENT_CUTOFF_HOUR=23
SETTLEMENT_CUTOFF_MINUTE=59
DEFAULT_MERCHANT_FEE_PERCENT=2.5

# Rate Limiting
RATE_LIMIT_MAX_REQUESTS=1000

3. Initialize Database

cd backend

# Generate Prisma client
npx prisma generate

# Push schema to database
npx prisma db push

# Seed sample data
npm run db:seed

4. Start Development Servers

# Terminal 1: Backend (port 3001)
cd backend
npm run dev

# Terminal 2: Frontend (port 5173)
cd frontend
npm run dev

5. Access Application

Service URL
🌐 Frontend http://localhost:5173
πŸ”Œ Backend API http://localhost:3001
❀️ Health Check http://localhost:3001/health

πŸ”‘ Demo Credentials

Role Email Password Access
πŸ‘‘ Admin admin@settlement.io Admin@123 Full system access
πŸ’° Finance finance@settlement.io Finance@123 Operations & reports
πŸͺ Merchant merchant@merch001.com Merchant@123 Own data only

πŸ“ Project Structure

payment-settlement/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ prisma/
β”‚   β”‚   β”œβ”€β”€ schema.prisma     # Database schema (14 models)
β”‚   β”‚   └── seed.js           # Sample data seeder
β”‚   └── src/
β”‚       β”œβ”€β”€ config/           # Configuration & database
β”‚       β”œβ”€β”€ middleware/       # Auth, RBAC, validation
β”‚       β”œβ”€β”€ routes/           # API endpoints
β”‚       β”œβ”€β”€ services/         # Business logic
β”‚       └── jobs/             # Cron jobs
β”‚
β”œβ”€β”€ frontend/
β”‚   └── src/
β”‚       β”œβ”€β”€ components/       # Layout, UI components
β”‚       β”œβ”€β”€ context/          # Auth context
β”‚       β”œβ”€β”€ pages/            # 10 main pages
β”‚       └── services/         # API client
β”‚
└── README.md

πŸ“‘ API Endpoints

Authentication

Method Endpoint Description
POST /api/auth/login User login
GET /api/auth/me Current user info

Transactions

Method Endpoint Description
GET /api/transactions List transactions
POST /api/transactions/ingest Ingest single
POST /api/transactions/batch Batch ingest

Reconciliation

Method Endpoint Description
GET /api/reconciliation/results Get results
POST /api/reconciliation/run Run reconciliation

Settlements

Method Endpoint Description
GET /api/settlements List settlements
POST /api/settlements/:id/process Process batch

Analytics

Method Endpoint Description
GET /api/metrics Dashboard KPIs
GET /api/metrics/trends Trend data
GET /api/metrics/alerts System alerts

⏰ Background Jobs

Job Schedule Description
Reconciliation Every 15 min Match pending transactions
Daily Settlement 23:59 IST Create settlement batches
Settlement Processing Every 30 min Process pending settlements
Threshold Monitor Hourly Check and create alerts

πŸ›  Tech Stack

Layer Technology
Backend Node.js, Express.js
Database PostgreSQL, Prisma ORM
Frontend React 18, Vite
Styling Tailwind CSS
Charts Recharts
Auth JWT, bcryptjs
Logging Winston
Scheduling node-cron

πŸ“„ License

MIT License - See LICENSE for details.


Built with πŸ’œ for Enterprise Fintech

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors