Workoutplan is a platform for people in all ages that needs help to get into training. The exercises are few, which gives anyone time to take on this challenge.
- The user get asked about their age and gets to fill it in.
- Depending on the users age a training program is shown with exercises and how many times the user should do them.
- The user then gets asked if the workout was easy.
- Incase the workout was easy it will be increased by 10% for the next day and and the new program will be added to the spreadsheet.
- Get age messages the user to add their age.
- Validate age is a while loop that will continue until the user has put an age in numbers.
- Read sheet is a while loop that makes the apperance of the information gotten from the sheet being read, exercise and the amount of times it should be done. Without it the names of the exercises would be read out first and then the amount of reps.
- Connect training makes the user access the right training program depending on the age that they put.
- Get result asks if the user thought the training was easy.
- Update worksheet will incase the user thought it was easy take the list and convert it to numbers using a for loop. Then it will add on 10% (and convert to even numbers), then make it a list again and add it on a new row in the spreadsheet.
- To being able to access the sheet and add the new training correctly a global variable is created to make it possible.
- Python is the language used to achive my goals with this app.
- To access my spreadsheet I used Gspread
- To get access I used Google Auth
- GitHub stored my app from the first time I pushed it.
- Gitpod made it possible to write my code.
- Heroku is where I depoyed my app.ct.
- Google Sheets used to store all workout programs and process.
- Pep8 was used to test my code for any issues or errors.
To test the application I've tried to enter all different ages and not ages to the first input field in the terminal. In case it's not a valid age written in numbers it will sincerely continue asking until it receives a proper answer.
After entering a valid age the user gets is workout plan from the right program. The programs are:
- Teenager 0-2o years
- Adult 21-35 years
- Mid life 36-50 years
- Elder 51-70 years
- Senior 71 and above
All programs starts by telling the user the program they where given and then shows the exercises and reps.
After the workout the user get to fill in if thet thought the workout was easy to being able to add on 10% for the next workout.
The new workout then gets added to the spreadsheet to being accessed for next time.
This work for all ages and a new program is only added to the sheet when it is being increased.
During the applications creation time I've ran into alot of issues, but with a calm mind and help from different mentors I managed to clear everything out and the app runs through Pep8 with out any errors.
In my repositry I've used the master branch to deploy workoutplan.
The workoutplan was deployed through Github pages.
-
In github repository go to settings.
-
Go to pages and use the branch menu to change to main. Refresh teh page and a link to the final project is deployed.
-
On the main site there is a fork button to create your own repository without affecting the orginal project or you could go into the project file and use the code button and clone the project directly.
(This explanation of deploying is described by AJ Greaves ) This app is deployed on Heroku.
When you create the app, you will need to add two buildpacks from the Settings tab. The ordering is as follows:
heroku/python
heroku/nodejs
You must then create a Config Var called PORT
. Set this to 8000
If you have credentials, such as in the Love Sandwiches project, you must create another Config Var called CREDS
and paste the JSON into the value field.
Connect your GitHub repository and deploy as normal.
All coding for this application is written by me. I've taken help from mentors and Stack Overflow.
The repositry is taken from AJ Greaves the teacher.