A humanitarian aid platform connecting charities, camp correspondents, and refugee camp residents - AI-powered sanitary product request management with QR codes, demand heatmaps, and real-time Firebase data.
Refugee camps struggle to communicate sanitary product needs to aid organisations. There is no structured way for residents to submit requests, no real-time visibility for charities on what is needed where, and field workers lack the tools to relay information efficiently.
AidFlow provides an end-to-end digital platform with three user roles:
| Role | What they do |
|---|---|
| Charity Admin | Logs in, generates camp access codes, views demand analytics |
| Camp Correspondent | Enters camp code, generates QR codes, opens chatbot or form |
| Camp Resident | Scans QR code, chats with AI assistant or fills in a form |
- Secure email/password login for charities and correspondents (Firestore + bcrypt)
- Camp access code generation - registered in Firestore, verified on entry
- QR code generator - deep-links residents to their camp's request flow
- AI Health Chatbot - Google Gemini conversational intake, exports structured JSON
- Request form - speech-to-text enabled, pre-fills camp code from QR scan
- Demand heatmap - per-product, per-camp colour-coded analytics table
- Interactive camp map - Leaflet map with risk-level circle markers
- Pad demand prediction - custom ML model forecasts next-month needs
| Layer | Technology |
|---|---|
| Framework | Next.js 16 (App Router + Pages Router), React 19, TypeScript |
| Styling | Tailwind CSS v4 |
| Database | Firebase Firestore |
| Auth | Firebase Admin SDK + bcrypt |
| AI / Chatbot | Google Gemini API (gemini-2.0-flash-lite) |
| ML | Custom Python-trained pad demand prediction model |
| QR Codes | qrcode npm package (client-side canvas, no external API) |
| Maps | Leaflet + React-Leaflet |
/charity/login → /charity/dashboard
- Generate camp access codes (saved to Firestore
campscollection) - View heatmap, camp summary, pad demand prediction, and camp map
- Download QR codes for each camp
user.localhost:3000/group/login → /group/dashboard
- Enter and verify a camp access code against Firestore
- Generate QR code linking residents to
/user/landing?code=CAMPCODE - Open AI chatbot or camp form directly
/user/landing?code=CAMPCODE
├── /chatbot - AI-guided conversational intake
└── /test/camp - Direct request form (code pre-filled)
- Node.js ≥ 18
- Firebase project with Firestore enabled
- Google Gemini API key
cd frontend
npm installCreate frontend/.env.local:
GEMINI_API_KEY=your_gemini_api_key_hereAdd your Firebase service account key at:
frontend/backend/serviceAccountKey.json
cd frontend
npm run dev| URL | Description |
|---|---|
http://localhost:3000/admin |
Admin QR dashboard |
http://localhost:3000/charity/login |
Charity login |
http://localhost:3000/charity/dashboard |
Charity analytics dashboard |
http://user.localhost:3000/group/login |
Correspondent login |
http://user.localhost:3000/group/dashboard |
Correspondent dashboard |
http://localhost:3000/chatbot |
AI health chatbot |
http://localhost:3000/test/camp |
Camp request form |
Subdomain routing: The middleware automatically maps
user.localhost→/user/*paths and root → charity/admin flows.
frontend/
├── src/
│ ├── app/
│ │ ├── api/ # Serverless API routes
│ │ │ ├── charity_login/ # Auth
│ │ │ ├── correspondent_login/
│ │ │ ├── register-camp-code/
│ │ │ ├── verify-camp-code/
│ │ │ ├── submit-request/ # Request creation + AI classification
│ │ │ ├── camp-summary/
│ │ │ ├── heatmap-data/
│ │ │ └── camp-map-data/ # Map + ML prediction
│ │ ├── charity/ # Charity login + dashboard
│ │ ├── chatbot/ # AI chatbot page + Gemini API route
│ │ ├── user/ # Resident & correspondent pages
│ │ └── test/ # Prototype pages (camp form, charity)
│ ├── pages/admin/ # Admin QR dashboard (Pages Router)
│ ├── components/default/ # Shared UI: Navbar, Login, Button
│ └── middleware.ts # Subdomain routing logic
└── backend/
├── firebaseAdmin.js # Firebase Admin SDK init
├── classifyRequest.js # Gemini request classification
├── generateCampCode.js # Random hex code generator
└── getPadPrediction.js # ML model integration
LeicesterCS Hackathon 2025-2026 - Team 8