✍️
Team FitBob
  • Introduction and Foreword
  • Motivation
  • Features
  • Tech Stack
  • Software Engineering Practices
    • Requirements
    • Software Design Patterns
      • Model View Controller (MVC)
      • Abstraction Occurrence Pattern
  • Deployments
    • Trying Our App
  • Activity diagram
  • Frontend
    • Login
    • User Registration
    • Client Screens
      • Client Dashboard
      • Client Profile
      • Eating History
      • Meals
    • Personal Trainer screens
      • Personal Trainer Profile
      • Personal Trainer Dashboard
        • Clients
        • Meal plans
        • Meals
    • Recipe screens
    • Search screen
    • Searching for Restaurants
    • Notes on BeautifulSoup and Flask
    • Request/Success/Failure Cycle
  • Backend
    • Notes on Django
    • API
    • Entity relationship diagram
  • Testing
    • User Testing
    • Backend
  • Project Limitations and Constraints
  • Closing Thoughts.
  • Project log
  • Poster
Powered by GitBook
On this page

Was this helpful?

  1. Frontend

User Registration

The user registration process for both personal trainers and clients.

PreviousLoginNextClient Screens

Last updated 3 years ago

Was this helpful?

Users have to choose if they are registering as a personal trainer or client, as it will affect their registration process.

This step is identical for both types of users.

Client

Here, clients will let the app know if they have an existing personal trainer they are engaging, using the referral code that the personal trainer will provide. Otherwise, they can also register and use the app without a personal trainer.

Personal Trainer

The personal trainer may upload a picture of their certificate.

Clients

This page serves the purpose of gathering the client's current biometric details, which will be used to compute their daily calorie intake goal. This can be edited by their personal trainer or by themselves.

How the daily calorie intake is calculated

/* Calculates the target calories for a user */

/* Inputs
	- Weight (in kg)
	- Height (in cm)
	- Age (in years)
	- Gender (0 for male, 1 for female)
	- Activity Level (0, 1, 2, 3, 4)
   Output
	- Total caloric expenditure
		-> user will eat MORE or LESS calories than this, depending on goal
*/
export default function calculateCalories(weight, height, age, gender, activityLevel) {
	// FIRST STEP: Calculate BMR (different for males and females)
	const maleBMR = (10 * Number(weight)) + (6.25 * Number(height)) - (5 * Number(age)) + 5;
	const femaleBMR = (10 * Number(weight)) + (6.25 * Number(height)) - (5 * Number(age)) - 161;

	// SECOND STEP: Multiply by specified activity level
		/* TO DETERMINE WHICH MULTIPLIER TO USE, 
			- Sedentary (little or no exercise) : Calorie-Calculation = BMR x 1.2
			- Lightly active (light exercise/sports 1-3 days/week) : Calorie-Calculation = BMR x 1.375
			- Moderately active (moderate exercise/sports 3-5 days/week) : Calorie-Calculation = BMR x 1.55
			- Very active (hard exercise/sports 6-7 days a week) : Calorie-Calculation = BMR x 1.725
			- If you are extra active (very hard exercise/sports & a physical job) : Calorie-Calculation = BMR x 1.9

		** Source: https://www.omnicalculator.com/health/bmr-harris-benedict-equation ** 
		*/

	if (gender === 0) {
		switch(activityLevel) {
			case 0:
				return (maleBMR * 1.2); 
			case 1:
				return (maleBMR * 1.375);
			case 2:
				return (maleBMR * 1.55);
			case 3: 
				return (maleBMR * 1.725);
			case 4: 
				return (maleBMR * 1.9);
			default:
				return (maleBMR * 1.2);
		}
	} else {
		switch(activityLevel) {
			case 0:
				return (femaleBMR * 1.2); 
			case 1:
				return (femaleBMR * 1.375);
			case 2:
				return (femaleBMR * 1.55);
			case 3: 
				return (femaleBMR * 1.725);
			case 4: 
				return (femaleBMR * 1.9);
			default:
				return (femaleBMR * 1.2);
		}
	}
}

Personal Trainers

We plan to add more questions in the near future.

Personal trainer's questions page