@@ -17,11 +17,9 @@ The Arduino folder holds the two Arduino sketches, one for each Arduino (Arduino
Other folders in the Pi directory act as logical separation for scripts within the main Python workflow.
## Web ##
This folder holds the logic for the website.
## Site ##
## Database ##
This folder holds the logic for the website. This consists of TypeScript files for pages and API endpoints of the site, alongside the backend functionality for handling user requests and sessions. This is run through the npm package manager, through command `npm run dev`. A sub-folder in this folder holds the logic for interacting with the database, making SQL queries to an externally hosted Postgres database. See the README.md in the Site sub-folder for more granular information on site folder directories.
# Pi Setup Instructions #
### Prerequisites ###
...
...
@@ -86,6 +84,21 @@ This folder holds the logic for the website.
# Website Setup Instructions #
Navigate to the `\site` directory in your shell of choice, then run `npm install` to
install all required packages for the site. This may take a while.
Add a .env file to the directory, consisting of the following.
- Documentation: [Postgres 3.4 for Node](https://www.npmjs.com/package/postgres)
Used for Hosting, not in repo:
-**Vercel**
- Purpose: For the site, allowing for constant uptime
- Documentation: [Vercel](https://vercel.com)
-**Neon**
- Purpose: For hosting the Postgres database with constant uptime.
- Documentation: [Neon](https://neon.tech/)
# Code Documentation #
Code is primarily documented via inline annotations.
...
...
@@ -132,6 +182,4 @@ The Node-Red flow features two 'comment' nodes that act as pointers for develope
It's important that the two Arduinos are correctly configured with the right components, sketch, and serial port. If, on monitoring in Node-Red, the Arduinos have swapped functions, it's most likely the serial ports are incorrect. It should be Arduino 0 = ACM0 and Arduino 1 = ACM1. The easiest way to correct this is by unplugging both Arduinos and replugging them, with Arduino 0 being plugged in first.
#### Stranded in Middle of Node-Red Flow ####
If a component is misconfigured and interferes at a point in time after passing the Lock node but not the Unlock node, the system will never reset and won't take accept new inputs. If this happens, stop Node-Red with ctrl+c and re-enter `~/cm2305/pi/start.sh`.
## Website ##
\ No newline at end of file
If a component is misconfigured and interferes at a point in time after passing the Lock node but not the Unlock node, the system will never reset and won't take accept new inputs. If this happens, stop Node-Red with ctrl+c and re-enter `~/cm2305/pi/start.sh`.