Giter Club home page Giter Club logo

flavortown-bookings's Introduction

Flavortown Bookings

This is a sample project created to explore the design of a restaurant bookings platform. You can view this project live or clone and run locally.

System design

There are three user stories covered by the system:

  1. Create new bookings to add inventory
  2. Update a booking so that it is booked or available
  3. View available bookings

The application structure provides two routes for working with bookings:

  • /bookings/all: this page shows a snapshot of bookings available and booked on each day. The user can then select a day to jump to it and work with individual bookings.
  • /bookings/:date: this is a dynamic page which takes a date in YYYY-MM-DD format. On this page, the user is shown the bookings for this date, and they are broken into Available and Booked categories.

To ensure a user can only operate on an existing booking, the Dates page displays each booking in a grid format sorted by time. Selecting a booking opens a dialog to edit the booking's details including the guest name, email, and party size. For simplicity, a booking is considered "booked" if there is a name assigned to the booking.

Results are live updating and available across clients once the update is received via web socket. Additionally, data requests a cached to allow fast navigation between dates. If a user has visited a date and loaded its bookings, they display immediately. The system still fetches bookings in the background and will update the display if needed.

To create new booking inventory, there is an Add button available from both bookings pages. It sits in the lower right corner, and clicking it opens a dialog where the user provides information about what bookings to create. If opened from a Date page, it is pre-filled with that date, and if opened from the /all route it defaults to today's date.

Tech stack

  • TypeScript
  • React
  • DynamoDB database with GraphQL API
  • Chakra UI for styling and UI components

Running locally

You can run the project locally by cloning and then running the amplify init command in the root of the project. When prompted, create your own backend so that you have your own sandbox. Learn more about the per developer sandbox flow.

You will then need to create the API in your sandbox. Run amplify update api to create your settings for the API, and then amplify push to provision it.

Note, this requires the amplify CLI tool to be installed and you should be familiar with initializing Amplify projects. Learn more about Amplify and how to get started.

flavortown-bookings's People

Contributors

jongrim avatar

Watchers

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