Share Plate is a revolutionary community-driven platform designed to combat food waste and hunger simultaneously. By seamlessly connecting food donors with those in need, we're creating a sustainable ecosystem where surplus food finds its way to empty plates instead of landfills.
Every year, billions of tons of food are wasted globally while millions go hungry. The disconnect between those with surplus food and those in need creates an unnecessary paradox. Traditional food donation methods are often inefficient, slow, and lack transparency.
Share Plate bridges this gap with a modern, technology-driven platform that makes food donation as simple as a few clicks. Whether you're a restaurant with excess inventory, a household with surplus groceries, or an organization hosting events, you can instantly connect with verified receivers in your community.
- π Location-Based - Smart geographic matching using Google Maps API
- π Push Notifications - Immediate alerts for new donations
- π± Sustainability Focused - Track your impact on reducing food waste
- π€ Community-Driven - Building networks of caring individuals
- π Verified Users - Safe and trustworthy platform for all parties
|
|
graph TB
subgraph "Client Layer"
A[Web Browser] --> B[HTML/CSS/JS]
B --> C[Responsive UI]
end
subgraph "Application Layer"
D[Express.js Server] --> E[Route Handlers]
E --> F[Controllers]
F --> G[Middleware]
end
subgraph "Authentication"
H[User Auth] --> I[JWT Tokens]
I --> J[Session Management]
end
subgraph "Data Layer"
K[MongoDB] --> L[Donors Collection]
K --> M[Receivers Collection]
K --> N[Donations Collection]
end
subgraph "External Services"
O[Google Maps API] --> P[Geolocation]
P --> Q[Distance Calculation]
R[Notification Service] --> S[Real-time Alerts]
end
A -->|HTTP/WebSocket| D
G -->|Verify| H
F -->|CRUD| K
F -->|Location Services| O
F -->|Send Alerts| R
style A fill:#61dafb,stroke:#000,stroke-width:2px
style D fill:#000000,stroke:#fff,stroke-width:2px
style K fill:#47a248,stroke:#000,stroke-width:2px
style O fill:#4285f4,stroke:#000,stroke-width:2px
style R fill:#ff6b6b,stroke:#000,stroke-width:2px
- Node.js 16.x or higher
- npm or yarn package manager
- MongoDB installed locally or MongoDB Atlas account
- Google Maps API key
- Git installed on your system
git clone https://github.com/VAMSHIYADAV46/share-plate.git
cd share-plate
# Install all required packages
npm install
Create a .env file in the root directory:
# Server Configuration
PORT=5000
NODE_ENV=development
# MongoDB Configuration
MONGODB_URI=mongodb://localhost:27017/shareplate
# Or use MongoDB Atlas:
# MONGODB_URI=mongodb+srv://<username>:<password>@cluster.mongodb.net/shareplate
# Google Maps API
GOOGLE_MAPS_API_KEY=your_google_maps_api_key
# JWT Configuration
JWT_SECRET=your_super_secret_jwt_key_here
JWT_EXPIRE=7d
# Session Configuration
SESSION_SECRET=your_session_secret_key
# Email Configuration (Optional)
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASSWORD=your_email_password
# Application URL
APP_URL=http://localhost:5000
- Visit Google Cloud Console
- Create a new project or select existing one
- Enable Maps JavaScript API and Geocoding API
- Create API credentials
- Add API key to
.envfile - (Optional) Set API key restrictions for security
# If using local MongoDB, ensure it's running:
mongod
# The application will automatically create collections on first run
# Development mode with auto-restart
npm run dev
# Production mode
npm start
Open your browser and navigate to:
http://localhost:5000
|
|
share-plate/
βββ models/
β βββ User.js # User schema (donors & receivers)
β βββ Donation.js # Food donation schema
β βββ Transaction.js # Completed transaction records
βββ routes/
β βββ auth.js # Authentication routes
β βββ donors.js # Donor-specific routes
β βββ receivers.js # Receiver-specific routes
β βββ donations.js # Donation management routes
βββ controllers/
β βββ authController.js # Auth logic
β βββ donorController.js # Donor operations
β βββ receiverController.js # Receiver operations
β βββ donationController.js # Donation management
βββ middleware/
β βββ auth.js # Authentication middleware
β βββ validation.js # Input validation
β βββ errorHandler.js # Error handling
βββ utils/
β βββ geocoding.js # Google Maps integration
β βββ notifications.js # Push notification service
βββ public/
β βββ css/
β β βββ styles.css
β βββ js/
β β βββ map.js # Map functionality
β β βββ notifications.js # Client-side notifications
β βββ images/
βββ views/
β βββ index.html # Landing page
β βββ donor-dashboard.html # Donor interface
β βββ receiver-dashboard.html # Receiver interface
β βββ donation-details.html # Individual donation view
βββ config/
β βββ db.js # Database configuration
βββ server.js # Main application file
βββ package.json
βββ .env.example
βββ README.md
const nodemailer = require("nodemailer");
const { fetchEmails } = require("./database");
// Create Gmail transporter (using App Password)
const transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: process.env.EMAIL_USER,
pass: process.env.EMAIL_PASSWORD,
},
});
// Fetch user emails from DB
async function getEmails() {
return await fetchEmails();
}
// Email body (customized for donation info)
function donationMessage(donation) {
return `
Hello there!
A generous donor just uploaded fresh food on SharePlate:
- Food Item: ${donation.foodName}
- Quantity: ${donation.quantity}
- Freshness: ${donation.freshTime}
- Location: ${donation.location}
- Other Details: ${donation.otherDetails || "N/A"}
Food is available on a first-come, first-served basis β
Join the mission to reduce food waste and help the community!
Best regards,
Team SharePlate π€
`;
}
module.exports = { transporter, getEmails, donationMessage };
Notification Types:
- New donation alerts
- Request approvals/rejections
- Pickup reminders
- Expiration warnings
- Rating requests
// Initialize map with donation markers
function initMap() {
const map = new google.maps.Map(document.getElementById('map'), {
center: userLocation,
zoom: 12
});
donations.forEach(donation => {
new google.maps.Marker({
position: donation.location,
map: map,
title: donation.foodType,
icon: customDonationIcon
});
});
}
Map Features:
- Interactive donation markers
- Distance calculation
- Route visualization
- Cluster management for multiple donations
- Current location tracking
|
|
|
- β Geographic Data - Working with coordinates and location-based queries
- β Real-Time Systems - Socket.IO for instant updates
- β User Authentication - JWT-based secure authentication
- β Database Design - Efficient schema for relational data
- β External APIs - Google Maps integration
- β Notifications - Multi-channel alert system
- β Responsive Design - Mobile-first approach
- β Social Impact - Building solutions for real-world problems
| Metric | Target 2024 | Description |
|---|---|---|
| π½οΈ Meals Saved | 100,000+ | Total meals prevented from waste |
| π₯ Active Users | 10,000+ | Donors and receivers combined |
| π Cities Covered | 50+ | Geographic expansion |
| π’ Partner Organizations | 200+ | Restaurants, NGOs, businesses |
| π± COβ Reduced | 500 tons | Environmental impact |
- User registration and authentication
- Basic donation listing
- Simple matching algorithm
- Google Maps integration
- Core dashboard functionality
- Advanced matching algorithm with AI
- In-app messaging system
- Photo upload for donations
- Rating and review system
- Email notifications
- Mobile-responsive improvements
- User profiles and badges
- Leaderboard system
- Social sharing features
- Community forums
- Success stories section
- Impact dashboard for users
- Mobile apps (iOS & Android)
- API for third-party integration
- Scheduled donations
- Recurring donation routes
- Business accounts for restaurants
- Analytics dashboard for organizations
- Multi-language support
- International expansion
- Partnership program
- Government integration
- Blockchain for transparency
- Machine learning for prediction
-
Create Web Service:
Build Command: npm install Start Command: npm start -
Environment Variables:
NODE_ENV=production MONGODB_URI=your_mongodb_atlas_uri GOOGLE_MAPS_API_KEY=your_google_maps_key JWT_SECRET=your_jwt_secret SESSION_SECRET=your_session_secret
# Login to Heroku
heroku login
# Create app
heroku create share-plate-app
# Add MongoDB Atlas
heroku addons:create mongolab:sandbox
# Set environment variables
heroku config:set GOOGLE_MAPS_API_KEY=your_key
heroku config:set JWT_SECRET=your_secret
# Deploy
git push heroku main
- Create free cluster at MongoDB Atlas
- Whitelist all IP addresses (0.0.0.0/0)
- Create database user with read/write permissions
- Get connection string
- Add to environment variables
We believe in the power of community! Join us in fighting food waste and hunger.
-
Fork the Repository
git clone https://github.com/VAMSHIYADAV46/share-plate.git cd share-plate -
Create Feature Branch
git checkout -b feature/ImpactfulFeature -
Make Your Changes
- Follow code style guidelines
- Write meaningful commit messages
- Add tests for new features
- Update documentation
-
Commit Your Changes
git add . git commit -m "β¨ Add ImpactfulFeature: description" -
Push to Your Fork
git push origin feature/ImpactfulFeature -
Open Pull Request
- Provide clear description
- Link related issues
- Include screenshots if applicable
- π Bug Reports - Help us identify and fix issues
- β¨ Feature Suggestions - Share ideas for new functionality
- π Documentation - Improve guides and tutorials
- π¨ Design - Enhance UI/UX
- π§ͺ Testing - Add test coverage
- π Translation - Help make it accessible globally
- π‘ Spread the Word - Share with your community
We are committed to providing a welcoming and inclusive environment. Please read our Code of Conduct before contributing.
- Google Maps API free tier has usage limits
- Real-time notifications require active internet connection
- Distance calculations are approximate (straight-line, not road distance)
- Image uploads currently limited to 5MB
Report issues at: GitHub Issues
This project is licensed under the MIT License - see the LICENSE file for details.
MIT License
Copyright (c) 2024 Mekala Vamshi Yadav
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, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions...
- π Google Maps Platform - For location services
- π MongoDB - For flexible database solutions
- π’ Node.js Community - For the powerful runtime
- β‘ Express.js - For the web framework
- π Socket.IO - For real-time communication
- π± Food Recovery Network - For inspiration
- π All Contributors - For believing in our mission
- OLIO - Community food sharing app
- Too Good To Go - Fight food waste movement
- Feeding America - Largest hunger-relief organization
- Food Rescue US - Direct food rescue platform
We envision a world where technology bridges the gap between abundance and need, where every meal counts, and where communities come together to create sustainable solutions for food security.
- π Repository: https://github.com/VAMSHIYADAV46/share-plate
- π Documentation: https://github.com/VAMSHIYADAV46/share-plate/wiki
- π Issue Tracker: https://github.com/VAMSHIYADAV46/share-plate/issues
- π¬ Discussions: https://github.com/VAMSHIYADAV46/share-plate/discussions
- π Live Demo: Coming Soon!
Join our community and stay updated:
- π§ Newsletter: Subscribe for updates
- π¬ Discord: Join our community server
- π¦ Twitter: Follow for news and tips
- πΈ Instagram: See our impact stories