Giter Club home page Giter Club logo

nodejs-booking-app's Introduction

NodeJS Booking App

An appointment booking server application made using Node JS. This application makes use of the Google Calendar API to create appointment timeslots on Google Calender. The appointment timeslots are 40 minutes in length, and a 5 minute break between each timeslot exists. The timeslots are defined from Monday to Friday, 9AM to 6PM. This application meets all of the requirements listed below. The requirements defined in this booking server are easily customizable. For example, if you would like to define your own timeslots, simply edit the timeslots within timeslots.json.

For a video tutorial on how to setup this application, see this video: https://youtu.be/dWip8MLvEWw
For a video demonstration of this application, see this video: https://youtu.be/IS-V0Xmv1mw

Requirements:

  • All appointments are 40 minutes long and have fixed times, starting from 9–9:40 am. ✔️
  • Ensure there is always a 5 minute break in between each appointment. ✔️
  • Appointments can only be booked during weekdays from 9 am to 6 pm. ✔️
  • Bookings can only be made at least 24 hours in advance. ✔️
  • Appointments cannot be booked in the past. ✔️

Application contents:

ReqHandlers Directory

  • GET-Handlers - A folder containing the GET handlers used in the app.
  • POST-Handlers - A folder containing the POST handlers used in the app.

Utility Directory

  • appUtil.js - Provides functionality used throughout the code base, such as date calculation functions.
  • gcal.js - Utilises the credentials.json file to generate a token.json file. If a token.json file already exists, then an oAuth2 Client is generated and returned.
  • requirements-validator.js - Used to validate requests sent to the server.
  • credentials.json - Your credentials.json file used to authenticate the Google Calendar API used by this app.
  • token.json - The token file generated by gcal.js after authenticating your credentials.json file.

App Working Directory

  • Node-Modules - Generated when running 'npm-install'. A folder containing the npm modules used throughout the app.
  • server.js - The main server file that utilizes express to start a web server.
  • package.json - Package.json file used with npm.
  • package-lock.json - Package-lock.json file used with npm.

Installation and Usage

Instructions:

  1. Clone this repository.
  2. Visit https://developers.google.com/calendar/quickstart/nodejs to activate Google Calander on your Google Account and to generate a credentials.json file if you haven't already done so. Place your credentials.json file into the 'Utility' directory of this application.
  3. In the newly cloned repository, open your command line and run the 'npm install' command to download the required modules.
  4. Run the 'node .' command to run the server.
  5. The booking app is now ready. Try out the following REST requests below.

HTTP REST Routes:

GET  /days?year=yyyy&month=mm

GET  /timeslots?year=yyyy&month=mm&day=dd

POST /book?year=yyyy&month=MM&day=dd&hour=hh&minute=mm

License

NodeJS-Booking-App is copyright (c) 2019, Aryan Nateghnia [email protected].

NodeJS-Booking-App is free software, licensed under the GPL, Version 3.0. See the LICENSE file for more details.

nodejs-booking-app's People

Contributors

arytek avatar dependabot[bot] 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.