Coder Social home page Coder Social logo

geoffxp / periodictablesreservationsystem Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thinkful-ed/starter-restaurant-reservation

0.0 0.0 0.0 904 KB

Starter for capstone project: restaurant reservations

Home Page: https://polar-depths-52652.herokuapp.com/

JavaScript 98.13% HTML 1.54% CSS 0.33%

periodictablesreservationsystem's Introduction

Periodic Tables - A Restaurant Reservation System

This is a full stack web application that is able to create reservations and tables.
The data is stored in a database of your choice.
The app allows you to set and keep track of the status of each reservation.
You can also edit and search for reservations.
Refer to the pictures below to see the full functionality of the program

Dashboard - Web

webdash

Dashboard - Mobile

mobiledash

New Reservation Page

reservation

New Table Page

table

Search Page

search

API

GET

/reservations?date={someDate}

the date must be formatted yyyy-MM-dd
returns a list of reservations with matching date
Dashboard does not display 'finished' reservations but search does

/reservations?mobile_number={someNumber}

Search is very lenient and will return all reservations with any matching numbers in part of mobile_number
Empty search returns all reservations

/reservations/:reservation_id

returns reservation with matching id

/tables

Lists all tables

POST

/reservations

body must be formatted as such and include all fields shown

{
    first_name: "name",
    last_name: "lastName",
    mobile_number: "1231231234",
    reservation_date: "2021-04-20",
    reservation_time: "11:30",
    people: 1,
}

reservation_id automatically generated
status defaults to booked and must be set to booked upon creation
people must be a non-negative integer

/tables

body must be formatted as such and include all fields shown

{
    table_name: "name",
    capacity: 1
}

table_name must be at least 2 characters
capacity must be a non-negative integer
reservation_id is a foriegn key defaulted to null

PUT

/reservations/:reservation_id

must include all of the fields from POST
if status is currently 'finished' PUT will fail

/reservations/:reservation_id/status

Request body only needs a status, but still finished reservations cannot be updated

/tables/:table_id/seat

knex transaction that updates reservation.status and table.reservation_id
UPDATE IS USED FOR SEATING - DELETE IS ALSO AN UPDATE THAT FINISHED THE RESERVATION

DELETE

/tables/:table_id/seat

knex transaction that updates reservation.status and table.reservation_id
sets table.reservation_id to null and reservation.status to finished

FRONT-END ROUTES

Routes are self explanatory and intuitively connected to the api

  • /dashboard
  • /search
  • /tables/new
  • /reservations/new
  • /reservations/:reservation_id/seat
  • /reservations/:reservation_id/edit

Technology Used

Front-end -> React, Twitter Bootstrap
Back-end -> Node, Express, Knex
Database -> Postgres, ElephantSQL

Installation

Fork and clone this repo
Run npm install in the main directory
cd back-end/ and run npm install
cd front-end/ and run npm install
create a .env file in each repo and add the following info

  • back-end
DATABASE_URL_DEVELOPMENT=development-data-base-url-goes-here
DATABASE_URL_TEST=test-data-base-url-goes-here
  • front-end
REACT_APP_API_BASE_URL=http://localhost:5000

Open a terminal navigated to the back-end/ Run knex migrate:latest
Run knex seed:run Run npm run start
Open a terminal navigated to the front-end/ Run npm run start

periodictablesreservationsystem's People

Contributors

dalelotts avatar geoffxp avatar gabrielsanchez avatar kchia avatar jonbelaire avatar rushcosgrove 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.