A full-stack blockchain donation platform built on Stellar/Soroban for transparent charitable giving.
Donations are recorded with geolocation metadata, NGOs submit impact evidence, and transaction flow is backed by smart contracts and a web application stack.
- Smart contracts (Soroban/Rust) for donation flow, NGO verification, escrow, token handling, NFTs, and evidence
- Backend API (Express + TypeScript + Prisma)
- Frontend app (Next.js 14 + TypeScript + React)
- Deployment and utility scripts
Frontend (Next.js)
↓ HTTP
Backend API (Express)
├─ PostgreSQL (via Prisma) OR mock mode (no DATABASE_URL)
├─ Stellar/Soroban integration
├─ IPFS upload + retrieval helpers
├─ Auth (JWT + Google/Firebase + OTP flow)
└─ AI assistant route (Gemini)
/backend Express API + Prisma schema
/frontend Next.js UI
/contracts Soroban smart contracts
/infra Docker compose and infra helpers
/scripts Contract deployment scripts
Under /contracts:
donation_registryngo_verificationimpact_escrowtoken_managernft_mintingevidence
- Node.js 20+
- npm
- PostgreSQL (optional)
- Without
DATABASE_URL, backend falls back to in-memory mock storage for donation/project/NGO API flows - Rust + Stellar CLI (
stellarcommand) for contract development/deployment - You may also see older references to
stellar-cliorsoroban-cli - Freighter wallet extension (for wallet-based flows)
cd backend
cp .env.example .env
npm install
# Optional if using PostgreSQL
npx prisma migrate dev
npm run devBackend default address: http://127.0.0.1:4000
cd frontend
cp .env.example .env.local
npm install
npm run devFrontend default address: http://localhost:3000
Use:
backend/.env.examplefrontend/.env.example
Key backend domains:
- Database:
DATABASE_URL - Auth:
JWT_SECRET, Firebase service account config - Blockchain: Soroban + contract IDs
- Evidence/IPFS: Pinata/IPFS keys
- AI:
GEMINI_API_KEY
Base API prefix: /api (except root GET /health)
GET /health→ use for infra/liveness checks (includes DB connectivity probe)GET /api/health→ use for API-layer status checks (router uptime/timestamp payload)POST /api/auth/googleGET /api/donationsPOST /api/donationsPOST /api/evidence/preparePOST /api/evidence/confirmGET /api/evidence/health(evidence/IPFS integration status)POST /api/chat/messageGET /api/chat/suggestionsGET /api/chat/health(Gemini integration status)
From repo root, see deployment helpers in /scripts, including:
deploy_contracts.shdeploy_phase1_testnet.sh
cd backend
npm run dev
npm run build
npm testSeed or import NGOs:
cd backend
npm run seed:ngos
npm run import:ngos -- --file data/indian-ngos.sample.csv --limit 3For the full India list, download a NGO-DARPAN/NITI Aayog export locally, for example a CSV with headers like unique_id, ngo_name, state_of_registration, district, city_of_registration, field_of_work, and registration_number, then run:
cd backend
npm run import:ngos -- --file data/indian-ngos.csv --source ngo-darpan --status pendingFor smaller curated files with headers like Organization, Link, and Description, use a separate source label:
cd backend
npm run import:ngos -- --file ../datset.csv --source curated-india-ngos --status pendingPreview any CSV without touching the database:
cd backend
npm run import:ngos -- --file ../datset.csv --source curated-india-ngos --dry-runRefresh the local frontend fallback list used when the backend database is unavailable:
node scripts/generate_curated_ngos.mjs datset.csv frontend/public/data/curated-india-ngos.jsonLarge CSV files under backend/data/*.csv are ignored by Git. Keep real registry exports local and commit only small *.sample.csv examples.
cd frontend
npm run dev
npm run build
npm test- Legacy demo wallet API endpoints are retired; current wallet flow is handled through real wallet integration in the frontend donation/auth paths.
- Legacy Firebase hosting config and Firestore exports were removed from the deploy path. Firebase is still used through configured auth credentials where required.
- The root-level
start.shscript exists for local startup orchestration. - Additional docs:
WORKFLOW.md,UI_INTEGRATION.md,DOCUMENTATION.md,DEPLOY.md,QUICKREF.txt.
MIT