This is the repository for the application that runs on the SHED Access Control System boxes. It consists of two separate applications, frontend and backend. The frontend is hosted as part of the software team's server on their heroku instance, and acts as the UI. The backend runs locally on the Raspberry Pi or Tinkerboard and handles switching the relay and detecting E-Stop presses via the GPIO.
Prerequisites: Node.js
Note: The default linux image for the Tinkerboard seems to be misconfigured when it comes to installing packages via apt-get. To temporarily fix this:
- Navigate to /etc/apt/apt.conf.d/
cd /etc/apt/apt.conf.d/
- Open apt.conf with a text editor (must use sudo)
- Add the below lines:
// Do not verify peer certificate Acquire::https::Verify-Peer "false"; // Do not verify that certificate name matches server name Acquire::https::Verify-Host "false";
These lines should be deleted after Node.js is installed for better security. For more information, visit the first answer here
- Open a terminal or command prompt and navigate to this directory
- Navigate to the backend directory
cd backend
- Run the command
npm install
- Run the command
node index.js
The backend application will now be running inside this terminal and logging to it.
- Open a terminal or command prompt and navigate to this directory
- Navigate to the frontend directory
cd frontend
- Run the command
npm install
- Run the command
npm run build
- Navigate to the build directory
cd build
and open index.html with a web browser (ex. chrome)