Skip to content

About

Build habits that stick. A Python desktop app to track daily habits with streaks and a GitHub-style heatmap.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🔥 Consistify

Build habits that stick.

A Python desktop habit tracker with streaks, a GitHub-style heatmap, badges and secure user accounts.


Python 3 Tkinter SQLite
Platform: Windows | macOS Dependencies: 0 (standard library only) Made with love at SRM


Features · Getting Started · How It Works · Security · Project Structure · Team


🌟 At a Glance

✅

Daily tracking
Tick habits, grow streaks, celebrate with confetti

📊

Visual insights
90-day heatmap, donut, weekly chart and consistency ring

🏆

Milestone badges
Six streak badges, from 3 days to 100 days

🔐

Secure accounts
Salted PBKDF2 password hashing, data stays on your device

⚡

Polished feel
Animated splash, landing page and smooth scrolling

📦

Zero installs
Pure Python standard library, nothing to pip install

✨ Features

🏠 Start-up, landing & accounts
  • Splash screen: a mini heatmap fills in as a diagonal wave, the logo fades in and a loading bar runs. Click or press any key to skip.
  • Custom app icon: the orange 2×2 logo in the title bar and taskbar, drawn in code (no image file).
  • Animated landing page: phrases orbit the title, a typewriter cycles example habits and preview cards float.
  • "Why habits matter" section with numbers that count up when it scrolls into view.
  • Split-screen Log in / Sign up with a 👁 show-password toggle.
  • Live password strength meter: 4 bars and a label (Too short → Weak → Okay → Good → Strong) that update as you type.
✅ Daily tracking
  • Today page with a greeting, the date and 4 stat cards: Done today, Best streak, This week and Badges.
  • Add a habit in one click (duplicates are refused).
  • Round checkboxes, a 🔥 streak pill on every habit and a hover-only 🗑 delete with confirmation.
  • An animated Today's progress bar.
  • 🎉 Confetti when every habit is done, or when a new badge unlocks.
  • Side panel: a mini 30-day heatmap, your next badge and a quote of the day.
📊 Progress & insights
  • Summary tiles: total check-ins, active days, average per day and longest streak.
  • 90-day heatmap, GitHub-style. Today is outlined. Click a day to see what you did.
  • Habit share donut for the last 30 days. Hover a slice for its numbers.
  • This week bar chart with a dashed average line.
  • Consistency ring: % of the last 30 days with at least one habit done.
  • Stats table: current streak, best streak and 30-day % per habit. The top habit gets a 👑.
🏆 Badges, ⚙️ settings & 📤 export
  • 6 badges for streaks of 3 🌱 · 7 🔥 · 14 ⚡ · 30 🏅 · 50 💎 · 100 👑 days, each showing the habit that earned it and the date.
  • A Next up card shows how many days are left to the next badge. Click an unlocked badge to replay its celebration.
  • Settings: account info, change password (with the strength meter) and a danger zone to delete the account.
  • Export CSV: habit, current streak, best streak, completion % (30 days) and total days done.

🚀 Getting Started

Requirements

  • Python 3.10 or newer
  • Nothing else. No pip install needed.

Install & run

git clone https://github.com/KrishivSharma45/Consistify.git
cd Consistify
🪟 Windows 🍎 macOS
py main.py python3 main.py

habits.db is created automatically on the first run.

Tip

Try the demo account. Run py seed_demo.py (or python3 seed_demo.py on macOS), then log in with demo / demo123. You get 8 habits, 90 days of history, a 35-day streak and 4 unlocked badges. Run it again any time to reset.

Note

macOS: if you see No module named tkinter or a blank window, install Python from python.org. It includes a working Tkinter.


🧠 How It Works

App flow

flowchart LR
    S[⚡ Splash] -->|about 2 s, or click| A[🏠 Welcome]
    A --> B[🔑 Log in / Sign up]
    B -->|correct login| C[📋 Dashboard]
    C --> D[✅ Today]
    C --> E[📊 Progress]
    C --> F[🏆 Badges]
    C --> G[⚙️ Settings]
    D & E & F & G --> H[🚪 Logout]
    H --> A
    G -->|delete account| A
Loading

🔥 Streak logic

  1. Start counting from today.
  2. If today isn't ticked yet, start from yesterday, so a streak doesn't "break" in the morning.
  3. Count back one day at a time until a day is missing.
Mon Tue Wed Thu Fri (today) Streak
❌ ✅ ✅ ✅ not yet 3
❌ ✅ ✅ ✅ ✅ 4

A badge unlocks the first time any habit's current streak reaches its milestone, and it stays unlocked.

🟧 Heatmap colors

Each square is one day, colored by how many habits were done:

Habits done 0 1 2 3 4+
Shade empty ▁ darkest ▃ ▅ ▇ brightest orange

All five shades live in theme.HEATMAP, so one change recolors every heatmap in the app.

🗄️ Database schema

Four tables in one local SQLite file (habits.db):

erDiagram
    users ||--o{ habits : "owns"
    habits ||--o{ logs : "is done on"
    users ||--o{ badges : "unlocks"

    users {
        INTEGER id PK
        TEXT username UK
        TEXT password_hash
        TEXT salt
    }
    habits {
        INTEGER id PK
        INTEGER user_id "the owner (users.id)"
        TEXT name "UNIQUE per user"
    }
    logs {
        INTEGER habit_id "the habit (habits.id)"
        TEXT date "YYYY-MM-DD, UNIQUE per habit"
    }
    badges {
        INTEGER user_id "the owner (users.id)"
        INTEGER milestone "3, 7, 14, 30, 50 or 100, UNIQUE per user"
        TEXT habit_name
        TEXT unlocked_date
    }
Loading
  • One row in logs = one habit done on one day. UNIQUE stops a day from being counted twice.
  • Deleting a habit deletes its logs. Deleting an account deletes everything it owns.

🔐 Security

Passwords are never stored, only a salted hash. All data stays on your own device.

Protection How
🧂 Salted password hashing PBKDF2-HMAC-SHA256, 100,000 iterations, a unique random 16-byte salt per user
⏱️ Constant-time comparison hmac.compare_digest, so timing can't leak the hash
💉 SQL Injection protection Every query uses ? placeholders (parameterized queries)
🕵️ No username hints at login Wrong username and wrong password show the same message
🔑 Re-authentication Changing the password requires the current one
🗑️ Protected deletion Deleting an account needs the password and a confirmation
💪 Strength hint A live meter scores length (8+), a number, a capital letter and a symbol. The minimum is 6 characters
📖 What do these terms mean?
  • PBKDF2-HMAC-SHA256: Password-Based Key Derivation Function 2 using Hash-based Message Authentication Code with Secure Hash Algorithm 256-bit. It hashes 100,000 times on purpose, so every password guess is slow for an attacker.
  • Salt: random bytes mixed into each password before hashing. Two users with the same password get different hashes, and precomputed "rainbow tables" don't work.
  • SQL Injection: an attack where typed text gets run as Structured Query Language code. Placeholders make sure typed text is always treated as data.
  • Constant-time comparison: a check that doesn't stop early at the first wrong character.
📝 Known limits
  • Sign-up says "Username already taken", which is the usual trade-off for a friendly sign-up form.
  • Login skips hashing for usernames that don't exist, so response time could, in theory, hint at which usernames exist.
  • habits.db isn't encrypted. Habit names and dates are readable by anyone with the file (passwords are not).

📁 Project Structure

Consistify/
├── main.py          # Entry point: window, app icon, page switching, sidebar and tabs
├── splash.py        # Intro animation: heatmap wave, logo fade-in, loading bar
├── welcome.py       # Animated landing page
├── auth.py          # Log in / Sign up page and the password strength meter
├── gui.py           # Today page: habits, checkboxes, progress, side panel, CSV export
├── heatmap.py       # Progress page: heatmap, donut, weekly chart, ring, stats table
├── badges.py        # Badges page: trophy shelf, "Next up" card, milestone cards
├── settings.py      # Settings page: account info, change password, delete account
├── database.py      # All SQLite code: accounts, hashing, habits, streaks, badges, CSV
├── ui.py            # Shared helpers: cards, buttons, rings, confetti, color blend, password score
├── theme.py         # Every color and the font in one place
├── seed_demo.py     # Creates the demo account (demo / demo123)
└── README.md

💡 Each page file also runs on its own for testing, e.g. py heatmap.py.


🛠️ Tech Stack

Technology Used for
🐍 Python 3 The whole app
🖼️ Tkinter Windows, canvases, charts, animations and dialogs
🗄️ SQLite (sqlite3) Local database in a single file
🔐 hashlib · hmac · os Password hashing, safe comparison, random salts
📅 datetime Dates, streaks and the last 7 / 30 / 90 days
📄 csv Exporting the progress report

100% standard library: zero third-party packages.


👥 Team

Member Contribution
Krishiv Sharma Database, accounts & security, dashboard, integration
Keerthy Sarayuu Heatmap & progress visualizations
Shaan Vyas Main GUI layout

🎓 Built as a college project for the App Development course at SRM Institute of Science and Technology, Kattankulathur.


🗺️ Roadmap

  • Daily reminder notifications
  • Light / dark theme toggle
  • Habit categories (health, study, coding…)
  • Edit a habit's name


If Consistify helped you stay consistent, leave a ⭐

Made with 🧡 and Python

About

Build habits that stick. A Python desktop app to track daily habits with streaks and a GitHub-style heatmap.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages