Skip to content

Latest commit

Β 

History

24 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’š TrustFund

Trusted Giving, Real Impact

A modern full-stack donation and fundraising platform that connects verified charities, generous donors, and committed volunteers β€” with every rupee tracked from donation to impact through secure authentication, role-based dashboards, and an honest, transparent giving experience.

React TypeScript Vite Django DRF PostgreSQL Razorpay JWT License

πŸ”— Live Demo

TrustFund home β€” platform overview

πŸ“– Project Overview

TrustFund is a full-stack donation and fundraising platform that rebuilds trust in online giving. Donors discover verified charities and active campaigns, give securely through the Razorpay payment gateway, download numbered PDF receipts, and follow their money all the way to impact. Charities manage their organization, verification documents, fundraising campaigns, progress updates, and volunteer opportunities from one dedicated workspace. Volunteers find and join real-world opportunities posted by genuine organizations.

The platform solves the persistent trust gap in online giving:

  • Donors cannot easily tell which organizations are legitimate or where their money goes.
  • Charities lack ready-made tooling for campaigns, donor communication, receipts, and volunteer coordination.
  • Volunteers have no central place to discover opportunities posted by verified organizations.
  • Everyone lacks visible, verifiable proof of impact β€” receipts, updates, and transparent financial totals.

TrustFund answers this with a documented charity verification workflow, enforced campaign lifecycles, atomic payment settlement with idempotency, automatic numbered receipts, and dedicated role-gated workspaces for donors, charities, volunteers, and admins. Built with Django, Django REST Framework, React, and PostgreSQL, it demonstrates a production-grade implementation of JWT authentication, RESTful APIs, role-based access control, payment webhooks, PDF generation, and responsive web design β€” all inside a thoughtfully designed interface.


✨ Key Features

Area Feature What it does Why it matters
πŸ” Authentication Email + password sign-up / login JWT access/refresh tokens with rotation and blacklisting Secure, stateless, revocable sessions
Role-gated registration Users register explicitly as a DONOR, CHARITY, or VOLUNTEER (ADMIN registration is blocked) Clear identity from the very first sign-up
πŸ›οΈ Charity Verification Documented verification workflow Organization profiles move through PENDING β†’ VERIFIED β†’ REJECTED with submit/review/reject/resubmit endpoints Charities must prove legitimacy before they can raise funds
Full audit trail Every verification action is recorded in a verification_logs table Complete accountability for every approval decision
🎯 Campaign Management Validated campaign lifecycle DRAFT β†’ ACTIVE β†’ COMPLETED / EXPIRED / CANCELLED with enforced transitions Terminal states are final β€” no moving the goalposts
Verified-only fundraising Only owners of verified charities can publish ACTIVE campaigns The public feed is gated behind real legitimacy
Public discovery feed Search, category filter, and sort over active campaigns Donors find causes that match their values
πŸ’³ Payments & Donations Secure Razorpay checkout Server-side order creation, signature verification, and webhook handling Payment integrity guaranteed end to end
Atomic, idempotent settlement raised_amount updated with F() + select_for_update inside a transaction; idempotency keys prevent double-counting Retries and duplicate webhooks can never inflate totals
🧾 Receipts Automatic numbered PDF receipts ReportLab generates a unique TRF-YYYYMMDD-XXXXXX receipt for every successful donation Donors get an auditable record of each contribution
πŸ™‹ Volunteers Opportunity publishing & applications Charities post opportunities; volunteers apply with a statement; statuses tracked per side Real-world engagement beyond just money
πŸ”” Notifications Typed in-app notifications Donation, milestone, update, volunteer, and receipt notifications with duplicate protection Donors and charities stay informed without email spam
πŸ“Š Dashboards & Analytics Role-specific dashboards Donor, charity, and admin dashboards plus a public analytics endpoint Every role sees the numbers that matter to them
πŸ› οΈ Admin Console System-wide management Admin UI for charity verifications, users, organizations, campaigns, donations, and audit logs Trust radiation β€” the verification process is transparent

πŸ“Έ Screenshots

All screenshots captured at 1280 Γ— 800 from the running application.

🏠 Home
The platform promise β€” "Every gift, verified.
Every rupee, accounted for."
β€” with hero,
verified charities, and active campaigns.

Home
πŸ”‘ Sign In
Email + password login with
JWT session restore.

Sign In
πŸ“ Register
Role-gated sign-up as
Donor, Charity, or Volunteer.

Register
🎯 Campaign Discovery
Search, category filter, and sort
over active verified campaigns.

Campaigns
πŸ“‹ Campaign Detail
Goal, progress bar, charity info,
updates, and donate call-to-action.

Campaign Detail
πŸ’³ Donation Flow
Razorpay checkout with preset
amounts and custom input.

Donation
🧾 Receipt
Numbered PDF receipt with
payment status and download.

Donation Confirmation
πŸ“Š Donor Dashboard
Lifetime giving, impact summary,
recent donations, and receipts.

Donor Dashboard
πŸ₯ Charity Dashboard
Funds raised, active campaigns,
organization verification status.

Charity Dashboard
πŸ›‘οΈ Admin Dashboard
System-wide verifications,
users, organizations, and audit logs.

Admin Dashboard

πŸ› οΈ Technology Stack

Category Technology Purpose
Frontend React 19 Component-based UI
TypeScript 5.7 Type-safe application code
Vite 6 Build tooling & dev server
React Router 7 Client-side routing, protected routes & role gates
Motion Lightweight UI animation
Backend Django 6 Web framework & ORM
Django REST Framework 3.18 REST API layer
django-environ Environment configuration
django-filter Query filtering for list endpoints
django-cors-headers Cross-origin resource sharing
Auth django-rest-framework-simplejwt 5.5 JWT access/refresh tokens with rotation + blacklist
Database PostgreSQL (via DATABASE_URL) Relational database (Neon in production; SQLite out of the box for local dev)
Async Celery 5 + Redis Background notification dispatch (retrying, broker-aware)
Payments Razorpay Python SDK 1.4 Orders, checkout, signature verification, webhooks
Receipts ReportLab 4.1 Numbered PDF donation receipts
Media Cloudinary Production image storage (optional, disabled by default)
Static / Serving WhiteNoise + gunicorn Production static files & WSGI serving
Testing pytest + pytest-django (backend) Β· Vitest + Testing Library (frontend) Automated coverage of both tiers

πŸ—οΈ System Architecture

                React Frontend (Vite + TypeScript)
                              β”‚
                              β–Ό
              React Router (lazy-loaded, role-gated)
                              β”‚
                              β–Ό
                Typed API Clients (fetch / JWT store)
                └── 401 interceptor β†’ token refresh / logout
                              β”‚
                              β–Ό
          Django REST Framework Backend (gunicorn)
                  └── DRF permissions + CORS allow-list
                              β”‚
      β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
      β–Ό              β–Ό         β–Ό          β–Ό               β–Ό
   Auth          Charities  Campaigns   Donations      Volunteers
 /auth/*        /charities /*          /donations/*   /volunteers/*
(JWT+rotation) (verification) (lifecycle) (Razorpay)  (applications)
      β”‚              β”‚         β”‚          β”‚                β”‚
      β”‚              β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
      β”‚                        β–Ό          β–Ό
      β”‚               PostgreSQL    Razorpay API
      β”‚              (Neon / local)  (orders, webhook)
      β”‚                        β”‚          β”‚
      β”‚                        β–Ό          β–Ό
      └──────────────►  Celery + Redis   Cloudinary
                     (background jobs)  (prod media)

πŸ“‚ Project Structure

TrustFund/
β”‚
β”œβ”€β”€ backend/                         # Django REST Framework API
β”‚   β”œβ”€β”€ config/                      # settings, URL routing, health check, Celery/WSGI entrypoints
β”‚   β”œβ”€β”€ users/                       # Custom User model, roles, JWT auth, permissions
β”‚   β”œβ”€β”€ charities/                   # Organizations + verification workflow
β”‚   β”œβ”€β”€ campaigns/                   # Campaigns, categories, lifecycle, updates
β”‚   β”œβ”€β”€ donations/                   # Donations, Razorpay orders/webhooks, payment services
β”‚   β”œβ”€β”€ receipts/                    # Numbered receipts + PDF generation
β”‚   β”œβ”€β”€ volunteers/                  # Opportunities + applications
β”‚   β”œβ”€β”€ notifications/               # In-app notifications + Celery tasks
β”‚   β”œβ”€β”€ admin_api/                   # Admin-facing endpoints (users, audit logs)
β”‚   β”œβ”€β”€ dashboard/                   # Donor / charity / admin dashboards + analytics
β”‚   β”œβ”€β”€ requirements.txt
β”‚   β”œβ”€β”€ build.sh                     # Render build (install, collectstatic, migrate)
β”‚   └── .env.example
β”‚
β”œβ”€β”€ frontend/                        # React + TypeScript single-page app
β”‚   └── src/
β”‚       β”œβ”€β”€ app/                     # Brand config, central route table
β”‚       β”œβ”€β”€ components/              # Design-system primitives (button, dialog, form, toast, …)
β”‚       β”œβ”€β”€ layouts/                 # Site shell, auth layout, app shell, admin shell
β”‚       β”œβ”€β”€ pages/                   # home, auth, campaigns, donor, charity, volunteer, admin, public
β”‚       β”‚   β”œβ”€β”€ donor/               # Donation history, details, notifications
β”‚       β”‚   β”œβ”€β”€ charity/             # Dashboard, organization, campaigns, updates, volunteers
β”‚       β”‚   β”œβ”€β”€ volunteer/           # Dashboard, opportunities, applications
β”‚       β”‚   β”œβ”€β”€ admin/               # Dashboard, verifications, users, organizations, campaigns, donations, audit logs
β”‚       β”‚   └── campaigns/           # Discovery, detail, donate, donation success
β”‚       β”œβ”€β”€ services/                # Typed API clients (auth, campaigns, donations, receipts, admin, …)
β”‚       β”œβ”€β”€ context/                 # Auth context
β”‚       β”œβ”€β”€ hooks/                   # Reusable UI hooks
β”‚       └── styles/                  # Design tokens + base/utilities
β”‚
β”œβ”€β”€ screenshots/                     # README screenshots (1280 Γ— 800 page captures)
β”œβ”€β”€ README.md
β”œβ”€β”€ LICENSE
└── .gitignore

βš™οΈ Installation & Setup

1️⃣ Prerequisites

  • Python 3.12+ and pip
  • Node.js 18+ and npm
  • (Optional) PostgreSQL and Redis β€” not required to get started; SQLite and eager Celery work out of the box.

2️⃣ Clone the Repository

git clone https://github.com/Aby020/TrustFund.git
cd TrustFund

3️⃣ Set Up the Backend

cd backend

# Create and activate a virtual environment
python -m venv .venv
# Windows (PowerShell):  .venv\Scripts\Activate.ps1
# macOS / Linux:         source .venv/bin/activate

pip install -r requirements.txt

4️⃣ Configure Environment Variables

Inside backend, copy the example file:

cd backend
# Windows:  copy .env.example .env
# macOS/Linux: cp .env.example .env

The safe defaults (SQLite, eager Celery, no Cloudinary) work without editing. For a full breakdown see Environment Variables.

DEBUG=True
DATABASE_URL=sqlite:///db.sqlite3
REDIS_URL=redis://localhost:6379/0

5️⃣ Set Up the Database

cd backend
python manage.py migrate

Optionally seed verified charities and their campaigns:

python manage.py seed_dev_data

6️⃣ Start the Backend Server

cd backend
python manage.py runserver

Backend runs on:

http://localhost:8000

The API is served under http://localhost:8000/api/v1/ with a health check at GET /healthz/.

7️⃣ Set Up the Frontend

Open a new terminal.

cd frontend
npm install

# (Optional) copy the frontend env example; defaults target localhost:8000
#   Windows:  copy .env.example .env
#   macOS/Linux: cp .env.example .env

8️⃣ Start the Frontend

cd frontend
npm run dev

Frontend runs on:

http://localhost:3000

πŸ” Environment Variables

All secrets are environment variables β€” never committed. The repository ships safe .env.example files with placeholders; .env itself is git-ignored.

Backend (backend/.env.example)

Variable Required Purpose Dev default
DEBUG Yes Django debug mode True
SECRET_KEY Yes Django signing key β€” generate a strong random value for production placeholder
ALLOWED_HOSTS Yes Comma-separated allowed hostnames localhost,127.0.0.1
DATABASE_URL Yes PostgreSQL connection string (Neon: append ?sslmode=require) sqlite:///db.sqlite3
REDIS_URL Yes Redis URL (Celery broker) redis://localhost:6379/0
CELERY_BROKER_URL Yes Celery broker URL redis://localhost:6379/1
CELERY_RESULT_BACKEND Yes Celery result backend URL redis://localhost:6379/2
CELERY_TASK_ALWAYS_EAGER No Run Celery tasks synchronously in dev True
CORS_ALLOWED_ORIGINS Yes Frontend origins to allow http://localhost:3000,...
CSRF_TRUSTED_ORIGINS Yes Trusted CSRF origins (must match CORS) http://localhost:3000,...
EMAIL_URL Yes Email backend (console:// in dev, SMTP in prod) console://
RAZORPAY_KEY_ID Yes Razorpay key ID (test key in development) placeholder
RAZORPAY_KEY_SECRET Yes Razorpay key secret (test secret in development) placeholder
RAZORPAY_WEBHOOK_SECRET Yes Razorpay webhook signing secret placeholder
CLOUDINARY_STORAGE_ENABLED No Enable Cloudinary for production media False
CLOUDINARY_CLOUD_NAME / API_KEY / API_SECRET No* Cloudinary credentials (*required only if enabled) empty
SECURE_SSL_REDIRECT No Redirect HTTP to HTTPS (set True in production) False
SESSION_COOKIE_SECURE No Only send session cookies over HTTPS False
CSRF_COOKIE_SECURE No Only send CSRF cookies over HTTPS False

Frontend (frontend/.env.example)

Variable Purpose Dev default
VITE_API_BASE_URL Base URL of the Django API http://localhost:8000
VITE_RAZORPAY_KEY_ID Razorpay public key ID used by checkout rzp_test_xxxxxx

VITE_RAZORPAY_KEY_ID is a public key and is safe to include in the Vite build output.


πŸš€ Running the Project

  1. Start the backend: cd backend && python manage.py runserver β†’ http://localhost:8000
  2. (Optional) Start a Celery worker: cd backend && celery -A config worker -l info
  3. Start the frontend: cd frontend && npm run dev β†’ http://localhost:3000
  4. Open http://localhost:3000 in your browser.

Log in as a DONOR, CHARITY, or VOLUNTEER through the registration flow to explore the role-specific workspaces. Donations in development use Razorpay test keys β€” never live credentials outside a protected production environment.


πŸ”‘ Demo Data (Local Seed)

⚠️ Development only. python manage.py seed_dev_data populates a local database with realistic demo data using a single test-only placeholder password. It is not real β€” use it only against your local SQLite/Postgres, never a production database.

What Count Notes
Verified charity organizations 8 Covering water, education, health, food, relief, animals, poverty, and other causes
Active campaigns 11 Verified charities' campaigns start ACTIVE with goals, locations, and cover images
Demo password 1 Shared TEST_ONLY_PASSWORD placeholder for every seeded charity account

There is no default admin credential β€” the public registration API deliberately blocks ADMIN sign-up (Cannot register as admin. Contact system administrator.). Admin accounts are provisioned by an authorized operator, not through self-registration. If you need admin access locally, create one via the Django shell β€” never commit the password.


πŸ‘₯ User Roles

Capability 🀝 Donor πŸ₯ Charity πŸ™‹ Volunteer πŸ›‘οΈ Admin
Browse public campaigns & charities βœ… βœ… βœ… βœ…
Register / log in βœ… βœ… βœ… ❌ (provisioned)
Donate through Razorpay checkout βœ… ❌ ❌ βœ…
Download numbered PDF receipts βœ… ❌ ❌ βœ…
Manage their organization & verification ❌ βœ… ❌ Review
Create & manage campaigns / updates ❌ βœ… ❌ View
Post & review volunteer opportunities ❌ βœ… ❌ View
Apply to volunteer opportunities ❌ ❌ βœ… ❌
System-wide dashboard & audit logs ❌ ❌ ❌ βœ…

Routes are protected by both ProtectedRoute (JWT) and RequireRole (role check) guards β€” a donor token cannot reach charity or admin endpoints, and vice versa.


πŸ”„ Feature Workflow

πŸ›οΈ Charity Verification Lifecycle

Charity creates organization profile ─► status = PENDING
                                              β”‚
                    Admin reviews documents   β”‚
                          β”œβ”€β”€ Approve ───────► VERIFIED ─► can raise funds
                          └── Reject ────────► REJECTED (reason required)
                                                     β”‚
                                        Charity fixes & resubmits ─► PENDING

Every action (submit / approve / reject / resubmit) is written to the verification_logs audit trail.

🎯 Campaign Lifecycle

Verified charity creates campaign ──► ACTIVE (public feed)
                                              β”‚
                                      Goal reached / deadline passed
                                              β”‚
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β–Ό                         β–Ό                         β–Ό
                COMPLETED                 EXPIRED                    CANCELLED

raised_amount is owned by the donations domain β€” it is never writable through campaign endpoints.

πŸ’³ Donation & Payment Flow

Step Action Result
1 Donor opens a campaign, chooses an amount Backend validates the campaign is ACTIVE, creates a Razorpay order, stores a PENDING donation with a unique idempotency key
2 Frontend launches Razorpay Checkout SDK loaded asynchronously; public key from VITE_RAZORPAY_KEY_ID
3 Donor completes payment Client posts payment_id + signature
4 Signature verified Donation β†’ SUCCESS; campaign raised_amount incremented atomically
5 Webhook arrives (payment.captured / order.paid) Signature-verified and idempotent β€” a duplicate simply no-ops
6 Receipt generated & donor notified Numbered PDF + in-app notification

πŸ™‹ Volunteer Workflow

Charity publishes opportunity ──► Volunteer applies with a statement
                                        β”‚
                      Charities review applications
                    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                    β–Ό                  β–Ό                  β–Ό
                APPROVED           REJECTED            ATTENDED

A volunteer can apply to each opportunity only once. Both sides receive notifications on status changes.


πŸ”Œ API Overview

All routes are served under /api/v1/ and return JSON. Mutating routes validate payloads and enforce object-level authorization. Protected endpoints require a Authorization: Bearer <access-token> header.

πŸ” Authentication β€” /api/v1/auth/

Method Endpoint Description Auth
POST /auth/register/ Register as DONOR, CHARITY, or VOLUNTEER β€”
POST /auth/login/ Sign in, returns access + refresh JWT pair β€”
POST /auth/refresh/ Rotate the access token Refresh token
POST /auth/logout/ Revoke the session (blacklist) βœ…
GET /auth/me/ Current user profile & role βœ…

πŸ›οΈ Charities β€” /api/v1/charities/

Method Endpoint Description Auth
GET /charities/ Public list of verified charities β€”
GET /charities/<id>/ Charity details β€”
POST /charities/create/ Create an organization profile CHARITY
GET /charities/me/ My organization CHARITY
POST /charities/<id>/submit/ Submit for verification CHARITY
POST /charities/<id>/approve/ Approve verification Admin
POST /charities/<id>/reject/ Reject verification (reason required) Admin
POST /charities/<id>/resubmit/ Resubmit after rejection CHARITY
GET /charities/<id>/history/ Verification audit trail Admin / Owner

🎯 Campaigns β€” /api/v1/campaigns/

Method Endpoint Description Auth
GET /campaigns/ Discovery feed (search, category, sort) β€”
GET /campaigns/<id>/ Campaign detail β€”
POST /campaigns/ Create a campaign (verified charity) CHARITY
PATCH /campaigns/<id>/ Update own campaign CHARITY
GET / POST /campaigns/updates/ Global campaign updates β€” / Auth
GET / POST /campaigns/<id>/updates/ Updates for one campaign β€” / CHARITY

πŸ’³ Donations β€” /api/v1/donations/

Method Endpoint Description Auth
POST /donations/ Initialize a donation (creates Razorpay order) βœ…
GET /donations/ My donation history βœ…
POST /donations/<id>/verify_payment/ Verify signature & settle donation βœ…
POST /donations/webhook/ Razorpay webhook (idempotent) Signature

🧾 Receipts β€” /api/v1/receipts/

Method Endpoint Description Auth
GET /receipts/ My receipts βœ…
GET /receipts/<id>/ Receipt detail βœ…
GET /receipts/<id>/download_pdf/ Download the numbered PDF receipt βœ…

πŸ™‹ Volunteers β€” /api/v1/volunteers/

Method Endpoint Description Auth
GET /volunteers/opportunities/ Open opportunities β€”
POST /volunteers/opportunities/ Publish an opportunity CHARITY
GET / POST /volunteers/applications/ List / create applications βœ… / VOLUNTEER
PATCH /volunteers/applications/<id>/ Update application status CHARITY

πŸ“Š Dashboards & Admin β€” /api/v1/

Method Endpoint Description Auth
GET /dashboard/donor/ Donor impact & lifetime giving DONOR
GET /dashboard/charity/ Charity funds raised across campaigns CHARITY
GET /dashboard/admin/ System-wide metrics Admin
GET /dashboard/analytics/ Public analytics (donations by category, success rates) β€”
GET /admin/users/ Admin user directory Admin
GET /admin/audit-logs/ Admin audit log Admin
GET /notifications/ My notifications βœ…

Example β€” login and use a protected endpoint:

# 1. Obtain tokens
curl -X POST https://trustfund-backend-jexv.onrender.com/api/v1/auth/login/ \
  -H "Content-Type: application/json" \
  -d '{"email":"you@example.com","password":"your-password"}'

# 2. Call a protected endpoint with the access token (exported as $TOKEN)
curl https://trustfund-backend-jexv.onrender.com/api/v1/auth/me/ \
  -H "Authorization: Bearer $TOKEN"

πŸ—„οΈ Database Overview

The schema is organized into per-domain Django apps, all reconciled through python manage.py migrate. PostgreSQL is used in production (DATABASE_URL); SQLite works out of the box locally.

App Core models Purpose
users User Custom user with email login and a mandatory role field (DONOR | CHARITY | VOLUNTEER | ADMIN)
charities CharityOrganization, VerificationLog Organization profiles + the PENDING β†’ VERIFIED / REJECTED workflow with full audit history
campaigns Campaign, CampaignCategory, CampaignUpdate Fundraising campaigns with enforced lifecycle, goals, locations, and progress updates
donations Donation Payments with status, idempotency key, Razorpay references, and atomic settlement
receipts Receipt Numbered receipts (TRF-YYYYMMDD-XXXXXX) linked to successful donations
volunteers VolunteerOpportunity, VolunteerApplication Opportunities + applications with a per-opportunity uniqueness rule
notifications Notification Typed in-app notifications with duplicate protection
dashboard / admin_api β€” (query/aggregation only) Role analytics and admin-facing reads

Key integrity rules enforced at the database layer:

Campaign.goal_amount  > 0                        (check constraint)
Campaign.raised_amount  not user-writable         (owned by donations domain)
VolunteerApplication  unique (volunteer, opportunity)
Donation.idempotency_key  unique                 (webhook/retry safety)
Charity verification  only admins approve/reject  (a charity cannot verify itself)

πŸ”’ Security Features

Feature Implementation
JWT authentication Access/refresh token pair from SimpleJWT with rotation and blacklisting
Deny-by-default authorization DRF default is IsAuthenticated; public read endpoints opt in explicitly
Role-based access control Frontend RequireRole guards + backend role/permission checks on every endpoint
Object-level authorization Charities manage only their own org/campaigns; verification approve/reject is admin-only
Password hashing Django password hashers β€” nothing stored in plaintext
Payment integrity Server-side signature verification for checkout and webhooks; idempotency keys; F() + select_for_update atomic raised_amount updates
Secure secrets SECRET_KEY, DATABASE_URL, Razorpay, and Cloudinary credentials read from environment only
Secure cookies in production SESSION_COOKIE_SECURE, CSRF_COOKIE_SECURE, SECURE_SSL_REDIRECT, and SECURE_PROXY_SSL_HEADER enabled behind the Render TLS proxy
No secrets in code .env is git-ignored; only placeholder .env.example files are tracked

πŸš€ Future Enhancements

  • πŸ€– ML / Intelligence Layer β€” donation-trend analytics, smart campaign recommendations, anomaly detection, and fraud signals (planned, not yet implemented)
  • πŸ’³ Recurring donations β€” scheduled giving and one-tap repeat donations
  • 🧾 Region-specific receipts β€” India / U.K. tax-receipt formatting
  • 🌍 Richer campaign discovery β€” location, impact tags, and advanced filters
  • πŸ“ˆ Verified impact reporting β€” per-campaign impact stories and public transparency pages
  • πŸ”Š Email notifications β€” donation confirmations, milestones, and volunteer updates
  • 🐳 Docker deployment β€” containerized backend, frontend, worker, and database
  • 🌐 API documentation β€” OpenAPI / Swagger specification
  • βœ… Penetration testing β€” a formal security assessment before public launch

🌟 Project Highlights

  • Trust by design β€” charities must pass a documented verification workflow before they can raise funds; every decision is audited
  • Money that can't be faked β€” raised_amount is owned by the donations domain and settled atomically with idempotency against webhook replays
  • Paper trail for every gift β€” automatic numbered PDF receipts give donors an auditable record
  • Four role-gated experiences β€” dedicated workspaces for donors, charities, volunteers, and admins with strict access separation
  • Full-stack, production-shaped β€” Django 6 + DRF on the backend, React 19 + TypeScript on the frontend, deployed to Render with Neon PostgreSQL
  • Tested on both tiers β€” pytest + pytest-django suites for the backend and Vitest + Testing Library for the frontend, plus strict tsc typechecking in the build
  • Honest roadmap β€” planned features are clearly marked as planned, never presented as shipped

πŸ“„ License

This project is licensed under the MIT License.

See the LICENSE file for more information.


πŸ‘¨β€πŸ’» Author

Abi Thomas

Backend Developer | Python, Django & Node.js Developer

Passionate about building scalable backend systems, RESTful APIs, modern web applications, and production-ready software using Python, Django, Node.js, Express.js, PostgreSQL, and React.

⭐ Support

If you found this project helpful, please consider giving it a ⭐ on GitHub.

Your support motivates me to continue building and improving high-quality open-source software.

If you have suggestions, feedback, or would like to collaborate, feel free to connect with me on GitHub or LinkedIn.

About

TrustFund is a full-stack Charity & Donation Management Platform that connects donors, verified charities, and volunteers in one secure and transparent ecosystem.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages