A .NET 8 MAUI habit tracker for Android and Windows. Offline-first with SQLite and MVVM (CommunityToolkit.Mvvm).
- Create habits with name, description, frequency (daily/weekly/custom days), start date, reminders, color/icon.
- Track daily completions and streaks.
- Dashboard with today’s habits, streaks, and completion rate for last 7/30 days.
- Habit detail page with completion history and edit/delete actions.
- Offline-first SQLite storage with repository pattern and async APIs.
- Export habits + completions to JSON.
HabitForge/ModelsHabitForge/ViewModelsHabitForge/ViewsHabitForge/ServicesHabitForge/Data
- Install .NET 8 SDK and MAUI workload:
dotnet workload install maui
- Restore packages:
dotnet restore
- Run on Windows:
dotnet build -t:Run -f net8.0-windows10.0.19041.0
- Run on Android (emulator or device):
dotnet build -t:Run -f net8.0-android
- SQLite via
sqlite-net-pcl. - Tables created on first run in
AppDatabase.InitializeAsync(). - Simple migration strategy: if you add a column or table, update
InitializeAsync()to create it, and add lightweight upgrade logic (e.g.,PRAGMA user_versionor a Preferences version flag) before callingCreateTableAsync.
SampleDataServiceseeds example habits and completions on first run.- Controlled with a Preferences flag (
habitforge.seeded).
IReminderServiceis wired but usesNoOpReminderService.- Android: implement with
AlarmManagerorWorkManagerto schedule notifications.
JsonExportServicewrites a JSON export to app data directory.- The dashboard exposes an Export action.
- Add/update models in
HabitForge/Models. - Extend data access in
HabitForge/Datarepositories. - Create/update view models in
HabitForge/ViewModels. - Update UI in
HabitForge/Views. - Wire new services or pages in
HabitForge/MauiProgram.csandHabitForge/AppShell.xaml.cs.
- This app targets Android and Windows. Add iOS/macOS target frameworks to
HabitForge/HabitForge.csprojif needed.