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.
โจ Features
Section titled โโจ Featuresโ๐ KPI Management
Section titled โ๐ KPI Managementโ- 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
๐ Calendar View
Section titled โ๐ Calendar Viewโ- Weekly Overview: See your KPIs organized by day
- Heatmap Visualization: Track activity patterns over time
- Quick Navigation: Jump to any date easily
๐ฅ Streaks & Motivation
Section titled โ๐ฅ Streaks & Motivationโ- Streak Tracking: Monitor consecutive completion days
- Visual Streak Display: Fire icons and progress indicators
- Daily Motivational Quotes: Inspiration to keep you going
โฑ๏ธ Focus Timer (Pomodoro)
Section titled โโฑ๏ธ Focus Timer (Pomodoro)โ- 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
๐ Statistics & Analytics
Section titled โ๐ Statistics & Analyticsโ- 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
๐ Achievements & Gamification
Section titled โ๐ Achievements & Gamificationโ- XP System: Earn experience points for completions
- Levels: Progress through levels as you achieve more
- Achievement Badges: Unlock achievements for milestones
๐จ Customization
Section titled โ๐จ Customizationโ- Dark/Light Mode: System-aware theme switching
- Week Start Day: Choose Sunday or Monday
- Multi-language: English ๐ฌ๐ง, German ๐ฉ๐ช, Italian ๐ฎ๐น
๐ค Sharing
Section titled โ๐ค Sharingโ- Share Progress: Generate beautiful shareable images
- Daily/Weekly Summaries: Visual cards of your achievements
๐ฑ Progressive Web App (PWA)
Section titled โ๐ฑ Progressive Web App (PWA)โ- Install on Device: Works like a native app
- Offline Support: Full functionality without internet
- Local Storage: All data stored securely on your device
๐ ๏ธ Tech Stack
Section titled โ๐ ๏ธ Tech Stackโ| Technology | Purpose |
|---|---|
| React 18 | UI Framework |
| TypeScript | Type Safety |
| Vite 7 | Build Tool |
| Tailwind CSS 4 | Styling |
| Shadcn/UI | UI Components |
| Zustand | State Management |
| Dexie (IndexedDB) | Local Database |
| Recharts | Charts & Visualizations |
| date-fns | Date Utilities |
| Lucide React | Icons |
๐ Getting Started
Section titled โ๐ Getting Startedโ# Install dependenciesnpm install
# Start development servernpm run dev
# Build for productionnpm run build
# Preview production buildnpm run previewProduction Build
Section titled โProduction Buildโ# Build and run with Docker Composedocker compose up -d
# Or build manuallydocker build -t app-docs .docker run -d -p 8080:80 --name app-docs app-docsThe app will be available at http://localhost:8080
Development with Docker
Section titled โDevelopment with DockerโFor development with hot reload, you can mount the source code:
docker run -d -p 4321:4321 -v $(pwd):/app --name app-docs-dev node:18-alpine sh -c "cd /app && npm install && npm run dev -- --host 0.0.0.0"Useful Docker Commands
Section titled โUseful Docker Commandsโ# Stop the containerdocker compose down
# Rebuild after changesdocker compose up -d --build
# View logsdocker compose logs -f app-docs
# Check container healthdocker inspect --format='{{.State.Health.Status}}' app-docs๐ Project Structure
Section titled โ๐ Project Structureโ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๐๏ธ Architecture
Section titled โ๐๏ธ ArchitectureโOverview
Section titled โOverviewโ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
Data Flow
Section titled โData Flowโflowchart LR
A[User Action] --> B[Component]
B --> C[Zustand Action]
C --> D[Dexie DB]
D --> E[State Update]
E --> F[Re-render]
Core Components
Section titled โCore Componentsโ| Component | Responsibility |
|---|---|
useAppStore | Central state management with Zustand. Handles all CRUD operations and syncs with IndexedDB |
db.ts | Dexie database configuration with tables for KPIs, Entries, and Settings |
Layout.tsx | Main app shell with navigation and theme provider |
KPICard.tsx | Reusable card component for displaying and interacting with KPIs |
Data Models
Section titled โData Modelsโ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 configKey Design Decisions
Section titled โKey Design Decisionsโ-
Offline-First: All data stored locally in IndexedDB via Dexie for instant access and offline capability
-
Single Store Pattern: One Zustand store manages all application state, simplifying data flow and debugging
-
Component Composition: Small, focused components composed together (e.g.,
MetricInputrenders different inputs based on metric type) -
Hook-Based i18n: Custom
useTranslationhook reads from centralized translations object, no external i18n library needed -
PWA Architecture: Service worker pre-caches assets for offline use, manifest enables โAdd to Home Screenโ