Skip to content

Repository files navigation

UniBite — Student Food Sharing Platform

UniBite is a full-stack web application designed to help university students share surplus homemade food within their campus community.

The platform supports multiple user roles, food listings, pickup requests, ratings, a credit-based reward system, map-based discovery, and an administrative dashboard.

Collaborative university project developed by George Aggelis and Petros Fousekis.

Screenshots

UniBite login
Authentication
Consumer dashboard
Consumer Feed
Pickup map
Map-based Food Discovery
Cook dashboard
Cook Dashboard
Rating system
Rating System
Admin dashboard
Administration Dashboard

Core Features

Authentication & Roles

  • User registration and login
  • Session-based authentication
  • Role-based workflows for Cook, Consumer, and Administrator

Food Listings

Cooks can create, edit, and remove food listings, define portions, pickup details, allergens, and upload photos.

Consumers can browse available food, view individual listings, explore pickup points through a Leaflet map, and request available portions.

Request Workflow

Pending → Approved → Picked Up
        ↘ Rejected
        ↘ No-show

The system updates portions and user credits according to request outcomes.

Credit System

Event Credit change
New user +5
Request a portion -1
Rejected request +1 refund
Successful pickup Cook +1
Rating above 3/5 Cook +1 bonus
Consumer no-show -1
Missing rating after 48h -1

Reviews & Ratings

Consumers can rate cooks after successful pickups.

Administration

The admin interface includes platform statistics, activity overview, leaderboard functionality, and a responsive mobile layout.

Technology Stack

Layer Technology
Backend Node.js, Express.js
Database MySQL
Authentication Express Session, bcryptjs
Database Driver mysql2
File Uploads Multer
Frontend HTML, CSS, Vanilla JavaScript
Maps Leaflet
Configuration dotenv
Development Nodemon

Architecture

Browser
   │
   ▼
HTML / CSS / JavaScript
   │
   ▼
Express.js REST API
   │
   ├── Authentication
   ├── Listings
   ├── Requests
   ├── Ratings
   └── Administration
   │
   ▼
MySQL

API Overview

Method Endpoint Purpose
POST /api/auth/register Register user
POST /api/auth/login Login
POST /api/auth/logout Logout
GET /api/auth/me Current user
GET /api/allergens List allergens
GET /api/listings Browse listings
GET /api/listings/:id View listing
GET /api/my/listings Cook listings
POST /api/listings Create listing
PUT /api/listings/:id Edit listing
DELETE /api/listings/:id Delete listing
POST /api/listings/:id/requests Request portion
GET /api/my/requests Consumer requests
GET /api/cook/requests Cook requests
PUT /api/requests/:id/approve Approve request
PUT /api/requests/:id/reject Reject request
PUT /api/requests/:id/pickup Confirm pickup
PUT /api/requests/:id/noshow Mark no-show
POST /api/requests/:id/rating Submit rating
GET /api/admin/stats Platform statistics
GET /api/admin/leaderboard Cook leaderboard

Project Structure

UniBite/
├── public/
│   ├── index.html
│   ├── feed.html
│   ├── cook.html
│   ├── requests.html
│   ├── admin.html
│   ├── css/
│   ├── js/
│   └── uploads/
├── Screenshots/
├── server.js
├── db.js
├── schema.sql
├── seed.js
├── .env.example
├── package.json
└── README.md

Local Setup

1. Clone

git clone https://github.com/aggelinho/UniBite.git
cd UniBite

2. Install dependencies

npm install

3. Configure environment variables

Copy .env.example to .env and configure your local database.

Example:

PORT=3000
DB_HOST=localhost
DB_PORT=3306
DB_USER=root
DB_PASS=yourpassword
DB_NAME=unibite
SESSION_SECRET=replace_with_a_long_random_secret
ADMIN_EMAIL=admin@unibite.local
ADMIN_PASSWORD=replace_with_a_strong_password

Never commit your real .env file.

4. Create the database

mysql -u root -p < schema.sql

5. Optional: create an administrator

npm run seed

6. Start the application

npm run dev

or:

npm start

Open http://localhost:3000.

Security Notes

  • Passwords are hashed with bcryptjs.
  • Session secrets and database credentials come from environment variables.
  • .env is excluded from version control.
  • Administrator credentials are not hardcoded in the portfolio version.
  • File uploads are handled using Multer.

Database

Main entities:

  • Users
  • Food listings
  • Allergens
  • Listing–allergen relationships
  • Portion requests
  • Ratings

The portfolio repository keeps the database schema separate from environment-specific or user-generated data.

Team

George Aggelis@aggelinho
Petros Fousekis@petrosfs

Original collaborative repository:
petrosfs/ProjectWeb---UniBite

Portfolio Highlights

  • Full-stack web development
  • REST API design
  • Relational database modelling
  • Session-based authentication
  • Role-based application logic
  • CRUD workflows
  • File uploads
  • Geolocation and interactive maps
  • Gamification through credits
  • Responsive interfaces
  • Collaborative software development

About

Full-stack student food-sharing platform built with Node.js, Express and MySQL, featuring role-based workflows, food listings, requests, ratings, credits and map-based discovery.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages