Snap the habit.
Built for the Apple Swift Student Challenge 2026.
Snabit is a gamified habit tracker that learns from your personal completion patterns to predict the best time to complete each habit, calculate streak risk in real time, and send smart notifications timed to when you're historically most likely to act.
- 🎯 Daily & Weekly Habits — Create habits with custom emoji, color, and goals
- 🔥 Streak Tracking — Current and best streak with automatic calculation
- 🎮 Gamification — Earn XP per completion with 7-day (+50 XP) and 30-day (+100 XP) streak bonuses
- 🏆 Achievements — 6 unlockable milestone badges
- 📊 Visual Analytics — GitHub-style yearly heatmap and weekly bar chart via Swift Charts
- 🤖 ML Insights — On-device ML predictions for completion probability, best hour, streak risk, and weekly forecast
- 🔔 Smart Notifications — Reminders timed to your personal completion history
- 📝 Habit Notes — Journal entries with sentiment tracking per habit
- ♿ Accessibility — VoiceOver support on core interactions and Dynamic Type via SwiftUI standard components
- 🛡️ Local-First — Everything runs on device, no account required, no data leaves your phone
Snabit uses interpretable on-device statistical inference — no .mlmodel file, no network calls, no cold start problem:
- Frequency Histogram — predicts your best completion hour from past patterns
- Bayesian Inference with Laplace Smoothing — calculates daily completion probability per habit
- Multi-Factor Risk Scoring — combines probability and time of day into a 0–3 streak risk level
- Expected Value Calculation — forecasts weekly completions based on remaining days
| Technology | Usage |
|---|---|
| SwiftUI | All UI |
| SwiftData | On-device persistence |
| Swift Charts | Heatmap and bar charts |
| UserNotifications | Smart ML-timed reminders |
| Combine | ObservableObject / @Published |
Snabit.swiftpm
├── SnabitApp.swift
├── Models/
│ ├── Habit.swift
│ └── Achievement.swift
├── Managers/
│ ├── GamificationManager.swift
│ ├── MLPredictionManager.swift
│ └── SmartNotificationManager.swift
└── Views/
├── Components/
│ ├── HabitCardView.swift
│ ├── HeatMapView.swift
│ ├── ProgressChartView.swift
│ └── ConfettiView.swift
├── HomeView.swift
├── StatsView.swift
├── AchievementsView.swift
├── ProfileView.swift
├── AddHabitView.swift
├── ManageHabitsView.swift
├── OnboardingView.swift
└── ContentView.swift
- Clone the repo
- Open
Snabit.swiftpmin Xcode 15+ or Swift Playgrounds 4.6+ - Run on an iOS 17+ simulator or device
- Follow the onboarding flow to create your first habit
- iOS 17.0+
- Xcode 15+ or Swift Playgrounds 4.6+
Built with ❤️ by Parth