Habit Tracker CLI π― This is a Command Line Interface (CLI) application designed to help users track their habits and monitor their progress. Users can register, log in, add habits, mark habits as complete, view analytics, and more, all through a text-based interface.
π Getting Started
1οΈβ£ Clone the Repository
2οΈβ£ Dependencies Make sure you have Python 3.x installed on your system.
3οΈβ£ Install Required Libraries Run the following command to install the required libraries:
pip install sqlite3
4οΈβ£ Run the CLI Navigate to the project directory in your terminal and run the following command:
python cli.py
This will start the Habit Tracker CLI and guide you through the available options.
π Usage When you run the CLI, you'll be presented with options to register, log in, or quit.
After π logging in, you can β add habits, ποΈ view your habits, π§Ή delete some if needed, βοΈ mark habits as completed, π₯ check your rewards, π view analytics, or π log out.
π Logging in as TeeLv Ensure that the provided SQLite database file habit.db is located in the same directory as the script. To log in as user TeeLv use: Username: TeeLv Password: 12 If the login is successful, the program will be able to show TeeLv's analytics for 4 weeks of usage of the application.
βIn case the database is lost/damaged, first in CLI register a new user with a username: 'TeeLv' and the password: '12', then navigate to the project directory in your terminal and run the following command:
python TeeLv.py
This will automatically populate TeeLv's habits, reminders, and completions.
π Pre-defined Habit Descriptions for TeeLv User TeeLv has been predefined with 5 habits as follows:
π Morning Run:
Description: Run for 30 minutes every morning
Periodicity: Daily
Reminder: None
π Read Book:
Description: Read a book for 1 hour
Periodicity: Daily
Reminder: Daily at 13:00
π§ββοΈ Weekly Meditation:
Description: Meditate for 2 hours every weekend
Periodicity: Weekly
Reminder: Weekly at 10:30
πΈ Guitar Practice:
Description: Practice playing the guitar for 1 hour
Periodicity: Daily
Reminder: None
π£οΈ Learn 50 Words in Thai:
Description: Learn 50 words from a foreign language
Periodicity: Monthly
Reminder: None
π Reward System
Points and Broken Streaks: For every habit marked as completed, the system will award a user with 10 points. Upon successful login, the system will check for any broken streaks for user's habits. Every time a streak is broken, a user will be penalized by deducting 10 points. However, this deduction is executed only once on a given date. This means if a user logs out and logs back in on the same date, the points will not be deducted again. Example: If TeeLv has broken 3 streaks today and hasn't logged in until today, 30 points will be deducted upon the first login. Subsequent logins on the same day will not lead to further deductions.
Check Points: To check the total points, use option "4" in the menu.
Explanation for Points Deduction: The rationale for the points system is to motivate the user to maintain consistency in their habits. By penalizing broken streaks, we hope to encourage users like TeeLv to stick to their habits and achieve their goals.
π To Run the Tests Navigate to the project directory in your terminal and run the following command: python tests.py
π Technology Stack
Language: Python
Database: SQLite