Getting started • Running the program • Running tests • Links
- Python 3.6.x (Python 3.6.x is mandatory for eyetracker to work)
- pip
- NodeJS
# Navigate to the backend folder
$ cd backend
# Install the required python dependencies
$ pip install -r requirements.txt
In addition to installing the python dependencies, you will need to follow the instructions to set up the Empatica e4 wristband, Tobii eyetracker and OpenPose, which can be found in the docs folder.
# Navigate to the backend folder
$ cd frontend
# Install the node dependencies
$ npm install
After following the instructions above, and having set up the devices, you can start the program.
# Navigate to the backend folder
$ cd backend
# Run the backend program
$ python main.py
# Navigate to the frontend folder
$ cd frontend
# Run the frontend program
$ npm start
The dashboard website should now show up. You can now enter the IP and port address belonging to the backend program. If you are running both the backend and the frontend on the same computer, these will be 127.0.0.1 and 8888 respectively. Otherwise the IP adress will be printed in the python terminal window.
After starting the backend and frontend, and inputting the IP and port address, a websocket connection will be established. The calculated measurements will now be shown in the dashboard.
You can
view more detailed information about them by clicking on a measurement.
Our test suite consists of unit tests, integration tests and linter for the backend, whereas the frontend only uses linter. The reason for this is that the frontend was a low priority, and more of a way to showcase what we have developed.
We achieved 80% test coverage of our backend. Most of the code is tested with our test suite, with the exception of the connections to the devices, which we thoroughly tested manually.
# Navigate to the backend folder
$ cd backend
# Run the test suite with coverage report
$ python -m pytest --cov=crunch/
# Navigate to the backend folder
$ cd backend
# Run the linter
$ flake8
# Optional: run the "import formatter"
$ isort -rc . --skip venv openpose
# Navigate to the frontend folder
$ cd frontend
# Run the linter
$ npm run lint