This project helps you track and categorize your Google Tasks using AI. It started as a command-line tool and now includes a Flutter-based mobile app to visualize your productivity and habits on the go. It integrates with Google Tasks to fetch your daily activities, leverages Large Language Models (LLMs) to automatically categorize them, and provides a visual heatmap to help you understand your productivity and habits over time.
We now have a sleek and intuitive mobile application built with Flutter that brings your habit tracking to your fingertips. The app provides a beautiful interface to visualize your categorized tasks and gain insights into your daily routines.
Key Features of the App:
- Stunning Visualizations: A beautiful, interactive heatmap of your daily activities.
- Dynamic Theming: Dark and light mode support.
- Cross-Platform: Built with Flutter for a consistent experience on both Android and iOS (iOS is WIP).
(Add screenshots of the app here)
In today's fast-paced world, understanding how we spend our time and what types of tasks dominate our days is crucial for personal growth and productivity. This tool aims to provide insights into your daily habits by:
- Automating Task Analysis: Eliminating the manual effort of categorizing tasks.
- Visualizing Activity: Offering a clear, at-a-glance overview of your work, play, and health activities through both a CLI and a mobile app.
- Promoting Self-Awareness: Helping you identify patterns, balance your efforts, and make informed decisions about your time allocation.
- Google Tasks Integration: Seamlessly connects with your Google Tasks account to retrieve your task lists and individual tasks.
- AI-Powered Task Categorization: Utilizes advanced Large Language Models (LLMs) such as Google Gemini (with optional support for OpenAI models) to automatically classify your tasks into predefined categories (e.g., Work, Play, Health) and assign a difficulty level (EASY, MEDIUM, HARD).
- Flutter Mobile App: A dedicated mobile application to visualize your productivity heatmap.
- Comprehensive CLI Interface:
--setup(-s): Guides you through the initial configuration process.--list(-l): Displays all your tracked Google Task lists and tasks.--add(-a): Adds new Google Task lists to be tracked.
- Persistent Data Storage: All categorized task data is securely stored in Google Firebase Firestore.
- Mobile App: Flutter, Dart
- Backend: Python
- Task Management: Google Tasks API
- Artificial Intelligence: Google Generative AI (Gemini), OpenAI API (optional)
- Database: Google Firebase Firestore
- Authentication: Google OAuth2
- Python 3.x
- Git
- A Google Cloud Platform (GCP) account
- A Firebase project
- An API key for Google Gemini (or OpenAI, if preferred)
- Flutter SDK (for mobile app development)
-
Clone the repository:
git clone https://github.com/Skaarfacee/habit.git cd habit -
Install Python dependencies:
pip install -r requirements.txt
-
Project Setup (Google & Firebase): Follow the detailed setup guide below for setting up Google Tasks API and Firebase.
-
Navigate to the app directory:
cd app -
Install Flutter dependencies:
flutter pub get
-
Configure Firebase for the app:
- Follow the FlutterFire documentation to add Firebase to your Flutter app. You will need to place
google-services.jsoninapp/android/app/for Android andGoogleService-Info.plistinapp/ios/Runner/for iOS.
- Follow the FlutterFire documentation to add Firebase to your Flutter app. You will need to place
-
Run the app:
flutter run
This section outlines the steps required to configure the Google Tasks API and Firebase Storage for this project. Please follow each part carefully to ensure the system functions correctly.
Before you begin, make sure you have the following installed on your machine:
- Python 3.x
- Git
- Access to the Google Cloud Console
- Access to Firebase Console
To enable your app to interact with the Google Tasks API follow the steps below:
Navigate to: https://console.cloud.google.com
-
Create a New Project
- Click the project dropdown at the top left
- Select New Project
- Name your project and click Create
-
Enable the Google Tasks API
- Within your project, go to APIs & Services > Library
- Search for Google Tasks API
- Click Enable
-
Create OAuth 2.0 Credentials
- Navigate to APIs & Services > Credentials
- Click Create Credentials > OAuth Client ID
- If prompted, configure the OAuth consent screen first:
-
Set User Type to External (unless otherwise required)
-
Fill in required fields (e.g., App name, Support email)
-
Save and continue through the scopes section (no changes needed for now)
-
Add test users if necessary (usually your own email)
-
Then, continue creating credentials:
Choose Application Type: Desktop App
Name it (e.g., My Tasks Client)
Click Create
Click Download JSON to get yourcredentials.jsonfile
-
-
Save the File
- Place the downloaded
credentials.jsonin theconfigdirectory of the project
- Place the downloaded
To use Firebase for file storage, follow these steps:
-
Go to Firebase Console
-
Create or Select a Project
- Click Add Project or select an existing one
- Follow the prompts to configure the project
-
Enable Firebase Storage
- In the left sidebar, go to Build > Storage
- Click Get Started and configure rules as needed
- Wait for the default storage bucket to be set up
-
Generate Admin SDK Credentials
- Go to Project Settings > Service Accounts
- Click Generate New Private Key
- This will download a
firebase.jsonfile containing your Firebase Admin SDK credentials
-
Save the File
- Place this
firebase.jsonin theconfigdirectory
- Place this
- Add your Gemini API key (or OpenAI API key) when prompted while running the app
Run the setup command to initialize the application and authenticate with Google Tasks:
bash python main.py --setup
- Run the setup wizard:
python main.py --setup
- List your tracked Google Task lists and tasks:
python main.py --list
- Add a new Google Task list to be tracked:
You will be prompted to enter the name of the task list.
python main.py --add
.
βββ app/ # Flutter mobile application
β βββ lib/ # Main application source code
β βββ android/ # Android specific files
β βββ ios/ # iOS specific files
β βββ pubspec.yaml # Flutter dependencies
βββ config/ # Configuration files, constants, API credentials
β βββ constants.py # Defines constants like API labels, categories, file paths
β βββ credentials.json # Google Tasks API credentials (user-provided)
β βββ firebase.json # Firebase Admin SDK credentials (user-provided)
β βββ tracker.json # Stores names of Google Task lists being tracked
β βββ ...
βββ llm/ # Large Language Model (LLM) integration
β βββ base_provider.py # Base class for LLM providers
β βββ base_response.py # Base class for LLM response schema
β βββ Gemini/ # Gemini LLM specific implementation
β β βββ provider.py
β βββ OpenAI/ # OpenAI LLM specific implementation (optional)
β βββ provider.py
βββ tasks/ # Logic for Google Tasks interaction and task processing
β βββ getTasks.py # Handles Google Tasks API calls, authentication, and task enrichment
β βββ ...
βββ views/ # CLI view components
β βββ setup_view.py # CLI views for setup process
β βββ tasks_view.py # CLI views for displaying tasks
βββ main.py # Main application entry point and CLI argument parser
βββ utils.py # Utility functions, including Firebase Firestore integration
βββ .gitignore # Specifies intentionally untracked files to ignore
βββ README.md # This comprehensive guide
βββ ...
This project includes a GitHub Actions workflow to automatically run the task categorization script on a daily schedule. To enable this, you need to configure the following secrets in your GitHub repository settings.
- Navigate to your GitHub repository.
- Go to Settings > Secrets and variables > Actions.
- Click New repository secret for each of the secrets below.
-
CREDENTIALS_JSON:- Content: The base64 encoded content of your
credentials.jsonfile. - How to get it:
- Run the following command in your terminal:
base64 -i config/credentials.json - Copy the entire output.
- In your GitHub repository, go to Settings > Secrets and variables > Actions, click New repository secret, name it
CREDENTIALS_JSON, and paste the copied output into the "Value" field.
- Run the following command in your terminal:
- Content: The base64 encoded content of your
-
FIREBASE_JSON:- Content: The base64 encoded content of your
firebase.jsonfile. - How to get it:
- Run the following command in your terminal:
base64 -i config/firebase.json - Copy the entire output.
- In your GitHub repository, create a new secret named
FIREBASE_JSONand paste the copied output into the "Value" field.
- Run the following command in your terminal:
- Content: The base64 encoded content of your
-
TOKEN_PICKLE:- Content: The base64 encoded content of your
token.picklefile. - How to get it:
- This file is generated after you run the application for the first time with the
--setupflag and authenticate with your Google account. - Once the
config/token.picklefile is created, run the following command:base64 -i config/token.pickle - Copy the entire output.
- In your GitHub repository, create a new secret named
TOKEN_PICKLEand paste the copied output into the "Value" field.
- This file is generated after you run the application for the first time with the
- Content: The base64 encoded content of your
-
GEMINI_API_KEY:- Content: Your API key for the Google Gemini.
- How to get it:
- In your GitHub repository, create a new secret named
GEMINI_API_KEY. - Paste your actual API key for Gemini into the "Value" field.
- In your GitHub repository, create a new secret named
The workflow is now configured to use the Gemini model (gemini-2.0-flash) by default. You only need to provide the API key.
Note on tracker.json: You no longer need to provide tracker.json as a secret. The workflow now automatically fetches the latest task data from Firebase at the beginning of each run and pushes the updated data back at the end. This ensures your tracked tasks are always in sync.
Once these secrets are configured, the GitHub Action will run automatically every day at midnight, keeping your task data up-to-date.
Contributions are welcome! If you have suggestions for improvements, new features, or bug fixes, please feel free to open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- Finalize on whether a android widget or html would be better
- Build the OpenAI and ollama provider