Diabetes type 2 risk calculator is the terminal program in the form of questionnaire that helps to find out your risk of type 2 diabetes in the next 10 years.
It's a well-known questionnaire in different countries as the diabetes problems exist almost everywhere and you can read about this more, for example, here (in English language): https://www.diabetes.org.uk/
When user pass through this questionnaire he/she will find out that potential risk level for developing diabetes in the next 10 years of life depending on points earned. Each answer corresponds a certain number of points. Points are not displayed to the user until the end of the questionnaire with the aim that user is being honestly. So in the end program calculates total points quantity and provides conclusion with recommendations what to do.
This program doesn't save or transfer any data users provide to aim anyone cannot identify users due to possible sensitive data for them.
Diabetes type 2 risk calculator can be accessed by this link
- As a First Time Visitor, I want to quickly understand the program's primary purpose so that I can learn more what that program is about.
- As a First Time Visitor, I want to navigate through the program easily so that I can find the content.
- As a First Time Visitor, I want to find the program useful for myself so that I can fulfill my expectations.
- As a Returning Visitor, I want to pass through the questionnaire if I didn't yet so I can start it just in one click.
- As a Returning Visitor, I want to see my final points and recommendations what to do so it's information always be there.
- As a Frequent User, I want to have possibility restart the program if I forgot some parameters or wasn't ready or something have changed in my life so I can restart the questionnaire.
-
The user can see a welcoming message which describes what the program is about and the question if user wants to start the test:
-
The user can see a Goodbye message:
-
User can see that the screen have been cleared and the first question "How old are you?" with some answer options menu navigated by cursor Up or Down displayed. Choosing options accomplished by hitting "Enter" button on the keyboard:
-
User can see the result of his/her choice. Text from the chosen option is displayed. Also next question is displayed and the user have to answer with his/her gender. Choosing options accomplished by hitting "Enter" button on the keyboard as well:
-
User can see the result of his/her choice and the third question is diplayed welcoming to choose option that corresponds of the user's waist measurement. Also displayed a hint how to measure it. Displaying waist options is based on gender have chosen in the previous question. Choosing options accomplished by hitting "Enter" button on the keyboard as well:
-
During all next questions user will see the result of his/her choice from the previous questions. On fourth question "How tall are you in centimeters?" user have to input his/her height typing it on a keyboard with digits:
-
On fifth question "How much do you weight in kilograms?" user have to input his/her weight typing it on a keyboard with digits:
-
After answering on fifth question user can see calculated result of his/her BMI - Body Mass Index with the description what it is and comment if it's good, average or bad.
After that user can see sixth question: "How often do you eat vegetables, fruits or berries?". Answer options menu already exist as in the first three questions and it navigates by cursor Up or Down. Choosing options accomplished by hitting "Enter" button on the keyboard:
-
Seventh question: "Do you do physical exercises? (including walking for 30 minutes every day at least 3 hours during the week)". Answer options menu already exist. Choosing options accomplished by cursor and hitting "Enter" button on the keyboard. Also in all the rest questions.
-
Eighth question: "Have you ever taken medication to lower your blood pressure?":
-
Ninth question: "Have you ever had high blood sugar level? (during check-ups, illness or pregnancy)":
-
Tenth question - the last one. "Did any of your relatives have type 1 or type 2 diabetes?":
-
Conclusion is based on calculated sum of points user earned answering on questions which correspond a certain number of points each. Conclusion is represented by a range of points and recommendations what user may do next in life.
Also displayed a question either user wants to start test again or quit.
The flowchart represents the logic of the application:
- Python: used as one and only the project programing language and direct all application behavior
- JavaScript: used to provide the start script needed to run the Code Institute mock terminal in the browser
- HTML used to construct the elements involved in building the Code Institute mock terminal in the browser
- Simple Terminal Menu was used to implement the menu.
- Colorama was used to add colors and styles to the project.
- was used import introduction() function from separate python file "introduction.py"
- Git - Git was used for version control by utilizing the Gitpod terminal to commit to Git and push to GitHub
- GitHub - GitHub was used to store the project's code after being pushed from Git
- Heroku - Heroku was used to deploy the live project
- Lucidchart - Lucidchart was used to create the flowchart
- PEP8 - CI Python Linter was used to validate all the Python code
- Awesome Screenshot - Chrome extension was used to making screenshots
Please refer to the TESTING.md file for all test related documentation.
Note:
- This project requires you to have Python installed on your local Linux PC:
sudo apt install python3
- You will also need pip installed to allow the installation of modules the application uses.
sudo apt install python3-pip
Create a local copy of the GitHub repository by following one of the two processes below:
-
Download ZIP file:
- Go to the GitHub Repo page.
- Click the Code button and download the ZIP file containing the project.
- Extract the ZIP file to a location on your PC.
-
Clone the repository:
- Open a folder on your computer with the terminal.
- Run the following command
git clone https://github.com/dimmando/diabetes.git
-
Alternatively, if using Gitpod, you can click below to create your own workspace using this repository.
-
Install Python module dependencies:
- Navigate to the folder diabetes by executing the command:
cd diabetes
- Run the command pip install -r requirements.txt
pip3 install -r requirements.txt
-
Clone the repository:
- Open a folder on your computer with the terminal.
- Run the following command
git clone https://github.com/dimmando/diabetes.git
- Create your own GitHub repository to host the code.
- Run the command
git remote set-url origin <Your GitHub Repo Path>to set the remote repository location to your repository. - Push the files to your repository with the following command:
git push - Create a Heroku account if you don't already have one here Heroku.
- Create a new Heroku application on the following page here New Heroku App:
- Choose deployment method from GitHub
- Link your GitHub account and connect the application to the repository you created.
- Go to the Settings tab:
- Click "Add buildpack":
- Add the Python and Node.js buildpacks in the exact order as written here.
- Click "Reveal Config Vars"
- Add 1 new Config Vars:
- Key: PORT Value: 8000
- This Config was provided by CODE INSTITUTE.
- Go back to the Deploy tab:
- Click "Deploy Branch":
- Wait for the completion of the deployment.
- Click "Open app" to launch the application inside a web page.
- future code optimization
- https://www.diabetes.org.uk/ - The British Diabetic Association
- Color formatting: Colorama
- Terminal menu: Simple Terminal Menu
- heroku.com - for hosting the application
Julia Konovalova - Thanks a lot to my mentor Julia Konovalova for her help and support














