02 FINTECH · FULL-STACK MVC · MONGODB

SHG SAHAYAK

// SAVINGS & LOANS

Transparent Micro-Finance Ledger, Instalment Scheduler & Defaulter Tracker

A session-authenticated, strict MVC web platform built with Node.js, Express.js, MongoDB Atlas, and EJS templates—empowering rural Self-Help Groups (SHGs) to record monthly pooled savings, approve micro-loans, automate exact repayment schedules, and flag overdue accounts.

https://shg-sahayak.onrender.com/dashboard
utils/loanCalculator.js // ZERO CENT DRIFT ● Σ due ≡ Total Payable
Principal: ₹12,000 · Rate: 12% p.a. · Tenure: 7 Months
Simple Interest = (12000 × 12 × 7/12) / 100 = ₹840.00
Total Payable = ₹12,840.00 · EMI = ₹1,834.29
INSTALMENT DUE DATE AMOUNT DUE STATUS
#01 – #05 Monthly ₹1,834.29 PAID (UPI)
#06 Past Due ₹1,834.29 OVERDUE FLAG
#07 (Final) Maturity ₹1,834.26* ABSORBS -0.03
TIMELINE
2025 – 2026
ARCHITECTURE
Strict MVC (Express + EJS)
DATABASE & STORE
MongoDB Atlas + connect-mongo
AUTH & SECURITY
express-session · bcryptjs
6x
Mongoose Data Schemas
User, Group, Member, Savings, Loan, Instalment
100%
Exact Cent Reconciliation
Final instalment absorbs rounding drift
2-Role
RBAC Portal Flows
Admin Governance & Member Passbook
4x
Automated Test Suites
Math, HTTP Integration & UPI Tests
01.A // THE PROBLEM STATUS QUO · PAPER PASSBOOK LEDGERS

Rural Self-Help Groups (SHGs) manage collective community funds—pooling recurring monthly deposits and issuing micro-loans—mostly inside handwritten registers. Manual bookkeeping leads to silent reconciliation errors, duplicate entry disputes, and delayed recognition of overdue repayments.

PAIN POINT // 01
Duplicate Savings Entries

Manual registers allow accidental double-recording or skipped months, making member corpus totals hard to verify.

PAIN POINT // 02
EMI Rounding Drift

Dividing principal + simple interest manually over uneven tenures introduces paise discrepancies on final settlement.

PAIN POINT // 03
Hidden Loan Defaults

Identifying overdue instalments requires flipping page-by-page across member passbooks every month.

01.B // MY SOLUTION STRICT MVC LEDGER & AUTOMATED SCHEDULER

I built SHG SAHAYAK—a role-based full-stack MVC web application backed by MongoDB Atlas that enforces atomic monthly savings constraints, auto-generates exact instalment schedules upon loan approval, verifies UPI/cash payments, and gives members a live digital passbook.

SOLUTION // 01
Atomic Compound Index

Enforces unique (memberId, month) database constraints so monthly savings contributions can never be double-logged.

SOLUTION // 02
Exact Loan Scheduler

Computes Simple Interest schedules where the final instalment automatically absorbs cent remainders so totals balance to ₹0.00.

SOLUTION // 03
Auto Defaulter Watch

Flags overdue accounts automatically whenever dueDate < today and auto-closes loans once balance reaches zero.

Architecture
EJS SSR Views (Admin · Member Passbook · Loans) RBAC & connect-mongo Express.js Router & MVC App Core MongoDB Atlas (Mongoose) 6 Collections & Index MVC Domain Controllers Savings Ledger Loan Lifecycle Payment Verify loanCalculator.js & Defaulters Security & Validation bcryptjs + Validators Flash & Error Guard
Σ DUE ≡ PAYABLE

Remainder-Safe Instalment Math

When generating monthly schedules, all values round cleanly to 2 decimal places while the final instalment automatically absorbs any residual cent variance so sums always match total payable.

UNIQUE (memberId, month)

Atomic Monthly Passbook Ledger

Uses a compound Mongoose unique index on (memberId, month) to enforce once-per-month savings deposits while updating cumulative member totals and running balances chronologically.

UPI / CASH / BANK VERIFY

Full Loan & Repayment Lifecycle

Members preview live EMIs across ₹500–₹2,00,000 before submitting. Admin approval spawns sequential instalments; each verified payment recalculates balance and auto-closes settled loans.

EXPRESS-SESSION RBAC

Multi-Role Sessions & Defaulter Watch

Backed by connect-mongo persistent sessions and bcryptjs hashes. Route guards enforce isAdmin / isMember permissions while surfacing overdue defaulters dynamically.

Backend & MVC Framework
Node.js Express.js Strict MVC express-validator
Database & Sessions
MongoDB Atlas Mongoose ODM express-session connect-mongo
Views & Security
EJS Templates Custom CSS / JS bcryptjs Flash Middleware
Testing & Deployment
loanCalculator.test.js integration.test.js httpIntegration.test.js Render Cloud
VERIFIED FINANCIAL INTEGRITY

Automated unit & HTTP integration suites validate Simple Interest math, instalment cent absorption, UPI payment verification, and defaulter state transitions.

0.00 DRIFT
Admin · Sunita Devi
admin@shg.org — Record savings, approve loans, verify UPI payments & manage defaulters.
Member · Anita Sharma
anita@shg.org — Active ₹12,000 loan with overdue instalment scenario for defaulter triage.
Member · Kavita Verma
kavita@shg.org — Pending micro-loan application queued for Admin approval workflow.
Member · Pooja Meena
pooja@shg.org — Completed & closed loan history plus confirmed savings passbook ledger.

Explore SHG SAHAYAK

Launch the live deployed application on Render or browse the complete Express + Mongoose MVC repository on GitHub.