Giter Site home page Giter Site logo

restaurants-management-system's Introduction

Restaurant Booking System

Backend code for resturant booking application.

Documentation

Request should be in JSON format with Bearer token in header of request.

Response will be in JSON format.

Tech Stack

Server: Node, Express

Database PostgreSQL

Installation

To install Node.js

https://nodejs.org/en/download

To install PostgreSQL

https://www.postgresql.org/download/

API Reference

User Registration

  POST /auth/register
Parameter Type Description
name string Required. Name of the user.
username string Required. Unique username for each user.
email string Required. Unique email for each user.
password string Required. Password for user authentication.
user_type string Required. Type of user. "customer" or "staff"
contact_info string Optional. Contact Information of user.
role string Optional. Role of user if Staff.

User Authentication

  POST /auth/login
Parameter Type Description
username string Required. username of user.
password string Required. User password.

API to manage room availability

  POST /staff/updateRoom
Parameter Type Description
room_id Number Required. Room ID of "Room" table.
isAvailable Boolean Optional. Default True. Boolean value for availability.
avail_date Date Required. Date on which room is available.

API to search and book room

  POST /customer/search-rooms
Parameter Type Description
capacity Number Optional. Minimum required capacity.
date Date Optional. Date on which room is required.
  POST /customer/bookRoom
Parameter Type Description
avail_id Number Required. avail_id of 'Room_Availability' table.

Run Locally

Clone the project

  git clone https://github.com/eklavyabhargava/resturant-management-system.git

Go to the project directory

  cd restaurants-management-system

Install dependencies

Using npm

  npm install

Using yarn

  yarn install

Database schema design and table creation

Run query in database shell to create database:

  CREATE DATABASE <database_name>

Run Script file in cmd:

  psql -U your_username -h your_host -d your_database script.sql

Insert sample data, run command:

  psql -U your_username -h your_host -d your_database sample_data.sql

Create .env file

Key Value
DB_USER <your_username>
DB_HOST <db_hosted_on>
DB_NAME <db_name>
DB_PASSWORD <yourdb_password>
DB_PORT <yourdb_port>
PORT Port on which server run

Start the server

Using node

  node server

Using nodemon

  nodemon server

restaurants-management-system's People

Contributors

eklavyabhargava avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.