The Cooper Test Challenge
Craft Academy - week 7 out of 12
May 2019
We have a client request to build a fitness tracking application. The idea is that the app will allow users to track their condition using a specific test called The Cooper Test.
The challenge is to build a software solution that will make it possible not to only make the calculation, but to record the data over time. Another requirement is that the app should have functionality that presents historical data of tests if a user has saved any historical data.
The Cooper Test (aka The 12-minute run) was developed by Dr. Ken Cooper in 1968 as an easy way to measure aerobic fitness and provide an estimate of VO2 max for military personnel. The Cooper test, as it's also known, is still used today as a field test for determining aerobic fitness.
Dr. Cooper found that there is a very high correlation between the distance someone can run (or walk) in 12 minutes and their VO2 max value, which measures the efficiency with which someone can use oxygen while exercising. This test is still one of the basic fitness tests used by the military. It is also used by many coaches and trainers to determine cardiovascular fitness and track fitness over time. This simple test also allows you to compare your cardiovascular endurance with others of your age and gender.
For the pusrposes of this project we built a backend API solution using Ruby on Rails and a frontend client solution using React. The repositories where the code is available are the following:
- The API was deployed using Heroku. The link to access it is here. Since this is only an API interface there are no views. So when you hit the link above do not expect to see something in your browser.
- The CLIENT was deployed via Netlify. You can visit it here. This is where everything happens.
You can use the following credentials if you want to see the application in full action.
- email: user@mail.com
- password: password
Please be patient while the client loads. Since both services are hosted on free servers, the speed is not as instant as you might be used to.
You must have Ruby
, Ruby on Rails
, Node.js
, Bundler
and PostgreSQL
installed in your system to be able to view this app and run all feature, unit and acceptance tests. After forking the repository run bundle install
so that you download all the gems used in the project.
- To fire up the rails API server, first you will have to create and migrate the databases. To do that, you run in your terminal
rails db:create
andrails db:migrate
. For the server to activate, runrails server
in your terminal. - To fire up the react client, run
npm start
in your terminal.
- The API was unit tested using Rspec. To run the tests in your terminal use
bundle exec rspec
. - The client was tested using Cypress and Enzyme. To run the acceptance tests of Cypress use
npm run cy:open
. To run the react component Enzyme tests usenpm run test
.
- Rspec - Behvavior Driven Development for Ruby
- Cypress - a complete end-to-end testing experience
- Jest & Enzyme testing frameworks for React
This project is licensed under the MIT license.
- PurpleBooth for this README template.
- Zane and Carla for showing us how to complete the logout functionality.