Skip to content

🍽️ Share Plate β€” Food Donation Platform 🀝 A community-powered app that connects food donors (restaurants, households, events) with receivers in need, reducing food waste and fighting hunger. Built with Node.js, Express.js, MongoDB, and Google Maps API for location-based discovery and quick donation coordination. 🌱

Notifications You must be signed in to change notification settings

VAMSHIYADAV46/SHARE-PLATE

Repository files navigation

🍽️ Share Plate

Bridging Food Donors & Receivers - Fighting Food Waste, One Meal at a Time

GitHub Repo Size GitHub Stars Last Commit Issues License

Node.js Express.js MongoDB Google Maps

πŸš€ Live Demo β€’ πŸ“– Documentation β€’ πŸ› Report Bug β€’ ✨ Request Feature


🌟 Introduction

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.

🎯 The Problem

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.

πŸ’‘ Our Solution

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.

πŸš€ What Makes Share Plate Unique

  • πŸ“ 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

✨ Features

🎬 Core Features

  • 🎁 Dual Registration - Easy sign-up for donors & receivers
  • 🍲 Donation Listings - Detailed food descriptions with expiry info
  • πŸ”” Instant Alerts - Push notifications for new donations
  • πŸ—ΊοΈ Interactive Maps - Visual location tracking
  • πŸ’¬ In-App Chat - Direct communication between parties

πŸ›‘οΈ Impact & Benefits

  • 🌍 Reduce Waste - Minimize environmental footprint
  • 🍽️ Feed Communities - Connect surplus with need
  • πŸ“Š Track Impact - Monitor donation statistics
  • πŸ”’ Secure Platform - Verified user system
  • ⚑ Lightning Fast - Real-time data synchronization
  • πŸ’š Social Good - Build compassionate communities

πŸ—οΈ System Architecture

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
Loading

πŸ› οΈ Tech Stack

Category Technology Description
Frontend HTML5 CSS3 JavaScript Core web technologies
Backend Node.js JavaScript runtime environment
Framework Express.js Web application framework
Database MongoDB NoSQL database for flexible data storage
ODM Mongoose MongoDB object modeling
Maps Google Maps Location services and mapping
Authentication JWT Secure token-based authentication
Notifications Nodemailer Email notifications using Nodemailer

πŸ“¦ Installation & Setup

Prerequisites

  • 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

1️⃣ Clone the Repository

git clone https://github.com/VAMSHIYADAV46/share-plate.git
cd share-plate

2️⃣ Install Dependencies

# Install all required packages
npm install

3️⃣ Environment Configuration

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

4️⃣ Google Maps API Setup

  1. Visit Google Cloud Console
  2. Create a new project or select existing one
  3. Enable Maps JavaScript API and Geocoding API
  4. Create API credentials
  5. Add API key to .env file
  6. (Optional) Set API key restrictions for security

5️⃣ Database Setup

# If using local MongoDB, ensure it's running:
mongod

# The application will automatically create collections on first run

6️⃣ Start the Application

# Development mode with auto-restart
npm run dev

# Production mode
npm start

7️⃣ Access the Application

Open your browser and navigate to:

http://localhost:5000

πŸ’» How It Works

πŸ“± User Journey

🎁 For Donors

  1. Register Account

    • Create donor profile
    • Verify contact details
    • Set location preferences
  2. List Food Donation

    • Add food details (type, quantity)
    • Set expiration date/time
    • Upload photos (optional)
    • Mark pickup location
  3. Wait for Match

    • Receive receiver requests
    • Review receiver profiles
    • Approve suitable matches
  4. Coordinate Pickup

    • Chat with receiver
    • Confirm pickup details
    • Complete transaction

🍽️ For Receivers

  1. Register Account

    • Create receiver profile
    • Verify identity
    • Enable location services
  2. Browse Donations

    • View nearby listings
    • Check food details
    • See expiration times
    • View donor ratings
  3. Request Food

    • Send pickup request
    • Wait for approval
    • Get notification on approval
  4. Pickup Food

    • Contact donor
    • Arrange pickup time
    • Collect food
    • Leave feedback

Project Structure

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

πŸ”‘ Key Features Explained

πŸ”” Real-Time Notification System

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

πŸ—ΊοΈ Google Maps Integration

// 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

πŸ“š Learning Outcomes

What This Project Demonstrates:

🎯 Full-Stack Development

  • RESTful API design
  • Real-time communication
  • Database modeling
  • Frontend-backend integration

πŸ—ΊοΈ Location Services

  • Google Maps API integration
  • Geolocation handling
  • Distance calculations
  • Map visualization

πŸ”” Real-Time Features

  • WebSocket implementation
  • Push notifications
  • Live data updates
  • Event-driven architecture

Skills Developed:

  • βœ… 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

πŸ“Š Impact Metrics

Our Goal: Zero Food Waste

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

πŸ—ΊοΈ Roadmap

Phase 1: Foundation βœ…

  • User registration and authentication
  • Basic donation listing
  • Simple matching algorithm
  • Google Maps integration
  • Core dashboard functionality

Phase 2: Enhanced Features 🚧

  • Advanced matching algorithm with AI
  • In-app messaging system
  • Photo upload for donations
  • Rating and review system
  • Email notifications
  • Mobile-responsive improvements

Phase 3: Community Building πŸ“‹

  • User profiles and badges
  • Leaderboard system
  • Social sharing features
  • Community forums
  • Success stories section
  • Impact dashboard for users

Phase 4: Enterprise Features 🎯

  • Mobile apps (iOS & Android)
  • API for third-party integration
  • Scheduled donations
  • Recurring donation routes
  • Business accounts for restaurants
  • Analytics dashboard for organizations

Phase 5: Scale & Impact 🏒

  • Multi-language support
  • International expansion
  • Partnership program
  • Government integration
  • Blockchain for transparency
  • Machine learning for prediction

πŸš€ Deployment Guide

Deploy to Render

  1. Create Web Service:

    Build Command: npm install
    Start Command: npm start
    
  2. 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
    

Deploy to Heroku

# 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

MongoDB Atlas Setup

  1. Create free cluster at MongoDB Atlas
  2. Whitelist all IP addresses (0.0.0.0/0)
  3. Create database user with read/write permissions
  4. Get connection string
  5. Add to environment variables

🀝 Contributing

We believe in the power of community! Join us in fighting food waste and hunger.

How to Contribute

  1. Fork the Repository

    git clone https://github.com/VAMSHIYADAV46/share-plate.git
    cd share-plate
    
  2. Create Feature Branch

    git checkout -b feature/ImpactfulFeature
    
  3. Make Your Changes

    • Follow code style guidelines
    • Write meaningful commit messages
    • Add tests for new features
    • Update documentation
  4. Commit Your Changes

    git add .
    git commit -m "✨ Add ImpactfulFeature: description"
    
  5. Push to Your Fork

    git push origin feature/ImpactfulFeature
    
  6. Open Pull Request

    • Provide clear description
    • Link related issues
    • Include screenshots if applicable

Ways to Contribute

  • πŸ› 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

Code of Conduct

We are committed to providing a welcoming and inclusive environment. Please read our Code of Conduct before contributing.


πŸ› Known Issues & Limitations

  • 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


πŸ“„ License

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...

πŸ™ Acknowledgements

Special Thanks To:

Inspired By:

  • 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

🌍 Our Mission

"No Food Wasted, No One Hungry"

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.


πŸ‘¨β€πŸ’» Author

Mekala Vamshi Yadav

Full-Stack Developer | Social Impact Enthusiast | Sustainability Advocate

GitHub LinkedIn Portfolio


πŸ”— Project Links


πŸ“± Stay Connected

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

⭐ Star this repo if you believe in fighting food waste!

GitHub stars GitHub forks

Built with ❀️ and 🌱 for a Sustainable Future

🍽️ Every Plate Matters - Join the Movement Today! πŸ’š


🌟 Together, We Can Make a Difference!

About

🍽️ Share Plate β€” Food Donation Platform 🀝 A community-powered app that connects food donors (restaurants, households, events) with receivers in need, reducing food waste and fighting hunger. Built with Node.js, Express.js, MongoDB, and Google Maps API for location-based discovery and quick donation coordination. 🌱

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published