An AI-powered platform to reduce food waste and feed communities in real time.
Every day, perfectly good food is wasted while people go hungry.
SurplusFlow bridges this gap by connecting restaurants with NGOs using intelligent logistics and real-time coordination.
🌐 Live Demo: https://surplus-flow.vercel.app
- 🤖 AI-powered decision system (Google Gemini)
- 📍 Real-time NGO matching
- 🔐 OTP-based secure pickup
- 📦 Smart multi-NGO distribution
- 📊 Live tracking and impact dashboard
- Good food gets wasted every day
- NGOs often don’t know where food is available in time
- Pickup coordination is difficult without a unified system
👉 SurplusFlow solves this with real-time posting, AI insights, smart matching, and secure delivery flow.
- Restaurant posts surplus food
- AI analyzes urgency and gives recommendations
- Nearby NGOs receive real-time alerts
- NGO accepts the request
- Pickup is verified using OTP
- Delivery and impact metrics are updated
- Real-time food posting
- Location-based NGO matching
- AI logistics assistant (Gemini)
- OTP-based secure handover
- Live rescue tracking
- Impact dashboard (meals served, food saved, CO₂ reduction)
- Frontend: React + Vite + Tailwind CSS
- Backend: Node.js + Express
- Database: MongoDB
- Authentication: Firebase
- AI: Google Gemini API
- Maps: Google Maps API
- Realtime: Socket.IO + Firebase Cloud Messaging
surplusFlow/
client/ # React frontend
server/ # Node.js/Express backend
## Prerequisites
- Node.js 18+
- npm
- MongoDB database (local or Atlas)
- Firebase project
- Gemini API key
## Installation
### 1) Clone and open project
```bash
git clone <your-repo-url>
cd surplusFlow
cd client
npm installcd ../server
npm installCreate two files:
server/.envclient/.env
# Core
NODE_ENV=development
PORT=5000
MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
# CORS (comma-separated)
ALLOWED_ORIGINS=http://localhost:5173,http://localhost:5174
# Firebase Admin (backend)
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_CLIENT_EMAIL=your_firebase_client_email
FIREBASE_PRIVATE_KEY="-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n"
# AI and notifications
GEMINI_API_KEY=your_gemini_api_key
NEARBY_ALERT_RADIUS_KM=25
DEFAULT_RADIUS_KM=20
MAX_RADIUS_KM=100
# Optional email service
RESEND_API_KEY=your_resend_api_key
MAIL_FROM=SurplusFlow <onboarding@resend.dev>
FRONTEND_URL=http://localhost:5173
# Optional pagination tuning
DEFAULT_PAGE_SIZE=10
MAX_PAGE_SIZE=50Note: Firebase can run in mock mode for local testing if Firebase Admin env values are missing.
VITE_FIREBASE_API_KEY=your_value
VITE_FIREBASE_AUTH_DOMAIN=your_value
VITE_FIREBASE_PROJECT_ID=your_value
VITE_FIREBASE_STORAGE_BUCKET=your_value
VITE_FIREBASE_MESSAGING_SENDER_ID=your_value
VITE_FIREBASE_APP_ID=your_value
VITE_FIREBASE_MEASUREMENT_ID=your_valueOpen two terminals from project root.
cd server
npm run devBackend runs at: http://localhost:5000
cd client
npm run devFrontend runs at: http://localhost:5173
cd client
npm run buildcd server
npm startAfter backend starts, test:
GET http://localhost:5000/health
Expected response includes:
success: true- environment name
- timestamp