Skip to content

sanidhyasin/Restaurant-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

Restaurant App

Hosted on Vercel

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.

Table of Contents

Demo

You can view the live demo of the application here.

Video Overview

For a detailed walkthrough of the application, watch this video.

Features

Customer Interface

  • 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.

Restaurant Staff Interface

  • 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.

Authentication

  • Role-based authentication for both customers and staff, ensuring that only authenticated staff can access order management features.

Technologies Used

  • Frontend: React, Axios
  • Backend: Node.js, Express.js, Prisma
  • Database: PostgreSQL
  • Authentication: JWT
  • Deployment: Vercel

Installation

Prerequisites

  • Node.js
  • PostgreSQL

Backend Setup

  1. Clone the repository:

    git clone https://github.com/sanidhyasin/Restaurant-App.git
    cd Restaurant-App/backend
  2. Install dependencies:

    npm install
  3. Set up your .env file:

    DATABASE_URL="your_postgresql_database_url"
    JWT_SECRET="your_jwt_secret"
    
  4. Initialize the database:

    npx prisma migrate deploy
  5. Start the backend server:

    npm start

Frontend Setup

  1. Navigate to the frontend directory:

    cd ../frontend
  2. Install dependencies:

    npm install
  3. Set up your .env file:

    REACT_APP_API_URL="http://localhost:3000/api"
    
  4. Start the frontend server:

    npm start

Usage

Customer Interface

  • 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.

Restaurant Staff Interface

  • Register or log in as staff.
  • View and manage incoming orders.
  • Mark orders as completed.

API Endpoints

Authentication

  • POST /auth/login: Log in a user
  • POST /auth/register: Register a new user

Menu

  • GET /menu/items: Get all menu items
  • GET /menu/categories: Get all menu categories

Orders

  • 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