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
- 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. ✔️
- GET-Handlers - A folder containing the GET handlers used in the app.
- POST-Handlers - A folder containing the POST handlers used in the app.
- 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.
- 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.
- Clone this repository.
- 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.
- In the newly cloned repository, open your command line and run the 'npm install' command to download the required modules.
- Run the 'node .' command to run the server.
- The booking app is now ready. Try out the following REST requests below.
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
NodeJS-Booking-App is copyright (c) 2019, Aryan Nateghnia 38933061+aryannateq@users.noreply.github.com.
NodeJS-Booking-App is free software, licensed under the GPL, Version 3.0. See the
LICENSE
file for more details.