Wellbeing App
DEVELOPMENT
DEVELOPMENT
A Gantt Chart was created to manage the project. Using the software from https://www.gantt.com, a chart with the stages of the app development and corresponding subtasks, along with completion dates, was organized. Subsequently, a Gantt Chart was generated for a visual.
Finished Product Here: https://replit.com/@ChrisChen42/No-Stress-Wellbeing-App?v=1
STAGE 1
Completed: May 3rd - May 4th
1. Welcome Screen
Completed: May 3rd
Tasks finished:
This screen will greet the user, explain why stress management is important, and display in big the name of the wellbeing app: "No Stress".
Created a new function called "colored(text, color)". It will change the "text" specified in the parameters to the specified "color". The colors are pre-defined for easy use.
Press "enter" will clear the screen.
Below is the welcome screen and to the left is the code that has been finished:
2. Home User Interface (UI)
Completed: May 4th
Tasks finished:
This screen will list all of the activities corresponding to unique numbers that the user can choose from: Schedule Generator, Breathing Exercise (Stress Reliever), Bucket Game (Stress Reliever), and "exit" if they want to exit the app.
A "display_home()" function is created and can be called upon when displaying the home user interface. This will make the code less repetitive.
"if" and "elif" statements are used to handle if the user chooses an option from the list of activities, paired with an "else" statement to handle if the user inputs anything that is not in the list, then display the error.
Below is the home user interface and to the right is the code that has been updated:
STAGE 2
Completed: May 5th - 6th
1. Initialization of Variables
Completed: May 5th
Tasks finished:
Variables for the time of the pre-scheduled activities in minutes: "minsSleep", "minsWakeupBuffer", and "minsReadySleep", as well as minutes in a day stored in "minsDay".
Variable to calculate the total time of pre-scheduled activities, which will then be used to calculate how much time the user has to schedule their activities. This remaining time is stored in the "minsLeft" variable.
"last_time" is used to store the last time planned. It will be used when creating the periods for the schedule.
"scheduleGen_input" is used to temporarily hold the user's input for error checking.
"scheduleGen_table" is the variable which will hold the table that will be outputted for the user to see.
"scheduleGen_activities" is used for storing all of the entered activities in a list.
"scheduleGen_activity" is used to store a dictionary for each of the activities. The keys for this dictionary are the "name" of the activity and the "duration" of the activity.
"scheduleGen_timeInputed" is used to store and keep track of the total duration of all the activities provided by the user.
Below is the code that has been updated:
2. User Prompt: Activity Name
Completed: May 5th
Tasks finished:
While the user is entering their activities, two main trackers are used: one tracks the length of the list "scheduleGen_activities" to provide the user with information on how many activities they have entered, and "minsLeft" indicates to the user how much time they have left for planning activities within their schedule.
Prompt for user to enter the activity name. There is error checking for the following:
* If the user provides improper input, it will continue to ask for a proper one
No blank activity name
If the user types in "*finished" it will get out of the loop and make the schedule.
Below is the code that has been updated:
3. User Prompt: Activity Duration
Completed: May 5th
Tasks finished:
Prompt the user to enter the duration of the activity. There is error handling for the following:
* If the user provides improper input, it will continue to ask for a proper one
First check if the input is a positive whole number for whole minutes (decimals will make the schedule not as organized and harder to follow)
The entered duration has to be greater than 10 minutes -- this will help the user structure their time to not quick activities
The user is also restricted here if they enter a time greater than how much time left they have left for planning
If the user types in "*finished" it will get out of the loop and make the schedule.
Below is the code that has been updated:
4. User Prompt: Handle Activity Duration Over 60 Minutes
Completed: May 5th
Tasks finished:
The program checks if the duration of the activity entered by the user is more than 60 minutes and will ask the user if they want to break the activity down into different periods with breaks.
A new set of variables will be initialized:
"answer" is used for prompting the user if they do want to break down the duration of the activity.
"breakDuration" is used to store the duration of a break, which will be 15% of the broken-down durations of the activity.
"breakdownPeriods" is used to store how many periods the user wants to break down the activity into.
"breakdownPeriodDuration" is for storing the duration of each broken-down period of the activity.
The user is prompted to enter the number of periods to break the activity down into and is stored in the variable "breakdownPeriods"
The program then takes the number of breakdowns and breaks the duration of the activity into equal parts. 15% of each of the broken-down durations are then calculated for the breaks.
Below is the code that has been updated:
5. User Prompt: Storing Inputted Activity
Completed: May 6th
Tasks finished:
First, the temporary dictionary "scheduleGen_activity" is used toe store the "name" and "duration" of the activity.
Then it is "append" or "pushed" to the "scheduleGen_activites" list which contains all of the entered activities. Here is how the list is structured:
[
{
"name": "activity name (entered by user)"
"duration": "activity duration (entered by user)"
},
(... and so on with the same structure as the template dictionary provided above)
]
Below is the code that has been updated:
6. User Prompt: Storing Inputted Activity (Duration over 60 minutes)
Completed: May 6th
Similar to what is done in "Storing Inputted Activity," a loop is created to iterate as many times as specified by the user through the "breakdownPeriods" variable. During each iteration, a new temporary dictionary is created in "scheduleGen_activity," and then this dictionary is appended to the list "scheduleGen_activities." The breaks will be appended in the same manner after each segment of the activity is appended.
7. Schedule Generation: Conversions
Completed: May 6th
Tasks finished:
The "convert_minutes(mins)" function is used for converting minutes to a more "human-readable" time. For example, 130 MINS -> 2 H 10 MINS.
The "convert_to_time_period(minutes, last_time)" function is used to create time periods for each activity. It utilizes "last_time" as a reference for the ending time of the last period and then employs the duration of the activity to determine the ending time for the activity.
Below is the code that has been updated:
8. Schedule Generation: Output
Completed: May 6th
Tasks finished:
A table stored in the "scheduleGen_table" variable is created through the "prettytable" imported module. This is used to make a uniform table for the schedule. In this table, we create 3 columns with the headings: "Activity", "Time Period", and "Duration".
The pre-scheduled activities are added in each row with the ".add_row" method before and then after the not pre-scheduled activities.
A loop is used to loop through all the activities in the list. Using the "convert_to_time_period()" function, the periods of time are calculated. With this, every activity is slotted into its own row. The durations of the activities are also kept on the table for the user to take note of how long each activity is.
If there is remaining time in the variable "minsLeft", it means that the user has that much downtime that day. This downtime period is calculated and a row is created for it.
Finally, a schedule is outputted for the user to copy.
Below is the code that has been updated:
Schedule Generator Demo
1. Sample inputs for schedule generation
2. Sample schedule generation
STAGE 3
Breathing Exercise
Completed: May 7-8th
1. Initialization of Variables
Completed: May 7th
Tasks finished:
Variables "time_inhale", "time_hold", and "time_exhale" are utilized to store the duration in seconds of each segment of the breathing exercise.
The "visual_count" variable is employed to store visual counters in the form of dots, which will appear when the breathing exercise commences.
The "breathingExe_input" variable serves as a storage for user input and is subsequently utilized for error checking.
The "breaths" variable is employed to store the number of breaths the program will guide the user through.
Below is the code that has been updated:
2. User Prompts:
Completed: May 7th
Tasks finished:
The user is prompted to enter the inhale, hold, and exhale time, which is stored in their respective variables. An error handler is implemented to manage instances where the user inputs something that is not a whole number. Additionally, there is a restriction wherein the entered time in seconds should fall within the range of 3 to 8 seconds. This restriction serves to control the duration of the user's breathing, while still allowing customization of each phase of the breath.
Similarly, the user is prompted to enter the number of breaths they wish to take, with the same error handling in place to ensure a whole number is entered. However, the number of breaths is restricted to a range of 10 to 100 breaths. This limitation is crucial to ensure that the user engages in the breathing exercise effectively, without spending excessive time solely on breathing.
Below is the code that has been updated:
3. Breathing Loop:
Completed: May 8th
Tasks finished:
A loop is initiated to countdown from 3, preparing the user to commence the breathing exercise.
Subsequently, a breathing loop is established to iterate as many times as specified by the user, indicating the desired number of breaths.
Within the breathing loop, three additional loops are embedded sequentially to manage the stages of inhaling, holding, and exhaling. These inner loops tally the seconds elapsed during each segment of the breathing exercise. Concurrently, dot counters are updated every second, with blue representing inhaling, yellow representing holding, and green representing exhaling. Furthermore, the current breath count is displayed to keep the user informed of their progress.
Once the user completes the breathing exercise, the program will display an ending message and prompt the user to return to the home menu.
Below is the code that has been updated:
Breathing Excercise Demo
1. Display instructions
2. Countdown to get user ready for breathing
3. In the breathing exercise
4. An ending message is displayed, informing the user they can run this program any amount of times to relieve stress. A quote an flower is added for a more friendly image.
Bucket Game
Experimented: May 6th
Unfortunate news!
The bucket game concept involves the program dropping fish, allowing the user to maneuver a bucket to catch them. However, after extensive testing and experimentation, I discovered that implementing such a game within the Python console is virtually impossible. This limitation arises from the nature of user input handling in Python; specifically, the "input()" function halts program execution, awaiting user input, thereby preventing synchronous operation with ongoing program activities. Consequently, fish only descend after the user inputs something, rendering real-time interaction unattainable.
Now that you have read the development stages of the wellbeing app, try out the app yourself here: https://replit.com/@ChrisChen42/No-Stress-Wellbeing-App?v=1