Skip to content
Eva Stoddard edited this page Nov 20, 2024 · 7 revisions

Welcome to the Makerspace wiki!

Introduction

Makerspace, formerly known as ConstructControl, is a training and access control system for makerspaces to manage use of equipment via API-connected card reader devices.

Makerspace was built originally for the RIT SHED. While the language in this wiki will attempt to remain unspecific to the SHED, certain descriptions will be describing the SHED's specific deployment environment.

Technical Specifications

The Makerspace application contains a server and client subsystem. The server subsystem is a NodeJS express application that contains the SAML authentication control, Equipment API, and web service handled with GraphQL. The client subsystem is a React web application with admin and user views.

Server

The server is written in TypeScript using NodeJS Express with Apollo server included as a GraphQL query handler. The server uses Knex as a database adapter and SQL queryer.

Shibboleth Authentication

Shibboleth is the authentication provider RIT uses to sign all RIT users into RIT services. Shibboleth uses SAML2 for private key authentication handling. Makerspace uses passport-saml to create SAML requests and decrypt responses. The full process in detailed in Authentication.

Machine API

The application supports communication between access control card reader devices via a REST API located at /api. The API handles machine authentication requests and status updates from access devices. This is detailed in Machine API.

SQL-to-GraphQL Serving

Apollo Server allows the use of GraphQL sent from the client to the server. GraphQL endpoints, or resolvers, pull requested information from the database via associated repositories. This is detailed in Database > Querying.

Web Service

The NodeJS server serves the React client at /app. These directions are stored in server.ts. The application context, which the client uses for user information, is stored in context.ts. This context includes a timed session which is defined in auth.ts.

Client

The client is a React app writted in TypeScript. The client heavily uses Material UI for all components and structures. Via the GraphQL resolvers, components are selectively served by checking the Role associated with the noted user. For this purpose, pages are separated into two categories, Maker and Admin. The MAKER role has access only to the Maker pages while STAFF and MENTOR have access to both maker and admin pages (however, MENTORs have access restricted to certain operations).

For page routing, the client uses React-Router.

Static Assets

There are two methods for storing static assets in the application. The first method is storing in client/public. Files in this directory will be inherently accessible at https://app.address/app/<filename>. The second method is placing files in the client/src/assets directory. When the project is build, files in this directory will be optimized and stored in the production build directory. Files stored this way must be imported in React to be used:

import LogoSvg from "../assets/acronym_logo.svg";

Currently, this method only works for SVGs and other XML-based files as TypeScript cannot import other types of files.

Static assets can also be accessed via a CDN. GitHub comes built-in with a CDN Via JSDelivr. The address for accessing assets via this CDN is

https://cdn.jsdelivr.net/gh/rit-construct-makerspace/makerspace/<path>

ex: https://cdn.jsdelivr.net/gh/rit-construct-makerspace/makerspace/client/public/training%20pdfs/2024%20E16%20Embroidery%20Machine.pdf

GraphQL Queries

The client fetches data from the server via GraphQL Queries. The queries are translated into existing resolvers in the server which provide information from the database. See Database > Querying for information on the server-side operations and GraphQL Documentation for information on query structures.