This is a full-stack restaurant application built using React, Node.js, Express, PostgreSQL, and Prisma. It provides an interface for customers to browse the menu, place orders, and view their current order, as well as an interface for restaurant staff to manage incoming orders.
You can view the live demo of the application here.
For a detailed walkthrough of the application, watch this video.
- Login Page: Customers can log in with their credentials.
- Menu Browsing: Customers can browse the menu categorized by appetizers, main courses, desserts, and drinks.
- Order Placement: Customers can select their table number, add items to their cart, review their cart, adjust quantities, and remove items.
- Order Viewing: Customers can view details of their current submitted order.
- Order Management: Staff can view a list of incoming orders with details such as table number, order items, and total amount. They can also mark orders as completed.
- Role-based authentication for both customers and staff, ensuring that only authenticated staff can access order management features.
- Frontend: React, Axios
- Backend: Node.js, Express.js, Prisma
- Database: PostgreSQL
- Authentication: JWT
- Deployment: Vercel
- Node.js
- PostgreSQL
-
Clone the repository:
git clone https://github.com/sanidhyasin/Restaurant-App.git cd Restaurant-App/backend
-
Install dependencies:
npm install
-
Set up your
.env
file:DATABASE_URL="your_postgresql_database_url" JWT_SECRET="your_jwt_secret"
-
Initialize the database:
npx prisma migrate deploy
-
Start the backend server:
npm start
-
Navigate to the frontend directory:
cd ../frontend
-
Install dependencies:
npm install
-
Set up your
.env
file:REACT_APP_API_URL="http://localhost:3000/api"
-
Start the frontend server:
npm start
- Register or log in as a customer.
- Browse the menu and add items to your cart.
- Place an order by selecting your table number and reviewing your cart.
- View your current order.
- Register or log in as staff.
- View and manage incoming orders.
- Mark orders as completed.
- POST /auth/login: Log in a user
- POST /auth/register: Register a new user
- GET /menu/items: Get all menu items
- GET /menu/categories: Get all menu categories
- POST /orders: Create a new order
- GET /orders/current: Get the current order for the logged-in user
- GET /orders/history: Get the order history for the logged-in user
- GET /orders/staff: Get all pending orders for staff
- PUT /orders/:id/complete: Mark an order as completed