Skip to content

NV-DuyManh/Restaurant_Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍽️ Restaurant Manager System

Mini Restaurant Management System – Frontend + Mock API

OverviewFeaturesTech StackStructureHow it worksSetup


📌 Overview

Restaurant Manager System là một project mô phỏng hệ thống quản lý nhà hàng chạy hoàn toàn ở frontend, sử dụng json-server làm REST API giả lập.

Project tập trung vào:

  • Fetch dữ liệu từ API
  • Render UI động
  • Xử lý giỏ hàng (cart)
  • Thao tác CRUD cơ bản

🚀 Features

  • 📋 Hiển thị danh sách món ăn từ API (/products)
  • 🛒 Thêm món vào giỏ hàng (/cart)
  • ❌ Xóa món khỏi giỏ
  • 🔄 Đồng bộ dữ liệu realtime với json-server
  • 💡 UI đơn giản, dễ mở rộng

🧠 How it works

Luồng hoạt động chính:

  1. json-server chạy tại localhost:3000
  2. Frontend gọi API:
    • GET /products → lấy danh sách món
    • GET /cart → lấy giỏ hàng
  3. Khi user:
    • Add item → POST /cart
    • Remove item → DELETE /cart/:id
  4. UI tự render lại từ data mới

👉 Đây là mô hình frontend calling REST API (mock backend)


🛠️ Tech Stack

Layer Công nghệ
Frontend HTML, CSS, JavaScript
API JSON Server
Dev Tool Live Server, Git

📁 Project Structure

Restaurant_Manager/
│── db.json          # Mock database
│── index.html
│
├── assets/          # Images, icons
├── css/             # Styles
├── js/              # Logic xử lý
└── views/
    └── Home.html    # Main UI

⚙️ Setup

1. Clone project

git clone https://github.com/NV-DuyManh/Restaurant_Manager.git
cd Restaurant_Manager

2. Run JSON Server

npx json-server db.json

👉 API chạy tại:
http://localhost:3000


3. Run frontend

  • Mở đầu tiên tại:
views/Register.html
  • Chọn Open with Live Server

🔗 API Endpoints

Method Endpoint Description
GET /products Lấy danh sách món
GET /cart Lấy giỏ hàng
POST /cart Thêm món
DELETE /cart/:id Xóa món

⚠️ Notes

  • Đây là mock backend, không dùng production
  • Dữ liệu lưu trong db.json
  • Nếu lỗi → restart json-server

👨‍💻 Author

Nguyễn Văn Duy Mạnh


⭐ Nếu thấy hữu ích, hãy cho mình 1 star nhé!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors