A Progressive Web App for tracking daily habits with offline support, built with Vue 3 and TypeScript.
- Dashboard: View all habits with 5-day completion grid
- Detail Page: Monthly calendar, 4-month heatmap, yearly chart, and notes
- Offline-first: All data stored locally in localStorage
- PWA: Installable on mobile and desktop
- Dark Theme: Modern dark UI design
- Export/Import: Backup and restore data as JSON
- Vue 3 (Composition API)
- TypeScript
- Vite
- Pinia (State Management)
- Vue Router
- vite-plugin-pwa
- Node.js 18+
- npm or yarn
# Clone the repository
git clone <repo-url>
cd hobits
# Install dependencies
npm install
# Start development server
npm run devnpm run build
npm run preview # Preview production buildsrc/
├── components/
│ ├── dashboard/ # Dashboard components
│ │ ├── HabitTable.vue
│ │ ├── AddHabitModal.vue
│ │ └── DropdownMenu.vue
│ ├── detail/ # Detail page components
│ │ ├── MonthCalendar.vue
│ │ ├── HeatmapThreeMonths.vue
│ │ ├── YearChart.vue
│ │ ├── NotesSection.vue
│ │ └── EditHabitModal.vue
│ ├── ToastContainer.vue
│ └── ConfirmDialog.vue
├── composables/
│ └── usePWAInstall.ts # PWA install prompt handling
├── router/
│ └── index.ts
├── stores/
│ ├── habitStore.ts # Habit state management
│ └── toastStore.ts # Toast notifications
├── utils/
│ ├── dateUtils.ts # Date formatting helpers
│ ├── storageUtils.ts # localStorage operations
│ └── types.ts # TypeScript interfaces
├── views/
│ ├── HabitList.vue # Dashboard view
│ └── HabitDetail.vue # Detail view
├── App.vue
├── main.ts
└── style.css # Global styles & CSS variables
- Open the app in browser
- Click the install icon in the address bar, or
- Open menu (hamburger icon) and click "Install App"
- Open the app in Chrome
- Tap menu → "Add to Home screen" or "Install app"
- Open the app in Safari
- Tap Share icon → "Add to Home Screen"
All habit data is stored in browser's localStorage under the key habit-tracker-data. Data structure:
{
habits: [
{
id: string,
name: string,
color: string,
completions: { "YYYY-MM-DD": boolean },
notes: string,
createdAt: string,
updatedAt: string
}
],
settings: {
theme: "dark",
firstDayOfWeek: 1
}
}| Command | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
MIT