Skip to content
This repository was archived by the owner on Sep 21, 2025. It is now read-only.

makerspace-delft/MakerSpaceIoT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

177 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(Bookings server) | (Bookings app)

Bookings Server:

The bookings back-end is an Amazon Web Services lambda function written in Node.js.

Bookings API description

In deployment, the API is located at: https://api.makerspacedelft.nl/prod

The major API calls are listed below. This is just a brief high-level overview of what is contained within the AWS lambda function:

HTTP Method URL Description
GET https://api.makerspacedelft.nl/prod?action=client Return user info
POST https://api.makerspacedelft.nl/prod?action=client Sign in or register
POST https://api.makerspacedelft.nl/prod?action=bookings Create a booking
GET https://api.makerspacedelft.nl/prod?action=bookings View bookings
DELETE https://api.makerspacedelft.nl/prod?action=bookings Cancel a booking
GET https://api.makerspacedelft.nl/prod?action=calendar Outputs data in ICS format for all the bookings.

For more, see LambdaFE/app.js and LambdaFE/routes.js.

These methods do not check user authentication.

How does updating the bookings server work?

New code pushed to the main branch on GitHub is automatically deployed to AWS. This works via a CI/CD process as follows:

  1. When new code is pushed to the main branch, the Serverless Application Model Deployment workflow runs. This is configured in .github/workflows/aws.yml and visible under the "Actions" tab.
  2. The workflow reads the AWS template template.yaml and from this generates gen/cloudformationtemplate.yaml.
  3. The workflow then deploys the services (DynamoDB and Lambda) on AWS according to this template file.

This means updating the code is as simple as pushing to git. The status of all deployments can be seen in the Actions tab in GitHub.

How does GitHub update the app without the AWS password?

The secret access key is stored in the Settings tab of the repository and is referenced by aws.yml.

How does calendar integration work?

This is the tricky part of the back-end. Calendar events are pulled by rather than pushed to the calendar. This is done by a Google Apps Script which is configured to run every 5 minutes: MSD GAS-ICS-Sync

It calls the calendar function (from the API URL above) which returns all bookings in the database. It then detects new or deleted events and merges the changes into the shared Google Calendar.

The documentation for this script is at the top of the source code file. To restart the script:

  1. Open MSD GAS-ICS-Sync
  2. Make sure the toolbar says "install" to the right of "Debug"
  3. Click "Run"

Note that the calendar name is specified as a string: "Makerspace Delft Bookings". That means that if this name changes, or there are multiple calendars with this name accessible by the script owner, there may be an undesirable outcome.

Where is the data stored?

All of the booking and user data is stored on AWS (in DynamoDB) and it may be wise to back this up regularly.

How can I access the database?

First, sign into the AWS console:

View the DynamoDB database: https://console.aws.amazon.com/dynamodbv2/#tables

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors