How sahria-dev/the-cantine works
The Canteen is a Flask app for campus meal reservations, account management, and balance recharges. Users register or log in, then reserve or cancel meal dates, recharge their balance, update their email, and review past reserved dates counted as meals eaten. The main backend routes are in app.py; browser interactions are split across page-specific JavaScript modules. The README describes SQLite/SQLAlchemy persistence, but the database file and templates are not in the supplied tree. Backend excerpts are partial, so only documented or evidenced connections are shown.
Main entry points: app.py Authentication and routes · models.py ORM models · login.js Login interaction · registration.js Registration interaction
Components 12
Account access
- Login interaction
static/js/login.js - Registration interaction
static/js/registration.js
Meal reservations
- Reservation calendar
static/js/reservation.js - Reservation requests
static/js/reservation_util.js - Meal history
static/js/history.js
Account services
- Balance recharge
static/js/payment.js - Personal information
static/js/personal_info.js
Backend and persistence
- Authentication and routes
app.py - Login guard
helpers.py - ORM models
models.py - SQLite database
Other components
- Canteen user
Connections 17
- Canteen user → Login interaction: submits credentials
- Canteen user → Registration interaction: provides details
- Login interaction → Authentication and routes: sends credentials
- Registration interaction → Authentication and routes: sends registration
- Authentication and routes → Login guard: uses access guard
- Authentication and routes → ORM models: queries and updates
- ORM models → SQLite database: persists records
- Canteen user → Reservation calendar: chooses meal dates
- Reservation calendar → Reservation requests: requests date data
- Reservation requests → Authentication and routes: calls reservation routes
- Authentication and routes → ORM models: stores reservations
- Canteen user → Meal history: views meal history
- Meal history → Authentication and routes: requests history
- Canteen user → Balance recharge: enters recharge code
- Balance recharge → Authentication and routes: submits code
- Canteen user → Personal information: edits email
- Personal information → Authentication and routes: submits profile change