Transform Waste Into Opportunity
A comprehensive waste management platform connecting waste generators with environmental champions and waste collection professionals.
Live Demo β’ Documentation β’ Report Bug β’ Request Feature
- Overview
- Key Features
- Screenshots
- Tech Stack
- Architecture
- Getting Started
- Environment Variables
- AI Integration
- API Documentation
- Database Schema
- PWA Features
- Deployment
- Contributing
- Team
- License
WasteNexus is a cutting-edge waste management platform that revolutionizes how communities handle waste collection and recycling. By connecting three key stakeholders - Clients (waste generators), Champions (environmental organizers), and Workers (collection professionals) - we create a sustainable ecosystem that rewards responsible waste management.
Reduce landfill waste, create environmental impact, and build a sustainable future by making waste management accessible, rewarding, and efficient.
- π Sustainability First: Every feature designed to reduce environmental impact
- π° Reward-Based: Gamification through points, badges, and leaderboards
- π€ AI-Powered: Smart waste classification using Google Gemini AI
- π± Mobile-First: Progressive Web App for seamless mobile experience
- π Secure: Role-based access control and JWT authentication
- πΈ Report Waste with AI-powered classification
- π Location Picker with auto-detect and manual selection
- π Earn Rewards - points for every kg of waste reported
- ποΈ Unlock Badges and climb the leaderboard
- πͺ Join Events - participate in community cleanup activities
- πΌ Post Jobs for waste collection services
- ποΈ Marketplace - buy and sell recyclable items
- π Create & Manage Events - organize cleanup drives
- β Verify Reports - review and approve waste submissions
- π Track Participation - monitor community engagement
- π Earn Points for organizing successful events
- π Analytics Dashboard - view event statistics
- π View Verified Reports filtered by location (20km radius)
- β Complete Tasks - mark reports as collected
- π΅ Browse Jobs - find waste collection opportunities
- π° Track Earnings - monitor completed tasks
- π Location-Based Filtering - see only nearby reports
- π Work Statistics - view performance metrics
- π₯ User Management - manage all user roles
- πͺ Marketplace Moderation - approve/reject listings
- π Analytics & Reports - platform-wide insights
- πͺ Event Management - oversee all events
- πΌοΈ Gallery Management - showcase success stories
- πΌ Job Verification - review job postings
- π§Ύ Transaction Monitoring - track all point transactions
- π· Worker Applications - verify worker registrations
- Framework: Next.js 15.5.5 (App Router, React 19, Turbopack)
- Language: TypeScript 5
- Styling: Tailwind CSS 4 + Framer Motion
- UI Components: Radix UI + Custom Components
- Form Handling: React Hook Form + Zod
- Maps: @react-google-maps/api
- Icons: Lucide React + @tabler/icons-react
- Notifications: Sonner
- PWA: next-pwa
- Runtime: Node.js with Next.js API Routes
- Database: MongoDB with Mongoose ODM
- Authentication: JWT + bcryptjs
- File Upload: Cloudinary
- AI Integration: Google Gemini AI (vision & text models)
- Email: Nodemailer
- Version Control: Git & GitHub
- Package Manager: npm
- Linting: ESLint 9
- Code Formatting: Prettier (via ESLint)
- Build Tool: Turbopack (Next.js 15)
- Deployment: Vercel / Netlify
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client Layer (Browser) β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Next.js β β React 19 β β TailwindCSS β β
β β App Router β β Components β β Styling β β
β ββββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β API Layer (Next.js) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Route Handlers (app/api/*) β β
β β ββ /auth/* - Authentication β β
β β ββ /client/* - Client operations β β
β β ββ /champion/* - Champion operations β β
β β ββ /worker/* - Worker operations β β
β β ββ /admin/* - Admin operations β β
β β ββ /upload/* - File uploads (Cloudinary) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Business Logic Layer β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
β β Auth (JWT) β β Rewards β β AI Service β β
β β Middleware β β System β β (Gemini) β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Data Layer (MongoDB) β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Collections: β β
β β ββ users - User accounts & profiles β β
β β ββ reports - Waste reports β β
β β ββ events - Community events β β
β β ββ jobs - Waste collection jobs β β
β β ββ transactions - Point transactions β β
β β ββ marketplaceItems - Recyclable items β β
β β ββ gallery - Success stories β β
β β ββ workerApplications - Worker registrations β β
β β ββ workerTasks - Assigned collection tasks β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
User Action β Next.js Page β API Route β Auth Middleware β
Business Logic β Database (Mongoose) β Response β UI Update
- Node.js 20+ and npm
- MongoDB instance (local or Atlas)
- Cloudinary account for image uploads
- Google Maps API key
- Google Gemini API key
-
Clone the repository
git clone https://github.com/SagarSuryakantWaghmare/wastenexus.git cd wastenexus -
Install dependencies
npm install
-
Set up environment variables
Create a
.env.localfile in the root directory:cp .env.example .env.local
Fill in all required variables (see Environment Variables)
-
Run database migrations (if needed)
npm run migrate-coordinates
-
Start development server
npm run dev
-
Open your browser
Navigate to http://localhost:3000
# Build the application
npm run build
# Start production server
npm start# Add admin users
npm run add-admins
# Test email configuration
npm run test:email
# Validate SEO
npm run seo:validate
# Run Lighthouse CI
npm run lighthouseCreate a .env.local file with the following variables:
# App
NEXT_PUBLIC_BASE_URL=http://localhost:3000
NODE_ENV=development
# MongoDB
MONGODB_URI=mongodb://localhost:27017/wastenexus
# OR for MongoDB Atlas:
# MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/wastenexus
# JWT Secret (generate a strong random string)
JWT_SECRET=your-super-secret-jwt-key-change-this-in-production# Cloudinary (for image uploads)
CLOUDINARY_CLOUD_NAME=your-cloud-name
CLOUDINARY_API_KEY=your-api-key
CLOUDINARY_API_SECRET=your-api-secret
# Google Maps
NEXT_PUBLIC_GOOGLE_MAPS_API_KEY=your-google-maps-api-key
# Google Gemini AI
GEMINI_API_KEY=your-gemini-api-key
# Email (Nodemailer - Gmail example)
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your-email@gmail.com
EMAIL_PASS=your-app-password
EMAIL_FROM=WasteNexus <noreply@wastenexus.com># Analytics
NEXT_PUBLIC_GA_ID=G-XXXXXXXXXX
# PWA
NEXT_PUBLIC_MANIFEST_URL=/manifest.json
β οΈ Security Note: Never commit.env.localto version control. Add it to.gitignore.
WasteNexus leverages Google Gemini AI for intelligent waste classification:
-
πΌοΈ Vision-Based Classification
- Upload waste images for automatic type detection
- Returns waste type, confidence score, and recyclability status
- Provides detailed descriptions and handling recommendations
-
π― Smart Categorization
- Classifies into: Plastic, Paper, Glass, Metal, E-Waste, Organic, Mixed
- Confidence threshold validation (minimum 60%)
- Fallback to manual selection if confidence is low
-
π‘ Implementation
// lib/gemini.ts
import { GoogleGenerativeAI } from '@google/generative-ai';
const genAI = new GoogleGenerativeAI(process.env.GEMINI_API_KEY!);
export async function classifyWaste(imageUrl: string) {
const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash" });
const prompt = `Analyze this waste image and classify it...`;
const result = await model.generateContent([prompt, imagePart]);
// Returns: { type, confidence, description, recyclable }
}POST /api/upload/image
Content-Type: multipart/form-data
Body: { image: File }
Response: {
success: true,
imageUrl: "https://...",
classification: {
type: "Plastic",
confidence: 0.95,
description: "PET bottle, recyclable",
recyclable: true
}
}All protected routes require JWT token in Authorization header:
Authorization: Bearer <your-jwt-token>
POST /api/auth/signup- Register new userPOST /api/auth/login- Login user (returns JWT)
GET /api/user- Get current user profilePATCH /api/user/profile- Update profileGET /api/user/transactions- Get point transactions
POST /api/reports- Submit waste reportGET /api/reports- Get user's reports
GET /api/admin/reports- List all reportsPOST /api/reports/[id]/verify- Verify report (awards points)
GET /api/events- List public eventsPOST /api/events- Create event (Champion)GET /api/events/[id]- Get event detailsPOST /api/events/[id]/join- Join eventGET /api/events/mine- Get user's created events
GET /api/jobs- Browse jobsPOST /api/jobs- Create job (Client)
GET /api/marketplace- List items (with filters)POST /api/marketplace- Create listingGET /api/marketplace/[id]- Item detailsPOST /api/marketplace/[id]/buy- Purchase item
GET /api/worker/verified-reports- List verified reports (location-filtered)POST /api/worker/complete-report- Mark report as collectedGET /api/worker/tasks- Get assigned tasksGET /api/worker/jobs- Browse available jobs
GET /api/admin/users- User managementDELETE /api/admin/users- Delete userGET /api/admin/dashboard-stats- Platform statisticsGET /api/admin/marketplace/pending- Pending listingsPOST /api/admin/marketplace/[id]/verify- Approve listingGET /api/admin/worker-applications- Worker applicationsPOST /api/admin/worker-applications/[id]- Verify worker
Success:
{
"success": true,
"data": { ... },
"message": "Operation successful"
}Error:
{
"error": "Error message",
"details": { ... }
}{
_id: ObjectId,
name: string,
email: string (unique),
password: string (hashed),
role: 'client' | 'champion' | 'admin' | 'worker',
profileImage?: string,
totalPoints: number,
createdAt: Date,
updatedAt: Date
}{
_id: ObjectId,
userId: ObjectId (ref: User),
type: 'Plastic' | 'Paper' | 'Glass' | 'Metal' | 'E-Waste' | 'Organic' | 'Mixed',
weightKg: number,
imageUrl?: string,
location: {
address: string,
latitude: number,
longitude: number,
coordinates?: { lat: number, lng: number }
},
status: 'pending' | 'verified' | 'rejected',
pointsAwarded: number,
verifiedBy?: ObjectId (ref: User),
verifiedAt?: Date,
createdAt: Date,
updatedAt: Date
}{
_id: ObjectId,
championId: ObjectId (ref: User),
title: string,
description: string,
location: string,
locations: string[],
date: Date,
images: string[],
maxParticipants: number,
participants: ObjectId[] (ref: User),
status: 'upcoming' | 'ongoing' | 'completed' | 'cancelled',
pointsReward: number,
createdAt: Date,
updatedAt: Date
}{
_id: ObjectId,
clientId: ObjectId (ref: User),
title: string,
description: string,
category: 'industry' | 'home' | 'other',
location: {
address: string,
coordinates: { lat: number, lng: number }
},
wasteType: string[],
estimatedWeight?: number,
budget?: number,
urgency: 'low' | 'medium' | 'high',
status: 'open' | 'in-progress' | 'completed' | 'cancelled',
applicants: ObjectId[] (ref: User),
assignedTo?: ObjectId (ref: User),
createdAt: Date,
updatedAt: Date
}{
_id: ObjectId,
sellerId: ObjectId (ref: User),
title: string,
description: string,
category: 'Electronics' | 'Furniture' | 'Kitchen' | 'Books' | 'Clothing' | 'Other',
price: number,
condition: 'new' | 'like-new' | 'good' | 'fair' | 'poor',
images: string[],
location: string,
status: 'pending' | 'active' | 'sold' | 'rejected',
views: number,
favorites: ObjectId[] (ref: User),
createdAt: Date,
updatedAt: Date
}{
_id: ObjectId,
userId: ObjectId (ref: User),
type: 'waste_report' | 'event_participation' | 'event_organization' | 'job_completion' | 'admin_adjustment',
amount: number,
description: string,
relatedId?: ObjectId,
createdAt: Date
}{
_id: ObjectId,
name: string,
email: string,
phone: string,
address: string,
photo?: { public_id: string, secure_url: string },
aadhaarCard?: { public_id: string, secure_url: string },
status: 'pending' | 'verified' | 'rejected',
rejectionReason?: string,
userId?: ObjectId (ref: User),
appliedAt: Date,
verifiedAt?: Date,
verifiedBy?: ObjectId (ref: User)
}{
_id: ObjectId,
reportId: ObjectId (ref: Report),
workerId: ObjectId (ref: User),
status: 'assigned' | 'in-progress' | 'completed',
assignedDate: Date,
startedDate?: Date,
completedDate?: Date,
createdAt: Date,
updatedAt: Date
}WasteNexus is a Progressive Web App with offline capabilities:
- β Installable - Add to home screen on mobile/desktop
- β Offline Support - Service worker caching
- β Push Notifications (planned)
- β Background Sync (planned)
- β App-like Experience - Full-screen mode
{
"name": "WasteNexus",
"short_name": "WasteNexus",
"description": "Transform Waste Into Opportunity",
"start_url": "/",
"display": "standalone",
"background_color": "#ffffff",
"theme_color": "#10b981",
"icons": [
{
"src": "/icons/icon-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "any maskable"
},
{
"src": "/icons/icon-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "any maskable"
}
]
}The app shows a custom install prompt after:
- β 10 seconds initial delay
- β 24-hour cooldown between prompts
- β User dismissal tracking
-
Push to GitHub
git push origin main
-
Import to Vercel
- Go to vercel.com
- Import your GitHub repository
- Configure environment variables
- Deploy!
-
Configure Domains
- Add custom domain in Vercel settings
- Update
NEXT_PUBLIC_BASE_URLin environment variables
- Build Command:
npm run build - Publish Directory:
.next - Environment Variables: Add all from
.env.local
# Build the app
npm run build
# Start with PM2
pm2 start npm --name "wastenexus" -- startWe welcome contributions! Here's how you can help:
-
Fork the repository
git clone https://github.com/YOUR_USERNAME/wastenexus.git
-
Create a feature branch
git checkout -b feature/amazing-feature
-
Make your changes
- Follow the existing code style
- Add tests if applicable
- Update documentation
-
Commit your changes
git commit -m "Add amazing feature" -
Push to your fork
git push origin feature/amazing-feature
-
Open a Pull Request
- Describe your changes clearly
- Reference any related issues
- TypeScript: Strict mode enabled
- Formatting: ESLint + Prettier
- Naming: camelCase for variables, PascalCase for components
- Commits: Follow Conventional Commits
- π Bug Fixes - Report and fix bugs
- β¨ Features - Add new functionality
- π Documentation - Improve docs
- π¨ UI/UX - Enhance user interface
- βΏ Accessibility - Make the app more accessible
- π Internationalization - Add language support
- β‘ Performance - Optimize speed and efficiency
|
Sagar Suryakant Waghmare Full Stack Developer GitHub |
Aakash Sonar Database Designer GitHub |
Soham Pawar Frontend Developer GitHub |
Sagar Suryakant Waghmare - Full Stack Developer
- ποΈ Architecture & system design
- π» Frontend development (Next.js, React, TailwindCSS)
- π§ Backend development (API routes, authentication)
- π€ AI integration (Google Gemini)
- π± PWA implementation
- π DevOps & deployment
Aakash Sonar - Database Designer
- ποΈ MongoDB schema design
- π Data modeling & optimization
- π Query performance tuning
- π Data security & validation
- π Database scaling strategies
Soham Pawar - Frontend Developer
- π¨ UI/UX-focused interface design
- β‘ Performance-optimized frontend development
- π§© Reusable component architecture
- π οΈ Debugging & issue resolution
- π Continuous improvement & modern tech adoption
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2025 WasteNexus Team
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction...
- Google Gemini AI - For intelligent waste classification
- Cloudinary - For image hosting and optimization
- MongoDB - For flexible database solutions
- Vercel - For seamless deployment
- Next.js Team - For the amazing framework
- Open Source Community - For incredible tools and libraries
- GitHub Issues: Report a bug
β Star this repo if you find it helpful!
Report Bug Β· Request Feature Β·
Β© 2025 WasteNexus. All rights reserved.