Skip to content

User interface for Elephant Vending Machine in coordination with Cincinnati Zoo

License

Notifications You must be signed in to change notification settings

Kalafut-organization/elephant_vending_machine_frontend

Repository files navigation

build MIT license codecov docs

Elephant Vending Machine

OSU CSE 5911 Capstone Project: Elephant Vending Machine in coordination with Cincinnati Zoo. Designed to facilitate automated behavioral psychology experiments.

Dependencies

For this project to run successfully, you must have installed:

  • Node >= 8.10
  • npm >= 5.6

Viewing Documentation

  1. Navigate to the root directory of this project
  2. Run npm run docs
  3. Open the generated page in docs/index.html in a browser
    • Up to date documentation can be found here.

Running linting

  1. Navigate to the root directory of this project
  2. 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

Running tests

  1. Navigate to the root directory of this project
  2. Run npm test
    • A coverage report can be viewed with npm run test:coverage

Running in production

  1. Clone this repo to the Pi
  2. Navigate to the cloned directory
  3. Install docker and docker-compose
  4. Ensure that the .env file has the address that the backend is using. For the backend running in docker, this should be http://192.168.0.100.
  5. 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 or docker-compose down
    • For the build to be successful, you will most likely need to temporarily disable to static IP of the pi.

Running in Dev

You will need to run commands on the server Pi though ssh network commands, this is included in these instructions.

  1. Connect to the same network as the Server Pi and navigate to your terminal
  2. run command, ssh [email protected]
  3. A sign in should appear, username is pi password is raspberry
  4. You should now be in the Server Pi terminal
  5. Enter the directory for the backend by running command cd elephant_vending_machine_frontend
  6. Ensure that the .env file has the address that the backend is using. For the backend running in development with Flask, this should be http://192.168.0.100:5000.
  7. Run this command npm start
    • You may first need to run export NODE_OPTIONS=--openssl-legacy-provider
  8. The front end should open on your web browser

Running Automatically

You will need to run commands on the server Pi though ssh network commands, this is included in these instructions.

  1. Connect to the same network as the Server Pi and navigate to your terminal
  2. run command, ssh [email protected]
  3. A sign in should appear, username is pi password is raspberry
  4. You should now be in the Server Pi terminal
  5. Enter the directory for the backend by running command cd elephant_vending_machine_frontend
  6. Execute the setup shell script "setup.sh" by running the command "bash setup.sh" in terminal
  7. Assuming connections are good, this script will launch front-end and back-end.
  8. 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

About

User interface for Elephant Vending Machine in coordination with Cincinnati Zoo

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages