# π½οΈ Foodzy - Restaurant Management SystemFoodzy is a full-stack **Restaurant Management System** built using Flask, PostgreSQL, and vanilla HTML/CSS. It provides seamless CRUD operations for managing:
- π΄ Menus
- π Orders
- π³ Billing
- π Customer Testimonials
---
## π― **Features**
β
Role-based Admin & Staff Panels
β
Manage Menus, Orders, and Tables
β
Customer Feedback with Testimonial Management
β
Beautiful Responsive UI
β
Secure Login System & CRUD APIs
---
## ποΈ **Project Structure**
Foodzy/ βββ app/ β βββ init.py # Flask App Initialization β βββ models/ # SQLAlchemy ORM Models β βββ routes/ # All Flask Routes β β βββ routes.py β βββ static/ β βββ assets/ β βββ css, js, images/ βββ templates/ # HTML Pages βββ sql/ # DB Initialization Scripts βββ venv/ # Virtual Environment βββ run.py # Main App Runner
---
## βοΈ **Setup & Installation**
### 1. Clone Repository
```bash
git clone https://github.com/yourusername/Foodzy.git
cd Foodzy
# For Windows
python -m venv venv
venv\Scripts\activate
# For Mac/Linux
python3 -m venv venv
source venv/bin/activatepip install -r requirements.txt- Create a database
foodzy_db - Update DB config in
app/__init__.py
python run.py- Open your browser at
http://127.0.0.1:5000/
users- Admin and Staff Loginmenus- Menu Managementorders- Customer Ordersbills- Billing Datatestimonials- Customer Feedback
erDiagram
USERS {
int id PK
varchar username
varchar password
varchar role
}
MENUS {
int id PK
varchar name
float price
varchar category
}
ORDERS {
int id PK
int table_no
datetime order_date
float total_amount
}
BILLS {
int id PK
int order_id FK
float amount
datetime bill_date
}
TESTIMONIALS {
int id PK
varchar name
text feedback
datetime date_submitted
}
USERS ||--o{ ORDERS : manages
MENUS ||--o{ ORDERS : contains
ORDERS ||--o{ BILLS : generates
USERS ||--o{ TESTIMONIALS : reviews
| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
Home Page |
GET |
/menu |
Menu Listing |
POST |
/add_order |
Place New Order |
POST |
/add_testimonial |
Add Customer Feedback |
GET |
/admin |
Admin Dashboard |
This project is licensed under the MIT License.
---
## π `DB DESIGN.md` (DMD)
```markdown
# ποΈ Foodzy - Database Design (DMD)
---
## π― **Database Overview**
The foodzy_db database contains 5 primary tables:
users- Admin/Staff User Datamenus- Menu Informationorders- Customer Order Detailsbills- Billing and Payment Infotestimonials- Customer Reviews
CREATE TABLE users (
id SERIAL PRIMARY KEY,
username VARCHAR(50) NOT NULL,
password VARCHAR(255) NOT NULL,
role VARCHAR(20) CHECK (role IN ('admin', 'staff')) NOT NULL
);CREATE TABLE menus (
id SERIAL PRIMARY KEY,
name VARCHAR(100) NOT NULL,
price FLOAT NOT NULL,
category VARCHAR(50)
);CREATE TABLE orders (
id SERIAL PRIMARY KEY,
table_no INT NOT NULL,
order_date TIMESTAMP DEFAULT NOW(),
total_amount FLOAT NOT NULL
);CREATE TABLE bills (
id SERIAL PRIMARY KEY,
order_id INT REFERENCES orders(id),
amount FLOAT NOT NULL,
bill_date TIMESTAMP DEFAULT NOW()
);CREATE TABLE testimonials (
id SERIAL PRIMARY KEY,
name VARCHAR(50) NOT NULL,
feedback TEXT NOT NULL,
date_submitted TIMESTAMP DEFAULT NOW()
);usersβοΈ orders- One-to-ManymenusβοΈ orders- Many-to-ManyordersβοΈ bills- One-to-OneusersβοΈ testimonials- One-to-Many
INSERT INTO users (username, password, role)
VALUES
('admin1', 'hashed_password1', 'admin'),
('staff1', 'hashed_password2', 'staff');INSERT INTO menus (name, price, category)
VALUES
('Pasta', 250.00, 'Main Course'),
('Pizza', 300.00, 'Main Course'),
('Brownie', 150.00, 'Dessert');INSERT INTO orders (table_no, total_amount)
VALUES
(5, 750.00),
(3, 300.00);