Skip to main content
Fredrick M.
Back to Work
Sep 20, 2025

Student Welfare Management System

Full-stack welfare management platform

ReactJavaScriptNode.jsExpressMongoDBMongooseJWTM-Pesa Daraja APITailwind CSS

Note: The source code for this project is split across two repositories to enforce a strict separation of concerns. You can view the Frontend Repository here, which also contains links and instructions for the Backend Repository.

The Problem: Modernizing Welfare Management

Kabarak University prioritizes student welfare, offering financial assistance during emergencies such as medical crises or academic hardships. However, the legacy welfare management practices were outdated and unsustainable. Contributions were coordinated through informal WhatsApp groups, prompting students to send funds directly to peers via personal M-Pesa accounts.

This decentralized approach lacked oversight, making it impossible to verify the legitimacy of cases, track contributions accurately, or audit fund flows. Manual record-keeping in spreadsheets resulted in frequent errors and delayed support, ultimately eroding community trust.

The Solution: Centralized & Automated

To resolve these challenges, I designed and developed an automated Welfare Management System (WMS). The WMS replaces fragmented, error-prone manual processes with a unified platform. By centralizing contributions through a secure M-Pesa Paybill integration, automating record-keeping, and providing real-time tracking, the system restores transparency, reduces administrative burdens, and accelerates support delivery.

Technology Stack

The system employs a standard three-tier architectural pattern (presentation, application, data) to ensure modularity, maintainability, scalability, and security.

Frontend (Presentation Tier)

  • Framework: React 18, Vite
  • Styling: Tailwind CSS, Ant Design (tailored to Kabarak University's color palette)
  • Routing: React Router DOM
  • HTTP Client: Axios with interceptors for automatic JWT injection and uniform error handling

Backend (Application Tier)

  • Framework: Node.js with Express.js
  • Architecture: RESTful API handling authentication, business logic, and third-party integrations
  • Payment Gateway: M-Pesa Daraja API (STK Push and asynchronous callbacks)
  • Security: JWT (JSON Web Tokens) for authentication, bcrypt for password hashing, and strict role-based access control (RBAC)

Database (Data Tier)

  • Database: MongoDB (NoSQL document database)
  • ODM: Mongoose for data modeling and query optimization

Core Modules & Design Architecture

1. User Management & Role-Based Access

The system supports two primary roles: Administrator and Student (Member). User registration is strictly controlled to ensure security and compliance. Administrators pre-load student data, and students activate their accounts using verified Kabarak University email addresses. Secure session management is handled via JWT.

2. Contribution Management (M-Pesa Integration)

The core innovation of the WMS is its centralized payment collection, completely eliminating the risks of peer-to-peer transfers.

  • STK Push Initiation: Members initiate contributions via an M-Pesa Express (STK Push) prompt directly on their mobile phones.
  • Asynchronous Callbacks: The Node.js backend processes callbacks from the Daraja API to verify payment completion, automatically updating campaign totals in the MongoDB database in real time.

3. Case Management

This module digitizes the entire lifecycle of a welfare case.

  • Submission: Students submit detailed assistance requests along with supporting documentation.
  • Verification & Approval: Administrators review requests against established criteria. Approved cases are published as active fundraising campaigns visible to all verified members.

4. Admin Dashboard & Reporting

Administrators have access to a comprehensive dashboard for data-driven decision-making. Features include monitoring live fund statistics, executing secure disbursements, and generating large-scale CSV reports on contributions and system usage.

Research & Development Methodology

The project was grounded in a mixed-methods action research design, strategically combining qualitative and quantitative techniques. Development followed an iterative and incremental approach, blending Agile and Waterfall principles to respond to evolving user needs.

  1. Requirements Elicitation: Conducted via stakeholder interviews, focus groups, and surveys to understand the exact pain points of the manual WhatsApp-based system.
  2. System Design: Created comprehensive Use Case Diagrams, Data Flow Diagrams (DFDs), and Entity-Relationship Diagrams (ERDs) to map out data processing and user interaction.
  3. Iterative Implementation: Development was broken into distinct iterations, starting with core user and contribution management (M-Pesa integration), followed by case management and reporting.

Rigorous Testing & Impact

A comprehensive testing strategy was implemented to ensure system reliability and security:

  • Unit & Integration Testing: Frontend components (Jest) and Backend logic (Mocha/Chai) achieved over 92% code coverage. Integration tests simulated edge cases like M-Pesa API timeouts.
  • System & E2E Testing: End-to-end tests (Cypress) covered complete user workflows, achieving a 99% pass rate across critical scenarios.
  • User Acceptance Testing (UAT): Conducted with university administrators and students, the system achieved a System Usability Scale (SUS) score of 85/100 ("Excellent" usability).

Measurable Results

The automated WMS successfully addressed the critical limitations of the previous manual system, delivering quantifiable improvements:

  • Processing Time: Reduced average contribution processing time from roughly 3 hours (manual) to under 2 seconds.
  • Case Resolution: Estimated case resolution time dropped from 10 days to under 2 days.
  • Data Accuracy: Error rates in contribution records dropped from an estimated 15% to less than 0.1%.
  • Enhanced Security & Trust: Eliminated direct student-to-student transfers, routing all funds through a centralized, auditable system. Both students and administrators now have real-time visibility into campaign progress, fostering greater community trust.