- Introduction
- UX
- Development Planes
- Features
- Design
- Issues and Bugs
- Technology Used
- Testing
- Deployment
- Credits
- Acknowledgements
This is a back-end program for veterinarians to do the following:
- Calcolate and save data of subjects (in this case dogs).
- Calcolate if the dog is underweight, overweight or in ideal weight.
- Calcolate as well calories per day that dog should take based on weight and life stage.
- Get general information about dogs.
- Be able to save and have summary of all dogs inserted.
- Be able to save more dogs and have them display all together.
The developer wanted to address a real-every-day problem such as calculate how many calories per day a dog should get based on different factors.
This is a program created for the third of five Milestone projects required to complete the Diploma in Software development (eCommerce Applications) program at Code Institute. The main requirement of this project is to use PYTHON as the main technology.
The ideal user demographic for this program are:
- Veterinarians
- People with basic information on BCS to calculate how many calories per day to give dog
The developer divided user goals into the following categories:
- New user
- Old user
New user
The main goals are the following:
- Understand straight away what this program can offer
- Be able to create an account
- Get general information on dogs
- Be able to calculate if dog is overweight, underweight, or ideal weight
- Calculate which one should be the ideal weight for the dog
- Calculate how many calories per day I should give the dog
- See the summary of the calculation in a table or a file
Old user
The main goals are the following:
- Be able to log in without creating another account
- Calculate another dog's calories and ideal weight
- Be able to have a summary of all dogs already inserted
- Read general information as many times as needed
Project purpose:
To build a command-line application that allows users to manage a common dataset about a particular domain.
The vet application was chosen by the developer for the personal interest of the developer in dogs, and to try and create something useful for an everyday task to address a specific target audience.
Development planes were made in the following order:
- Strategy
- Scope
- Structure
- Skeleton
Used to determine developer goals and user needs.
Chosen target audience:
- Veterinarian
- People with basic vet information
The developer goals were the following:
- Create an application that could pass through validators without error
- Address an everyday need and try to simplify human tasks using language learned
- Present the application in a clean and easy-to-understand manner
- Try to give even if simple good UX experience
User needs were the following:
- Calculate if a dog is under, over, or ideal weight
- Calculate how many calories to give to the dog based on the weight
- Have visual effect if wrong or right input inserted
- Summary at the end of the program with all information displayed
- Few questions to simplify the process
- After each section choose to end the program
The developer has to get the following information about the user:
- Username
- Password
- Unicode ( just for login )
When a username and password are created and validated, a random number called Unicode will be assigned to a user.
The user will have to save this number to login.
The developer has to get the following information about the dog:
- Name
- Weight
- BCS (Body Score condition)
- Life Stage
Now that we have established the goals of the program we can deduce the necessary features:
- Multiple choice for the user to let him decide what he would like to do
- Inputs to insert required data
- Color effect on right and wrong values inserted
- Message user frequently based on the process and the values given
- Calculate the final calories per day to give the dog
- Calculate difference between weight an ideal weight
- Table to insert at the end of the program for a summary of values provided and calculated
- Saved user data in an external sheet
- Save dog's data to be able to access it when the user login
Structure for the application was made using Canva.
Firstly the developer searched all information online to see how to calculate everything and create a basic structure.
With the information found then she created a formulas chart.
Then the developer creates a structural map based on importance and on how to calculate everything.
The structure was then divided in two main sections:
- General info = Where the user will just get information
- Main section = Where the user will insert data and get back the result
The map structure was changed slightly, adding the multiple-choice possibility for the user to show saved dogs in final table.
- General section = User will get general information and advice on dogs based on weight, BCS, and life stage.
- Input:
- Name = Name of dog ( max 10 letters )
- Weight = Weight of the dog measured at the moment ( from 0 to 100 kg)
- BCS = 0 to 9 ( 9 scale BCS )
- Life Stage = Depending on the following criteria:
- Working dog = Exercise( Light: 2 - Moderate: 4 - Heavy: 6)
- No working dog = If the dog ( Intact: 1.8 - Neutered: 1.6)
- Ideal, over or underweight = If a dog ( Ideal weight: life-stage * weight - Over/Underweight: life-stage * ideal weight)
- Calculation:
- Ideal weight = Based on BCS and weight
- Calories = How many calories per day should the dog get based on ideal weight and life stage.
- Table = Summary table at the end of the application with all data inserted from the user and conclusion.
- Multiple choice = Used mainly to change section from main to general and vice versa. Or to restart and end the program.
- Visual effect = To give users a better UX experience.
- Google sheet = To get the data, and saved it the developer used gspread This Google worksheet can be used to visualize how the data are saved and stored.
Due to limited resources (time constraints, skills of the developer at the moment, and other reasons), some features were not implemented.
- Be able to access old dog's data with login and be able to update already saved data with new values. Having updated data showed as well in the final summary.
- Be able to access in get general information automatically the correct options, without printig all the list manually. Developer in authomatic was checking if the input inserted from user was in the list until N 5 error (explained in issues and bugs) was found.
- Be able to find a solution for the unfixed bug, disabling and unabling keyboard pres during slow_type text.
The design of a command line application is usually very simple. The developer though decided that for a better UX experience would be implemented:
- Colors:
- Red = Would be assigned to a wrong value inserted by the user to help him visualize the error.
- Green = Would be assigned to the correct value inserted by the user to help him visualize that no error was given when data are saved correctly and intro and ASCII art.
- Blue = Would be assigned to general information and return calculation to highlight it from other text.
- Yellow = Would be assigned to important data, such as if the dog is underweight or overweight.
- Space = More space between sections and important sentences to highlight the right information.
- Time = Between different functions and calculations for better UX.
- Clear = Functionality to eliminate section by section to not overwhelm the user with information.
- Intro design = Intro design using ASCII art, to give a better user experience.
- Tabulate = Fancy tabulate in blue, to give a better user experience when showing saved information to the user.
The developer found different issues and bugs during the creation of the application, the main issues and bugs are listed below.
-
- Issue: If a user created the account and would just get general information, credentials would have not been saved in the external sheet.
- Solution: Instead of saving all data directly in update_worksheet at the end of calculate dog, the developer adds update_worksheet when selecting end program so that also if the user created the account and ends the program, the user information will be saved.
-
- Issue: When saving and calculating two dogs, instead of showing in the table in different lines, all info was appended to the same line,
modifying all data and final tabulate. - Solution: Developer searched for a way of clearing the global variables where saving the list of information, each time the user wanted to calculate a new dog. Used StackOverflow : del INFO[:] Empty the list before starting to calculate a new dog.
- Issue: When saving and calculating two dogs, instead of showing in the table in different lines, all info was appended to the same line,
-
- Issue: When calculating mer the calculation would have always returned that the dog was underweight also if it shouldn't.
- Solution: Typing mistakes of the developer was using the wrong index from saved data that return wrong calculations. Change for the right index to fix minor issues.
-
- Issue : Big issue found when printing the tabulate in show_dogs function. When the user login it would have worked perfectly, while when creating the account, it was displaying an empty tabulate.
- Solution: To find the solution the developer first prints out all the data to see if not correct data were arriving in the final function. When checked that all data were correct, the developer try to understand the difference in the path between login and creating an account. The only difference was the Unicode. But the Unicode was arriving in the final function perfectly when printed out in the final function Unicode was correct. At that point, the developer thought that the path for the Unicode to arrive was different. From login, it would have arrived from the external sheet, while creating the account from another function. So that is how the developer arrive at to understand that the Type of Unicode was different. Printing out the Unicode developer saw that one was an INT and the other a STR. To fix the error finally developer just implemented in last function str(Unicode).
-
- Issue : When testing the application , developer found an error that would stop all application, when user select 0 in get general information. It
would have given the following error: gspreaad.xxceptions.IncorrectCellLabel : (1, 0). The developer tried to check if the value inserted was equal to 0 or minor than the printed options, but it would have still give the error. - Solution : To solve the issue, developer add a new if statement to check if the number was in the possible option list, and it fixed the issue.
- Issue : When testing the application , developer found an error that would stop all application, when user select 0 in get general information. It
The main language used was Python. All other languages used were provided by Code institute to use as a base to show the deployed project.
The developer used different external programs throughout the development of this project.
Below are all the external programs used :
- Heroku
- Heroku was used to deploy a final project.
- GitPod
- GitPod was used for writing code, committing, and then pushing to GitHub.
- GitHub
- GitHub was used to store the project after pushing.
- Canva
- Canva was used to create structural and formulas maps.
- Am I Responsive?
- Am I Responsive was used to see responsive design throughout the process and to generate mockup imagery to be used.
- Ezgif
- Ezgif was used to convert all videos to gifs for the testing file.
- Free screen recorder
- Free screen recorder was used to screen record all videos for the testing files.
Testing information can be found in a different Testing file
The project was written with GitPod, and pushed to GitHub. It was then deployed on Heroku.
To deploy everything to Heroku the following steps were taken:
- Add dependencies in GitPod to requirements.txt file with command "pip3 freeze > requirements.txt"
- Commit and push to GitHub
- Go to the Heroku Dashboard
- Click "Create new app"
- Name app and select location
- Add Config Vars for Creds and Port in Settings tab
- Add the buildbacks to Python and NodeJS in that order
- Select appropriate deployment method, GitHub
- Connect to Github and link to repository
- Enable automatic deployment
- Click on Deploy
All knowledge on which formulas to use for all calculation in the project, and all general information were token by the developer from the following:
General information is displayed in getting general information and was summarized from the following articles:
- Dangerous food for dogs : Pets
- Human food good for dogs : Cosmicpet and MarieClaire blog
- Four healthy habits for dogs : Daisybeet
- BCS = Body condition score : Petmd
- When a dog become a senior : Thehealthypets
- 6 signs your dog is healthy : Petinsurance
- Why and when contact the vet : Vetmd
The following formulas were find by the developer in order to calcolate ideal weight, and which value to use based on life stage of the dog:
- Energy requirements calculation : Aaha
- Calculate dog healthy weight : Petmd
- Life stage factors : Vet osu
- Working dogs factor : Wilmotveterinaryclinic
Different website were checked during the duration of the project. Mostly the developer checked Stackoverflow to resolve issues and for general knowledge.
Many times the developer checked online to resolve and check for information , below are a few links where developer found the answers:
- The developer checked this Link to check for if input inserted was a letter or int .
- The developer checked this Link to check how to stop and wait for a specific time before running next function.
- The developer checked this Link to check how to print ASCII art.
- The developer used his previous project, Newline Alebrije, as a source for looking up the code for README purposes mainly.
- The developer used his previous project, Star Wars Quiz, as a source for looking up the code for TESTING purposes mainly.
This whole project is dedicated to Carl Sagan, astronomer, planetary scientist, cosmologist, astrophysicist, astrobiologist, author, and science communicator. His book 'Cosmos' inspired me as a child and geared me towards sciences and astronomy.
Without support I got from other people, this project would never be realized. I'll try and remember to thank everyone and everything I can!
- My family and my friends to help me find an interesting topic to build the project, and helped me testing it.
- To my girlfriend, thank you for always believeing in me and supporting me in everything that I do.
- Slack community, thank you for being a constant source of good information.
- For mu tutors, without them this application would have not been what it is, for their invaluable help and guidance throughout the process.
- Koko, my mentor, thank you for being an incredible source of solutions and good advice.
- Stack Overflow. Thank you for existing.