OSU CSE 5911 Capstone Project: Elephant Vending Machine in coordination with Cincinnati Zoo. Designed to facilitate automated behavioral psychology experiments.
For this project to run successfully, you must have installed:
- Node >= 8.10
- npm >= 5.6
- Navigate to the root directory of this project
- Run
npm run docs
- Open the generated page in
docs/index.html
in a browser- Up to date documentation can be found here.
- Navigate to the root directory of this project
- Run
npm run lint
- Note: Code is automatically formatted with Prettier on each commit. You can use
npm run format
to run the formatter manually
- Note: Code is automatically formatted with Prettier on each commit. You can use
- Navigate to the root directory of this project
- Run
npm test
- A coverage report can be viewed with
npm run test:coverage
- A coverage report can be viewed with
- Clone this repo to the Pi
- Navigate to the cloned directory
- Install docker and docker-compose
- Ensure that the
.env
file has the address that the backend is using. For the backend running in docker, this should behttp://192.168.0.100
. - Run
docker-compose up --build
to build and start the container- This will ensure the app automatically restarts in case of errors or reboots.
- To stop the containers you can use
ctrl-c
ordocker-compose down
- For the build to be successful, you will most likely need to temporarily disable to static IP of the pi.
You will need to run commands on the server Pi though ssh network commands, this is included in these instructions.
- Connect to the same network as the Server Pi and navigate to your terminal
- run command,
ssh [email protected]
- A sign in should appear, username is
pi
password israspberry
- You should now be in the Server Pi terminal
- Enter the directory for the backend by running command
cd elephant_vending_machine_frontend
- Ensure that the
.env
file has the address that the backend is using. For the backend running in development with Flask, this should behttp://192.168.0.100:5000
. - Run this command
npm start
- You may first need to run
export NODE_OPTIONS=--openssl-legacy-provider
- You may first need to run
- The front end should open on your web browser
You will need to run commands on the server Pi though ssh network commands, this is included in these instructions.
- Connect to the same network as the Server Pi and navigate to your terminal
- run command,
ssh [email protected]
- A sign in should appear, username is
pi
password israspberry
- You should now be in the Server Pi terminal
- Enter the directory for the backend by running command
cd elephant_vending_machine_frontend
- Execute the setup shell script "setup.sh" by running the command "bash setup.sh" in terminal
- Assuming connections are good, this script will launch front-end and back-end.
- To exit, use the CTRL-C hotkey to exit the front-end, and run the shell script "clearExperiment.sh" by running the command "bash clearExperiment.sh" in terminal