Skip to content

CrunchWiz is a full-stack application for calculating measurements from sensors and displaying them in a dashboard.

Notifications You must be signed in to change notification settings

haakonjacobsen/crunch-wiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Watch the video

CrunchWiz is a full-stack application for calculating measurements from sensors, and displaying them in a dashboard.

Getting startedRunning the programRunning testsLinks


Getting started

Prerequisites

Setting up the backend

# 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.

Setting up the frontend

# Navigate to the backend folder
$ cd frontend

# Install the node dependencies
$ npm install

Running the program

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.

view of connect screen on frontend

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.

view of all the measurements

You can view more detailed information about them by clicking on a measurement. detailed view of one measurements

Running tests

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.

Unit and integration tests

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/

Linter backend

# Navigate to the backend folder
$ cd backend

# Run the linter
$ flake8

# Optional: run the "import formatter"
$ isort -rc . --skip venv openpose

Linter frontend

# Navigate to the frontend folder
$ cd frontend

# Run the linter
$ npm run lint

Links

About

CrunchWiz is a full-stack application for calculating measurements from sensors and displaying them in a dashboard.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published