You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Donum — NGO Donation & Relief Distribution Platform
A full-stack web and desktop application for managing donations, inventory, relief campaigns, and last-mile distribution for non-governmental organizations.
Version: 2.0 Stack: Java 11 · Servlets 4.0 · JSP/JSTL · MySQL · Maven · Chart.js · Java Swing Type: College Major Project (4th Semester)
When disasters strike — floods, earthquakes, pandemics — NGOs receive thousands of donations (cash and goods) from across the country. Managing this manually leads to:
Wastage: Goods expire in warehouses while people in affected areas go without.
Duplication: Multiple teams send the same item to the same location while other areas get nothing.
No accountability: Donors can't track where their money went. Volunteers don't know which areas are most critical.
No receipts: Donors need tax receipts (Section 80G in India) but NGOs generate them manually.
Disconnected systems: Donations tracked in spreadsheets, inventory on paper, distributions via WhatsApp.
The Solution — Donum
Donum is a centralized platform that digitizes the entire donation-to-distribution pipeline:
DONOR donates ADMIN manages VOLUNTEER delivers
(Cash or Goods) ───▶ (Inventory, Campaigns) ───▶ (Last-mile to locations)
│ │ │
▼ ▼ ▼
Auto PDF Receipt AI Matching Algorithm Auto Inventory Deduction
Campaign Tracking Real-time Analytics Field Notes & History
In one sentence: Donum ensures the right supplies reach the right people at the right time, with full transparency and accountability.
2. Similar Existing Platforms
Donum is inspired by real-world systems used by large organizations:
Platform
Organization
What It Does
How Donum Compares
Humanitarian OpenStreetMap (HOT)
OpenStreetMap
Maps disaster-affected areas for relief coordination
Donum focuses on supply chain, not mapping
ReliefWeb
UN OCHA
Aggregates humanitarian reports and data globally
Donum is operational (manages donations/inventory), not just informational
Kiva
Kiva.org
Crowdfunding platform for micro-loans to underserved communities
Similar donor-facing experience; Donum adds inventory + distribution
GiveDirectly
GiveDirectly.org
Direct cash transfers to extreme poor
Cash donation tracking similar; Donum also handles in-kind goods
NetHope
NetHope.org
Technology solutions for humanitarian organizations
Similar mission; Donum is an actual implementation
Salesforce Nonprofit Cloud
Salesforce
CRM for donor management, fundraising, program tracking
Enterprise-grade equivalent; Donum is open-source and self-hosted
Odoo Humanitarian
Odoo
ERP module for NGO operations (inventory, donations, volunteers)
Closest comparison — Donum is a simplified, focused version
DHIS2
University of Oslo
Health data management for developing countries
Different domain but similar architecture philosophy
What Makes Donum Different
Purpose-built for relief operations — Not a generic CRM adapted for NGOs
AI-powered distribution — Matching algorithm prioritizes by urgency and stock levels
Database triggers — Automatic inventory management (no manual stock updates)
Dual-platform — Web app for all users + Desktop app for admin operations
Self-contained — No external APIs, cloud services, or paid dependencies
3. Feature Overview
3.1 Donor Features
Register and login securely
Donate Cash (monetary) or In-Kind (goods like rice, blankets, medicines)
Select a specific Campaign to donate to (e.g., "Kerala Flood Relief 2025")
Add notes to donations
View complete donation history with status tracking (Received → Allocated → Delivered)
Download branded PDF tax receipts (Section 80G compliant)
Browse active campaigns with progress bars showing how much has been raised
3.2 Admin Features
View 5 real-time stat cards: Total Donations, Cash Raised, Distributions, Pending Requirements, Low Stock Items
Registration flow:
User enters "admin123"
│
▼
PasswordUtil.hashPassword("admin123")
│
▼
BCrypt generates: "$2a$10$N9qo8uLOickgx2ZMRZoMyeIjZAgcfl7p92ldGxad68LJZdL17lhWy"
│ (10 rounds of salted hashing — different hash every time even for same password)
▼
Stored in database `password_hash` column
│
Login flow:
User enters "admin123"
│
▼
PasswordUtil.checkPassword("admin123", stored_hash)
│
▼
BCrypt internally: re-hashes with same salt, compares
│
▼
Returns true/false (password NEVER compared as plain text)
8.2 Session Security
30-minute timeout (configured in both web.xml and LoginServlet)
HttpOnly cookies — JavaScript cannot access session cookies (prevents XSS session theft)
Session invalidation on logout — Prevents session reuse
Anti-cache headers on logout — Prevents back-button showing authenticated pages
8.3 Input Validation (Server-Side)
Every servlet validates all inputs before processing:
Check
Where
Example
Null/empty
All servlets
if (username == null || username.trim().isEmpty())
Length limits
Registration
Password ≥ 6 characters
Email format
Registration
Regex: ^[A-Za-z0-9+_.-]+@(.+)$
Uniqueness
Registration
UserDAO.usernameExists(), emailExists()
Numeric range
Donations
Amount: 0 < amount ≤ 100,000,000
Type checking
Donations
Kind type requires non-empty itemName
Password match
Registration
password equals confirmPassword
8.4 XSS Prevention
All user-provided data displayed in JSPs is escaped:
<!-- UNSAFE (vulnerable to XSS): -->${user.fullName}<!-- SAFE (used throughout Donum): -->${fn:escapeXml(user.fullName)}
This converts <script>alert('hack')</script> into harmless <script>alert('hack')</script>.
8.5 Audit Logging
Every login attempt is recorded:
INSERT INTO audit_log (user_id, action, details, ip_address)
VALUES (?, 'LOGIN', 'User logged in successfully', ?)
9. AI Matching Algorithm
The MatchingAlgorithm.java is the most technically impressive feature. It solves the problem: "Given pending requirements and available inventory, what's the optimal distribution plan?"
9.1 How It Works
INPUT:
- List of pending requirements (what's needed, where, how urgently)
- List of inventory items (what's available, where stored)
PROCESS:
For each requirement:
1. Find all inventory items matching the item name
2. Aggregate available quantity across all warehouses
3. Calculate a PRIORITY SCORE:
Score = Urgency Points + Gap Ratio Points
Urgency Points:
Critical = 40 points
High = 30 points
Medium = 15 points
Low = 5 points
Gap Ratio Points (0-30):
= 30 × (quantity_needed - quantity_fulfilled) / quantity_needed
(Higher gap = higher priority)
4. Determine match type:
FULL → Available ≥ Needed (can fully satisfy)
PARTIAL → Available > 0 but < Needed
NONE → Nothing available
5. Calculate allocation:
allocate = min(available, needed - already_fulfilled)
OUTPUT:
Sorted list (highest score first) with columns:
| Location | Item | Needed | Available | Allocate | Match | Score |
The project demonstrates these advanced SQL concepts (important for viva/evaluation):
14.1 Common Table Expressions (CTEs)
WITH donor_stats AS (
SELECT donor_id, COUNT(*) as donation_count,
SUM(CASE WHEN type='Cash' THEN amount_or_quantity ELSE 0 END) as total_cash
FROM donations GROUP BY donor_id
)
SELECTu.full_name, ds.donation_count, ds.total_cash,
RANK() OVER (ORDER BYds.total_cashDESC) as leaderboard_rank
FROM donor_stats ds JOIN users u ONds.donor_id=u.user_id;
14.2 Window Functions
RANK() OVER (ORDER BY total_cash DESC) as leaderboard_rank
14.3 Correlated Subqueries
SELECT*, (SELECTCOUNT(*) FROM distribution_log dl
WHEREdl.volunteer_id=u.user_id) as total_distributions
FROM users u WHEREu.role='Volunteer';
14.4 CASE Expressions
CASE
WHEN i.quantity<i.min_threshold*0.5 THEN 'CRITICAL'
WHEN i.quantity<i.min_threshold THEN 'LOW'
ELSE 'ADEQUATE'
END as risk_level
14.5 Multi-table JOINs
SELECT d.*, u.full_name, c.nameas campaign_name
FROM donations d
JOIN users u ONd.donor_id=u.user_idLEFT JOIN campaigns c ONd.campaign_id=c.campaign_id;
14.6 Aggregate Functions with GROUP BY
SELECT DATE_FORMAT(donation_date, '%Y-%m') as month,
SUM(CASE WHEN type='Cash' THEN amount_or_quantity ELSE 0 END) as total_cash,
SUM(CASE WHEN type='Kind' THEN amount_or_quantity ELSE 0 END) as total_kind
FROM donations GROUP BY month ORDER BY month;
14.7 FIELD() for Custom Ordering
ORDER BY FIELD(urgency, 'Critical', 'High', 'Medium', 'Low')
15. Desktop Application
A Java Swing desktop app provides admin access for environments where a browser isn't available.
15.1 MainApp (Login)
Dark-themed login window matching the web app's color scheme
Potential enhancements for scaling Donum to production:
Area
Enhancement
Authentication
OAuth 2.0 (Google/GitHub login), JWT tokens
Notifications
Email/SMS alerts for low stock, new donations, distribution confirmations
Maps
Google Maps API integration for requirement locations and warehouse visualization
Mobile App
React Native or Flutter mobile app for field volunteers
Payment Gateway
Razorpay/Stripe integration for real online cash donations
File Uploads
Photo uploads for distribution proof, donor receipts
Multi-language
i18n support (Hindi, Tamil, Telugu, etc.)
Reporting
Exportable Excel/PDF reports with JasperReports
Real-time
WebSocket notifications for live updates
Cloud Deploy
Docker containerization, AWS/GCP deployment
Testing
JUnit tests for DAOs and servlets, Selenium for UI testing
API
Full RESTful API for third-party integrations
License
This is a college project created for educational purposes.
Built with ❤️ for the 4th Semester Major Project
About
A full-stack NGO management platform optimizing the donation-to-distribution pipeline. Features an AI-powered matching algorithm to prioritize disaster relief, automated inventory tracking via MySQL triggers, and branded PDF receipt generation. Built with Java Servlets, JSP, and MySQL.