CanteenHub - Multi-User Collaborative Canteen & Food Ordering System
A zero‑framework PHP application that uses SQLite as its default database. It replaces informal chat‑based lunch ordering threads with a structured web interface.
Key Features
- User Authentication – Login
/login& Register/registerwith password hashing. Pre‑seeded demo accounts (password:password). - Session Creation – Any user can start a food session, paste menu items, and invite colleagues.
- Self‑Ordering – Browse active sessions, select multiple items, set quantities and notes.
- Bill Calculation – Host enters final prices, app computes each participant’s bill and generates copy‑ready markdown.
How to Run (SQLite)
Option 1: PHP Built‑in Server
php -S localhost:8000 -t public
Visit http://localhost:8000.
Option 2: Docker Compose
docker compose up -d --build
Visit http://localhost:8080.
Option 3: Apache
Point the VirtualHost DocumentRoot to the public/ directory (rewrites handled by public/.htaccess).
Database Setup (SQLite)
- Copy the example env file and set SQLite configuration:
cp .env.example .env
Edit .env:
DB_CONNECTION=sqlite
DB_DATABASE=storage/database.sqlite
- Create the SQLite file and run the schema initialization (executed automatically on first request):
mkdir -p storage
touch storage/database.sqlite
php -r "require 'public/index.php'; App\\Core\\Database\\Database::initSchema();"
The initSchema() method creates all tables and seeds initial data if the database is empty.
Resetting Data
To start from a clean slate:
rm storage/database.sqlite
mkdir -p storage
touch storage/database.sqlite
php -r "require 'public/index.php'; App\\Core\\Database\\Database::initSchema();"
Or invoke the built‑in reset:
php -r "require 'public/index.php'; App\\Core\\Database\\Database::initSchema();"
(Calling initSchema() drops existing tables and recreates them.)
Troubleshooting
- Missing PDO SQLite extension – Install via
sudo apt-get install php8.2-sqlite3. - File permission issues – Ensure the web server user can read/write
storage/. - Database connection errors – Verify
.envsettings and thatstorage/database.sqliteexists.
License
MIT License. See LICENSE for details.
A zero-framework PHP application built to replace informal Mattermost/chat lunch ordering threads. Anyone on the team can log in, start a food session, join any colleague's session, and place their own orders with automatic bill calculation upon food arrival.
Key Features
-
User Authentication (Zero Framework):
- Login (
/login) & Register (/register) with secure password hashing (password_hash()). - Pre-seeded test accounts (Password:
password):dea(Dea - Coordinator)alex(Alex Turner)sarah(Sarah Jenkins)budi(Budi Santoso)michael(Michael Chen)
- 1-click Quick Demo Account switcher on login page.
- Login (
-
Session Creation by Anyone:
- Any team member can click "➕ Start a Food Session" to coordinate canteen lunch, boba/coffee runs, or snack orders.
- Hosts paste today's menu choices directly from chat (no prices needed upfront).
-
Self-Ordering from Any Session:
- Logged-in colleagues browse all active sessions on the dashboard.
- Multi-Select Interactive Menu: Click multiple items, adjust quantities (
+/-), and add specific notes ("no spicy", "extra egg"). - The app automatically assigns the order to the authenticated coworker.
-
Grouped Canteen Placement & Bill Settlement:
- 1-Click "Copy Canteen Text" aggregates quantities into a formatted WhatsApp/chat message.
- When food arrives with the receipt, the host enters the final prices per item.
- The app automatically computes every coworker's personal bill!
- 1-Click "Copy Mattermost Breakdown" generates a ready-to-paste markdown table tagging
@coworkerwith their exact individual bill and payment status (Unpaid/Paid).
How to Run
Option 1: PHP Built-in Server (php -S)
php -S localhost:8000 -t public
Visit: http://localhost:8000
Option 2: Docker Compose
docker compose up -d --build
Visit: http://localhost:8080
To stop:
docker compose down
Option 3: Apache
Point your Apache VirtualHost DocumentRoot to public/ directory (rewrites handled by public/.htaccess).