Skip to content

Personal KPI Tracker

A modern, feature-rich personal KPI (Key Performance Indicator) tracking application for managing habits, goals, and tasks. Built with React, TypeScript, and a beautiful mobile-first UI.

Personal KPI Tracker TypeScript Vite PWA

  • Multiple Metric Types: Checkbox, Counter, Timer, Number, Percentage, Currency, and Rating
  • Flexible Recurrence: Daily, Weekly, Monthly, Custom intervals, or One-time tasks
  • Categories: Organize as Habits, Goals, or Tasks
  • Priority Levels: Low, Medium, High, Urgent
  • Tags & Colors: Customize with icons, colors, and tags
  • Notes per Entry: Document thoughts and progress for each day
  • Weekly Overview: See your KPIs organized by day
  • Heatmap Visualization: Track activity patterns over time
  • Quick Navigation: Jump to any date easily
  • Streak Tracking: Monitor consecutive completion days
  • Visual Streak Display: Fire icons and progress indicators
  • Daily Motivational Quotes: Inspiration to keep you going
  • Customizable Sessions: Work, short break, and long break durations
  • Session Tracking: Count completed focus sessions
  • Visual Progress: Circular timer with progress ring
  • Auto-break System: Automatic transitions between sessions
  • Completion Rates: Daily, weekly, and monthly statistics
  • Performance Charts: Visual progress over time with Recharts
  • Category Breakdown: See performance by habit/goal/task
  • Historical Data: Track your journey over any time period
  • XP System: Earn experience points for completions
  • Levels: Progress through levels as you achieve more
  • Achievement Badges: Unlock achievements for milestones
  • Dark/Light Mode: System-aware theme switching
  • Week Start Day: Choose Sunday or Monday
  • Multi-language: English ๐Ÿ‡ฌ๐Ÿ‡ง, German ๐Ÿ‡ฉ๐Ÿ‡ช, Italian ๐Ÿ‡ฎ๐Ÿ‡น
  • Share Progress: Generate beautiful shareable images
  • Daily/Weekly Summaries: Visual cards of your achievements
  • Install on Device: Works like a native app
  • Offline Support: Full functionality without internet
  • Local Storage: All data stored securely on your device
TechnologyPurpose
React 18UI Framework
TypeScriptType Safety
Vite 7Build Tool
Tailwind CSS 4Styling
Shadcn/UIUI Components
ZustandState Management
Dexie (IndexedDB)Local Database
RechartsCharts & Visualizations
date-fnsDate Utilities
Lucide ReactIcons
Terminal window
# Install dependencies
npm install
# Start development server
npm run dev
# Build for production
npm run build
# Preview production build
npm run preview
src/
โ”œโ”€โ”€ components/ # Reusable UI components
โ”‚ โ””โ”€โ”€ ui/ # Shadcn UI components
โ”œโ”€โ”€ lib/ # Utilities, i18n, database
โ”œโ”€โ”€ pages/ # Main view components
โ”œโ”€โ”€ store/ # Zustand state management
โ””โ”€โ”€ types/ # TypeScript type definitions
flowchart TD
    A[Dashboard] --> B[Zustand Store]
    C[Calendar] --> B
    D[Streaks] --> B
    E[Focus] --> B
    B --> F[Dexie IndexedDB]
    
    subgraph "UI Layer"
        A
        C
        D
        E
    end
    
    subgraph "State Layer"
        B
    end
    
    subgraph "Data Layer"
        F
    end
flowchart LR
    A[User Action] --> B[Component]
    B --> C[Zustand Action]
    C --> D[Dexie DB]
    D --> E[State Update]
    E --> F[Re-render]
ComponentResponsibility
useAppStoreCentral state management with Zustand. Handles all CRUD operations and syncs with IndexedDB
db.tsDexie database configuration with tables for KPIs, Entries, and Settings
Layout.tsxMain app shell with navigation and theme provider
KPICard.tsxReusable card component for displaying and interacting with KPIs
KPI
โ”œโ”€โ”€ id: string
โ”œโ”€โ”€ name: string
โ”œโ”€โ”€ category: 'habit' | 'goal' | 'task'
โ”œโ”€โ”€ metric: MetricConfig (type, target, unit)
โ”œโ”€โ”€ recurrence: RecurrenceConfig (pattern, days)
โ”œโ”€โ”€ priority: 'low' | 'medium' | 'high' | 'urgent'
โ””โ”€โ”€ startDate, tags, icon, color, archived
KPIEntry
โ”œโ”€โ”€ id: string
โ”œโ”€โ”€ kpiId: string (โ†’ KPI)
โ”œโ”€โ”€ date: string (YYYY-MM-DD)
โ”œโ”€โ”€ value: number | boolean | string
โ”œโ”€โ”€ notes?: string
โ””โ”€โ”€ timerSessions?: TimerSession[]
AppSettings
โ”œโ”€โ”€ theme: 'light' | 'dark' | 'system'
โ”œโ”€โ”€ language: 'en' | 'de' | 'it'
โ”œโ”€โ”€ startOfWeek: 0-6 (day of week)
โ””โ”€โ”€ notifications, focusTimer config
  1. Offline-First: All data stored locally in IndexedDB via Dexie for instant access and offline capability

  2. Single Store Pattern: One Zustand store manages all application state, simplifying data flow and debugging

  3. Component Composition: Small, focused components composed together (e.g., MetricInput renders different inputs based on metric type)

  4. Hook-Based i18n: Custom useTranslation hook reads from centralized translations object, no external i18n library needed

  5. PWA Architecture: Service worker pre-caches assets for offline use, manifest enables โ€œAdd to Home Screenโ€