This app is designed to allow people to registered them self for a membership at Muscle Gym. Existing custumers can also calculate the average cost per visit to the gym. They will get a full year statistic depending on what membership they have and how many times they trained each month. There is a BMI calculator to check on what level their BMI is right now. It's also possible to check how many calories they burn each day from a BMR calculator.
Here is the live version of my project
- Start menu
- Customer will be asked to type a number between 1 and 5.
There are validations to check firstly that the user only enter a number between 1 and 5. If they dont they will get a error message and be able to enter a correct number.
- Registered as a new member
- Customers will be able to registered them selfs with inside the terminal.
The information entering by the customer will be saved to a google sheet called new_customer. All inputs have validators that check so the customer is entered valid information. If not they will be asked to enter the information again.
- Calculate existing customer's membership price
- Customer is able to calculate the avarge price on how many times they visited the gym each month for the last year.
The information is already saved in a google sheet called exisiting_customer and the program will read from it how many times the customer have trained each month and what type of membership they have. Please use one of these test accounts when checking if it is working, zeitz@gmail.com (Gold) and maria@gmail.com (Silver). All inputs have validations that check so the customer is entered valid information. If not they will be asked to enter the information again.
- Calculate your BMI (Body Mass Index)
- Customer is able to calculate their body type scale with the BMI calculation.
The customer will get back information on how their BMI is right now and also if they are underweight, middleweight or overweight. All inputs have validations that check so the customer is entered valid information. If not they will be asked to enter the information again.
- Calculate your BMR (Basal Metabolic Rate)
- Customer is able to calculate their daily calorie burn rate with the BMR calculation.
Customer will get information on how many calories they should eat to maintain their current weight based on the information they enter. All inputs have validations that check so the customer is entered valid information. If not they will be asked to enter the information again.
- Exit the program
- Customer is able to exit the program
In the new_members sheet I collect all information the customer entered.
In the excisting_customers sheet I put in a summary of data for a year. I decided to store four attributes with fake data just to have something to read from. I'm aware that in a real world senario it would not look like this and every visit would be tracked but for this education project I did it like a summary.
- Allow members to cancel their membership
- Allow members to pay for their membership in the app
- Collect even more information about the members like address and hometown
- When the app finishes loading read the instructions the first part is the most important as it asks you to choose between 5 different numbers.
- After choosing the number just follow the instructions as they are on screen
- After finish the start menu will come back up again. Use 5 to exit the program or use a new number.
How I have tested the code:
- The python code has been run through the Python pep8 validation and confirmed there are no problems
- I have also run the code through many cycles adding in different values and checking that the output is as expected.
- All inputs have validation to ensure the customer enters the correct information.
- I have tested both in my local terminal and my deployed Heroku terminal
- I had this problem where I calculated the price per visit wrong. I use this formula first to get the result "price = int(values[i]) * (30 / p)". The price was getting higher if the customer was training more which it obviously shouldn't be.
I fast found out it was not working properly and also wanted to get the price to round up to only 2 decimals, so I decided to use round(). First I was getting errors from the terminal on how I did the calculation.
Finally I found out how to make the calculation work properly and could move on with no bugs. (price = round(p / int(values[i]), 2))
- No bugs remaining
- PEP8
- No errors where returned from PEP8online.com
- On the home screen click on create new app button
- Enter a name for the project and select your region to the correct region
- On the next screen select settings
- Go to config vars and click reveal config vars
- Switch to the program file and where you are keeping your credentials copy these and then on Heroku enter a name for the key and paste the code into the config vars value box and click add
- Now scroll down to buildPacks and click add build packs
- First select python and click save changes
- Click back into build packs and choose node.js and click save again
- Ensure that the Python build pack is at the top of the list you are able to drag and drop if you need to rearrange
- Now select deploy
- From the deployment method select GitHub
- Then click on connect to Github button that appears
- Click into the search box and search for the project name
- Once located select connect
- Then click deploy branch, this will then be shown in the box below
- You can the click view to show the app in a browser
The program can be deployed automatically but i have chosen to keep it as a manual deploy.
How to clone this repository.
- On GitHub go to the main page of the Repository.
- Above the list of files click the code button with the drop-down arrow.
- To clone the repository using HTTPS, under "Clone with HTTPS", click on the clipboard.
- Open the Git Bash terminal.
- Change the current working directory to the location where you want the cloned directory.
- Type git clone, and then paste the URL you copied earlier from step 3.
- Press Enter to create your local clone.
- Calculation formula for BMR
- Calculation formula for BMI
- Mail regex validation
- Code Intitute for the deployment terminal