Skip to content

Latest commit

 

History

History
68 lines (49 loc) · 2.98 KB

File metadata and controls

68 lines (49 loc) · 2.98 KB

ShapeShift

A website designed to help people start or continue their fitness journey in various ways, including workout routines, recipes, calorie trackers, and much more designed for each person's wants and needs.

External Requirements

In order to build this project you first have to install:

  • Node.js : must be installed from the website.
  • MySQL : must be installed from the website.
  • React : launched in the command line with the command

Setup

  • Set up local database with the mySQL commands in server/data.sql file.

  • Create the file server/.env and add the following:

    • DBUSERNAME= This should be database username used to log in to a mysql server
    • PASSWORD= This should be database password used to log in to a mysql server
    • HOST= This should be where the database is hosted on. e.g. localhost if running locally
    • DBPORT= This should be the port that connects to the database. e.g. 3306
  • Create the file client/.env and add the following:

    • REACT_APP_SERVERURL= This should be the URL of the backend server. eg. http://localhost:8000 if running locally
  • Run npm install in the main directory, then in the client folder, and the server folder.

Running

  • Run npm start in the client and server folder

Deployment

We used Render to deploy our front and back end. The front is deployed as a static site an the back is deployed as a Web Service. https://render.com/

Our database is deployed on Amazon RDS for mySQL. https://aws.amazon.com/rds/mysql/

Testing

Tests Locations

The current behavorial tests are in /cypress/e2e.

The current unit tests are in /unit.

Testing Technology

  • Cypress for Behavioral
  • Jest for Unit

Running Tests

Cypress (Behavioral)

  • Run npm install cypress --save-dev in terminal.
  • Run npx cypress open in terminal.
  • Once Cypress window pops up, select 'E2E Testing'.
  • Choose the browser you want the test to run in and click "Start E2E Testing in ...".
  • Finally, select the test you want to run and it runs automatically.
  • To ensure the all tests function as expected:
    • First, clear your local database to ensure all tables are empty. The necessary commands for this can be found in the comments at the beginning of the RunFirstPopulationTest.cy.js test.
    • Next, execute the RunFirstPopulationTest.cy.js test. This test initializes the database and generates the necessary data, such as users and workout programs, that subsequent tests depend on for proper execution.
    • Once the above tasks are completed, you may proceed to run the remaining tests in any order.

Jest (Unit)

  • Run npm install --save-dev jest in terminal.
  • Run npx jest or npm test to test all cases

Authors