This is a submission for the GitHub Copilot CLI Challenge
What I Built
I built Smart Habit Tracker, an offline-first habit tracking web application focused on simplicity, privacy, and correctness.
The app supports both daily habits and weekly habits (e.g. “3 times per week”), allowing users to track progress in a way that matches real-life routines rather than rigid rules. It works entirely on the frontend—there is no authentication and no backend. All data is stored locally using IndexedDB, so users can start using the app immediately and keep full control of their data.
From a technical standpoint, this project centers around time-based business logic. I implemented streak calculation, weekly progress tracking, and an insight engine that surfaces patterns like success rate, best-performing days, and consistency over time. These core behaviors are implemented as pure functions and covered by unit tests to ensure correctness across edge cases such as missed days, duplicate check-ins, and week boundaries.
For me, this project represents how I like to build software: lightweight, user-respecting, and reliable. I wanted to show that a frontend-only application can still demonstrate strong system design, thoughtful data modeling, and real product value without relying on backend complexity.
Demo
- Live demo: smart-habit-tracker-two
- Source code: github.com/nhatduong-agilityio/smart-habit-tracker
The demo shows:
- Creating daily and weekly habits
- Checking in and tracking streaks
- Weekly progress calculation
- Analytics and habit insights
- Offline usage with locally persisted data
My Experience with GitHub Copilot CLI
GitHub Copilot CLI acted as a pair programmer throughout this project.
Instead of asking it to generate the entire application at once, I used Copilot CLI in small, focused steps—implementing pure functions, refining business logic, and generating unit tests. This worked especially well for complex areas like streak calculation, weekly habit logic, and data aggregation for insights.
By clearly defining function signatures and writing precise comments, I was able to guide Copilot toward high-quality, production-ready code. Copilot also helped accelerate repetitive tasks such as scaffolding components, wiring state management, and writing test cases, allowing me to focus more on design decisions and edge cases.
Overall, Copilot CLI made the development process faster and more enjoyable while still keeping me in full control of architecture and correctness. It felt less like automation and more like collaborating with a thoughtful coding partner directly in the terminal.
Top comments (1)
Prompts I Used & Results
Prompt: “Implement loadHabits and addHabit using Dexie db”
Result: Zustand store was connected to IndexedDB using Dexie, enabling persistent habit creation and loading without a backend.
Prompt: “Build Today screen showing today's habits with check-in button”
Result: A dedicated Today view displaying all habits with a one-click check-in flow and real-time UI updates.
Prompt: “Create HabitItem component with check-in toggle”
Result: An accessible checkbox-based toggle replaced buttons, improving UX, keyboard navigation, and semantic HTML.
Prompt: “Create HabitList component that reads habits from Zustand store”
Result: A reusable list component that cleanly renders habits across multiple screens and handles empty states.
Prompt: “Implement calculateDailyStreak based on the comment rules”
Result: A pure streak calculation function that correctly handles today-only streaks, deduplication, and missed days.
Prompt: “Add more edge case tests: missed day, today not checked, duplicate dates”
Result: Additional Vitest cases exposed a logic bug, leading to a corrected and fully tested streak algorithm.
Prompt: “Build a calendar component showing check-in history per habit”
Result: A monthly calendar view with habit switching, check-in highlights, and completion statistics.
Prompt: “Build a GitHub-style heatmap component for habit consistency”
Result: A 52-week contribution-style heatmap with color intensity, hover tooltips, and consistency metrics.
Prompt: “Create analytics view showing weekly success rate using Recharts”
Result: An analytics dashboard with line and bar charts, weekly success rates, and a detailed breakdown table.
Prompt: “Implement settings page with export and reset local data”
Result: A settings screen allowing users to export all local data as JSON and safely reset IndexedDB.
Prompt: “Add empty state UI for no habits yet”
Result: A reusable EmptyState component applied consistently across all views for better UX.
Prompt: “Update App to build the app with navigation”
Result: A complete app shell with header, bottom navigation, modal habit creation, and screen routing.