MealMate is a desktop application that connects food donors with food banks and volunteers to help reduce food waste and address food insecurity.
The project is divided into three main parts:
- Backend: Node.js/Express API with PostgreSQL database
- Frontend: React/TypeScript application built with Vite
- Desktop App: Electron wrapper for the web application
- Node.js (v14+)
- PostgreSQL (v12+)
- npm or yarn
git clone https://github.com/yourusername/meal-mate.git
cd meal-mate# Create PostgreSQL database
psql -U postgres
CREATE DATABASE mealmate;
\q
# Initialize database schema and sample data
cd backend
node src/db/init_database.jsCreate a .env file in the backend directory with the following content:
DB_HOST=localhost
DB_PORT=5432
DB_NAME=mealmate
DB_USER=postgres
DB_PASSWORD=your_password
PORT=3000
JWT_SECRET=your_secret_key
JWT_EXPIRES_IN=24h
# Install all dependencies and start the application
npm install
npm startThis will start:
- Backend server on port 3000
- Frontend development server on port 5173
- Electron desktop application
# Start backend only
npm run start:backend
# Start frontend only
npm run start:frontend
# Start Electron app only
npm run start:electron- User Roles: Donors, Food Banks, Volunteers, and Administrators
- Donation Management: Create, track, and manage food donations
- Volunteer Assignment: Assign volunteers to pick up and deliver donations
- Inventory Management: Track food inventory at food banks
- Real-time Notifications: Get notified about donation status changes
- Dashboard: View statistics and reports
MealMate uses a PostgreSQL database with tables in Third Normal Form (3NF):
- users: Stores all user accounts (donors, volunteers, food banks, admins)
- donations: Tracks donations from donors to food banks
- categories: Food categories for donations and inventory
- donation_categories: Junction table linking donations to categories
- inventory: Tracks food items at food banks
- notifications: User notifications for various events
- audit_logs: Tracks changes to data for auditing purposes
POST /api/auth/register- Register a new userPOST /api/auth/login- Login and get JWT token
GET /api/donations- Get all donationsPOST /api/donations- Create a new donationGET /api/donations/:id- Get a specific donationPUT /api/donations/:id- Update a donationDELETE /api/donations/:id- Delete a donation
GET /api/foodbanks- Get all food banksGET /api/foodbanks/:id- Get a specific food bank
GET /api/volunteer-assignments- Get all volunteer assignmentsPOST /api/volunteer-assignments- Create a volunteer assignment
GET /api/inventory- Get inventory itemsPOST /api/inventory- Create inventory itemGET /api/inventory/:id- Get inventory item detailsPUT /api/inventory/:id- Update inventory itemDELETE /api/inventory/:id- Delete inventory item
For local development and testing:
# Install all dependencies
npm install
# Start the application in development mode
npm startThis will start:
- The backend server on port 3000
- The frontend development server on port 5173
- The Electron application that connects to the frontend
This is all you need for development. No build step is required during development.
When you're ready to create an executable (.exe) file for distribution:
- Push your code to GitHub
- Go to the "Actions" tab in your GitHub repository
- Click on the "Build Electron App" workflow
- Click "Run workflow" and select the branch you want to build from
- Wait for the workflow to complete
- Download the artifact named "MealMate-Windows" which contains your .exe file
Note: Users will still need to have PostgreSQL installed and configured on their system. The application does not bundle PostgreSQL.
- Ensure PostgreSQL is running
- Check that database credentials in
.envare correct - Verify that the database exists:
psql -U postgres -c "\l"
- If port 3000 is in use, change the PORT in
.env - If port 5173 is in use, the frontend will automatically try the next available port