# Canteen Management System

> A PHP-based canteen management application built as a Grade 12 project, featuring food ordering, prepaid balances, administrative controls, and receipt generation.

Case study: https://sushandahal.com.np/work/canteen-management-system

Author: Sushan Dahal

Role: Developer

Status: Grade 12 Academic Project

Technologies: PHP, MySQL, JavaScript, HTML, CSS

## Problem

Traditional school canteens can depend on manual ordering, cash handling, and disconnected records. This project explored how a simple web application could organize food purchases, maintain customer balances, and give administrators better control over daily operations.

## Contribution

Developed a full-stack canteen management application using PHP, MySQL, HTML, CSS, and JavaScript. Implemented customer-facing ordering functionality, session-based login flows, administrative features for managing menus and accounts, balance top-ups, checkout processing, and order receipts.

## Approach

- Built separate customer and administrator interfaces for different operational needs.
- Used PHP sessions to manage authenticated access to customer and administrative functionality.
- Connected the application to a MySQL database for storing users, account balances, orders, and order items.
- Implemented menu management functionality for administrators.
- Developed a cart checkout workflow that calculates order totals and checks available customer balances.
- Implemented a prepaid account system with administrator-managed balance top-ups.
- Stored purchase records and individual order items for receipt generation.

## Decision

Chose a traditional PHP and MySQL architecture to build a complete server-rendered application without introducing a separate frontend framework or API service. Used prepaid account balances to simplify the ordering workflow for a school canteen environment.

## Tradeoff

The straightforward PHP architecture made the application approachable for an academic project, but the checkout and balance-management logic would need stronger input validation, parameterized queries, and database transactions before production use.

## Outcome

Completed a Grade 12 academic project demonstrating customer ordering, administrative management, prepaid balances, and order processing. Published the source code on GitHub, with a deployment URL listed in the repository.

## Lessons

Gained practical experience connecting frontend interfaces with server-side PHP logic and relational databases. The project helped build an understanding of sessions, CRUD operations, order processing, and the importance of data consistency and security in applications that manage account balances.

Interface illustrations on the case-study page explain the concept; they are not project screenshots.

Source: https://github.com/Sushan2589/Canteen-Management-System

Demo: http://smartbhansa.rf.gd/
