PlateShare is a full-stack community platform designed to reduce food waste and help those in need. It allows food donors to list surplus meals, which hungry individuals or organizations can browse and request. This repository contains the Backend (Server-Side) code built with Node.js and Express.
The primary mission of PlateShare is to bridge the gap between food abundance and food scarcity. By providing a real-time, transparent platform, we empower community members to share resources efficiently and securely.
- Dynamic Food Listings: Real-time visibility of available food items sorted by quantity and expiration.
- Secure Authentication: JWT-based verification using Firebase Admin SDK for all sensitive operations.
- Request Management: Seamless flow for requesting food and tracking the status of those requests.
- User Profiles: Personalized dashboards for donors to manage their contributions.
- Search & Filter: Advanced querying by food name, location, and status.
- Runtime: Node.js
- Framework: Express.js
- Database: MongoDB Atlas
- Authentication: Firebase Admin SDK
- Deployment: Vercel
- Framework: React 19 (Vite)
- Styling: Tailwind CSS v4, DaisyUI 5
- Icons & Animations: Lucide React, Framer Motion
- Data Fetching: TanStack Query (v5), Axios
Below is the complete file structure for both the Server and Client projects to give a full overview of the ecosystem.
plateShare-server-site/
├── .env # Environment variables (DB, Firebase)
├── index.js # Main server entry point (Express routes & logic)
├── package.json # Project dependencies and scripts
├── vercel.json # Deployment configuration for Vercel
├── encode.js # Utility to encode Firebase key to Base64
├── plateshare-firebase-admin-key.json # Raw Firebase Admin credentials (GIT IGNORED)
├── node_modules/ # Project dependencies
└── README.md # Detailed documentation
plateShare-client-site/
├── public/ # Static assets
├── src/
│ ├── components/ # Reusable UI components (Navbar, Footer, Modal, etc.)
│ ├── context/ # AuthContext (Firebase auth bridge)
│ ├── hooks/ # Custom hooks (useAxiosSecure, useAxiosPublic)
│ ├── pages/ # Route-level components (Home, AvailableFoods, Dashboard)
│ ├── Route/ # React Router 7 configuration
│ ├── App.jsx # Main application layout
│ └── main.jsx # Entry point
└── ...
Follow these steps to get the full project running on your local machine.
# Clone Server
git clone https://github.com/alhasandhali/plateShare-server-site.git
cd plateShare-server-site
# Clone Client (In a separate folder)
git clone https://github.com/alhasandhali/plateShare-client-site.git- Install dependencies:
npm install
- Configure Environment Variables:
Create a
.envfile in the server root:PORT=3000 DB_USER=your_mongodb_username DB_PASS=your_mongodb_password FIREBASE_SERVICE_KEY=your_base64_encoded_firebase_admin_key
- Start the server:
node index.js # or using nodemon nodemon index.js
- Navigate to client folder:
cd plateShare-client-site npm install - Configure
.env.local: Add your Firebase and ImgBB API keys. - Run the app:
npm run dev
GET /foods- Get all foods (supports filters likedonator_email,status).GET /featured-foods- Get top 6 foods by quantity.POST /food- Add a new food item (Protected).PATCH /food/:id- Update food details or status (Protected).DELETE /food/:id- Remove a food listing (Protected).
POST /user- Register or update user in database.GET /user/email/:email- Get user details by email.GET /users- List all users (Admin only/Protected).
GET /requested-foods- Get food requests for a specific user (Protected).POST /requested-food- Submit a new food request (Protected).PATCH /requested-food/:id- Update request status (Accepted/Rejected).
{
"food_name": "string",
"food_image": "url",
"food_quantity": "number",
"pickup_location": "string",
"expire_date": "date",
"additional_notes": "string",
"donator_name": "string",
"donator_email": "string",
"donator_image": "url",
"food_status": "Available | Requested"
}Al Hasan Dhali
- GitHub: @alhasandhali
- LinkedIn: Al Hasan Dhali
- Portfolio: alhasandhali.com
"Don’t waste food — share it. Every plate shared brings hope to another."