{"id":29881190,"url":"https://github.com/banghuazhao/habit-diary","last_synced_at":"2026-05-04T22:32:21.452Z","repository":{"id":307087572,"uuid":"1028001225","full_name":"banghuazhao/habit-diary","owner":"banghuazhao","description":"A comprehensive iOS habit tracking app with gamification, 35+ habit templates, 12-tier rating system (F-SSS), achievements, and smart reminders. Built with SwiftUI and GRDB for seamless habit formation and personal growth.","archived":false,"fork":false,"pushed_at":"2025-07-29T11:04:25.000Z","size":3290,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-29T11:54:25.199Z","etag":null,"topics":["achievements","consistency","gamification","grdb","habit-tracking","habits","health","ios","lifestyle","mobile","motivation","notifications","personal-development","productivity","rating-system","self-improvement","sqlite","swift","swiftui","wellness"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/banghuazhao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-28T21:44:54.000Z","updated_at":"2025-07-29T11:04:28.000Z","dependencies_parsed_at":"2025-07-29T12:10:02.544Z","dependency_job_id":null,"html_url":"https://github.com/banghuazhao/habit-diary","commit_stats":null,"previous_names":["banghuazhao/habit-diary"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/banghuazhao/habit-diary","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banghuazhao%2Fhabit-diary","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banghuazhao%2Fhabit-diary/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banghuazhao%2Fhabit-diary/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banghuazhao%2Fhabit-diary/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/banghuazhao","download_url":"https://codeload.github.com/banghuazhao/habit-diary/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/banghuazhao%2Fhabit-diary/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268025668,"owners_count":24183228,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["achievements","consistency","gamification","grdb","habit-tracking","habits","health","ios","lifestyle","mobile","motivation","notifications","personal-development","productivity","rating-system","self-improvement","sqlite","swift","swiftui","wellness"],"created_at":"2025-07-31T11:01:07.683Z","updated_at":"2026-05-04T22:32:21.445Z","avatar_url":"https://github.com/banghuazhao.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HabitDiary 📔\n\n[![Swift](https://img.shields.io/badge/Swift-5.9-orange.svg)](https://swift.org)\n[![iOS](https://img.shields.io/badge/iOS-17.0+-blue.svg)](https://developer.apple.com/ios/)\n[![SwiftUI](https://img.shields.io/badge/SwiftUI-5.0-green.svg)](https://developer.apple.com/xcode/swiftui/)\n[![License](https://img.shields.io/badge/License-CC%20BY--NC%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc/4.0/)\n\nA comprehensive iOS habit tracking app built with SwiftUI and GRDB, designed to help users build and maintain habits through gamification, achievements, and a sophisticated rating system. Transform your life one habit at a time with intelligent tracking, personalized reminders, and motivational features.\n\n## App Store\n\nHabitDiary is now available on the App Store: [Habit Diary: Build Good Habits](https://apps.apple.com/us/app/habit-diary-build-good-habits/id1550484411).\n\n## 📱 Screenshots\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"screenshots/HabitDiary.png\" alt=\"HabitDiary App Screenshots\" width=\"900\"/\u003e\n\u003c/div\u003e\n\n*Experience a clean, modern interface with intuitive habit tracking, comprehensive analytics, and engaging gamification elements designed to motivate long-term habit formation.*\n\n## ✨ Features\n\n### 🎯 Core Functionality\n- **Comprehensive Habit Tracking**: Create, edit, and track habits with flexible frequency patterns\n- **4 Main Sections**: Today (daily tracking), Habits (management), Rating (progress), Me (profile/settings)\n- **Flexible Scheduling**: Fixed days in week/month, N days per period, and custom patterns\n- **Visual Progress Tracking**: Calendar views, streak counters, and completion analytics\n\n### 🏆 Gamification \u0026 Achievements\n- **15+ Achievement Types**: Streak milestones, consistency rewards, perfect periods, and milestone celebrations\n- **Real-time Notifications**: Achievement popup celebrations with visual animations\n- **Progressive Unlocking**: Earn achievements based on streaks, total check-ins, and consistency patterns\n- **Social Sharing**: Share your achievements and progress with friends\n\n### 📊 12-Tier Rating System\n- **Progression Levels**: Advance from Beginner (F) to Legend (SSS) based on overall performance\n- **Multi-Dimensional Scoring**: \n  - Active habits (max 300 points)\n  - Achievements unlocked (max ~150+ points)\n  - Total check-ins (max 200 points)\n  - Longest streak (max 250 points)\n- **Detailed Analytics**: Score breakdowns with explanations and improvement suggestions\n- **Visual Progress**: Charts and progress bars showing rating advancement\n\n### 🗂️ Comprehensive Habit Library\n- **35+ Pre-built Habits** across 8 major categories:\n  - **Health \u0026 Fitness**: Walking, workouts, yoga, swimming, running, stretching\n  - **Nutrition \u0026 Hydration**: Water intake, fruits, vegetables, healthy cooking\n  - **Sleep \u0026 Rest**: Sleep schedule, screen limits, bedtime routines\n  - **Mental Health \u0026 Mindfulness**: Meditation, gratitude, breathing exercises\n  - **Learning \u0026 Growth**: Reading, language learning, skill practice\n  - **Productivity \u0026 Organization**: Planning, workspace management, reviews\n  - **Social \u0026 Relationships**: Family calls, social activities, kindness acts\n  - **Self-Care \u0026 Environment**: Skincare, decluttering, outdoor time\n  - **Creative \u0026 Hobbies**: Creative activities, music, photography\n\n### 🔔 Smart Reminder System\n- **Personalized Notifications**: Custom reminder times and messages for each habit\n- **Habit-Specific Alerts**: Link reminders directly to individual habits\n- **Non-intrusive Design**: Thoughtful notification timing to avoid overwhelm\n- **Easy Management**: Simple setup and modification of notification preferences\n\n### 🎨 User Experience\n- **Modern SwiftUI Interface**: Clean, intuitive design following iOS design guidelines\n- **Dark Mode Support**: Automatic adaptation to system appearance preferences\n- **Custom Theming**: Multiple color themes and personalization options\n- **Haptic Feedback \u0026 Sound Effects**: Enhanced interaction feedback\n- **Smooth Animations**: Polished transitions and micro-interactions\n\n### 💾 Data Management\n- **GRDB Database**: Robust local data storage with SQLite backend\n- **Calendar Integration**: Monthly and yearly habit tracking visualizations\n- **Streak Calculation**: Intelligent streak tracking with flexible rules\n- **Data Persistence**: Reliable local storage with efficient querying\n\n### 🌍 Localization \u0026 Accessibility\n- **Multi-language Support**: English and Simplified Chinese localization\n- **Accessibility Features**: VoiceOver support and accessibility labels\n- **Responsive Design**: Optimized for various iOS device sizes\n\n### 🔧 Advanced Features\n- **Habit Archiving**: Archive habits without losing historical data\n- **Icon Customization**: Extensive emoji icon library with color coding\n- **Filtering \u0026 Sorting**: Multiple options to organize habit views\n- **Onboarding Experience**: 4-step guided setup with feature introduction\n- **Premium Features**: In-app purchases with ad-free experience\n\n## 🏗️ Architecture\n\n### Tech Stack\n- **SwiftUI 5.0**: Modern declarative UI framework\n- **GRDB**: SQLite database with Swift integration and reactive queries\n- **Observation Framework**: Reactive data binding and state management\n- **SwiftUINavigation**: Type-safe navigation handling\n- **Google Mobile Ads**: Monetization with respectful ad placement\n- **UserNotifications**: Local notification scheduling and management\n\n### Project Structure\n```\nHabitDiary/\n├── App/\n│   └── HabitDiaryApp.swift              # App entry point with dependency setup\n├── Components/\n│   ├── Common/                          # Reusable UI components\n│   │   ├── HabitCardView.swift\n│   │   ├── HabitItemView.swift\n│   │   ├── EmptyStateView.swift\n│   │   └── StyleGuide.swift\n│   ├── Today/                           # Daily habit tracking interface\n│   │   ├── TodayView.swift\n│   │   └── TodayViewModel.swift\n│   ├── Habits/                          # Habit management and gallery\n│   │   ├── HabitsList.swift\n│   │   ├── HabitForm.swift\n│   │   ├── HabitDetail.swift\n│   │   └── HabitsGallery.swift\n│   ├── Rating/                          # Progress scoring and analytics\n│   │   ├── RatingView.swift\n│   │   ├── RatingViewModel.swift\n│   │   └── ScoreDetailView.swift\n│   ├── Me/                              # User profile and settings\n│   │   ├── MeFeature.swift\n│   │   ├── SettingView.swift\n│   │   ├── UserStatsView.swift\n│   │   └── ThemeColorView.swift\n│   ├── Achievements/                    # Gamification system\n│   │   ├── AchievementsView.swift\n│   │   └── AchievementPopupView.swift\n│   ├── Reminders/                       # Notification management\n│   │   ├── RemindersView.swift\n│   │   ├── ReminderForm.swift\n│   │   └── ReminderRow.swift\n│   └── Onboarding/                      # User introduction flow\n│       └── OnboardingView.swift\n├── Model/                               # Core data models\n│   ├── Habit.swift                      # Main habit entity with frequency patterns\n│   ├── CheckIn.swift                    # Habit completion tracking\n│   ├── Achievement.swift                # Gamification achievements\n│   ├── LongevityRating.swift           # 12-tier rating system\n│   ├── Reminder.swift                   # Notification scheduling\n│   └── TodayHabit.swift                # Daily habit view model\n├── Service/                             # Business logic and data services\n│   ├── HabitsDataStore.swift           # Pre-built habit templates\n│   ├── AchievementService.swift        # Achievement logic and notifications\n│   ├── NotificationService.swift       # Reminder scheduling and management\n│   ├── RatingService.swift             # Score calculation and rating logic\n│   └── PurchaseManager.swift           # In-app purchase handling\n├── Utilities/                           # Helper functions and extensions\n│   ├── Constants.swift\n│   ├── Schema.swift                     # Database schema and migrations\n│   ├── Extension/\n│   │   ├── Color+Extensions.swift\n│   │   └── Date+Extension.swift\n│   └── SoundPlayer.swift               # Audio feedback system\n└── Modules/\n    └── MoreApps/                        # Developer's other applications showcase\n```\n\n## 🚀 Getting Started\n\n### Prerequisites\n- Xcode 15.0 or later\n- iOS 17.0+ deployment target\n- macOS 14.0+ (for development)\n- Swift 5.9+\n\n### Installation\n\n1. **Clone the repository**\n   ```bash\n   git clone https://github.com/banghuazhao/habit-diary.git\n   cd habit-diary\n   ```\n\n2. **Open in Xcode**\n   ```bash\n   open HabitDiary.xcodeproj\n   ```\n\n3. **Configure Dependencies**\n   The project uses Swift Package Manager for dependencies:\n   - GRDB for database management\n   - Google Mobile Ads for monetization\n   - Additional utility packages\n\n4. **Build and Run**\n   - Select your target device or simulator\n   - Press `Cmd + R` to build and run the app\n\n### Development Setup\n\n#### Database Configuration\nThe app uses GRDB for local data storage. The database is automatically initialized with the following tables:\n- `habits` - Core habit definitions with frequency patterns\n- `checkIns` - Daily completion tracking with timestamps\n- `reminders` - Notification scheduling and management\n- `achievements` - Gamification progress tracking\n\n#### Customization Options\n- **Habit Categories**: Extend the `HabitsDataStore` to add new pre-built habits\n- **Achievement Types**: Modify `AchievementDefinitions` to create new achievements\n- **Rating Tiers**: Adjust the 12-tier system in `LongevityRating.swift`\n- **UI Themes**: Customize colors and styling through the theme manager\n\n## 🎮 User Journey\n\n### Onboarding Experience\n1. **Welcome**: Introduction to HabitDiary's mission and benefits\n2. **Features**: Showcase of rating system, achievements, and capabilities\n3. **Habit Selection**: Choose from 35+ categorized habit templates\n4. **Setup Complete**: Personalized tips and guidance for getting started\n\n### Daily Workflow\n1. **Morning Check**: Open Today tab to see scheduled habits\n2. **Track Progress**: Tap habits to mark as complete with satisfying animations\n3. **Build Streaks**: Maintain consistency to unlock achievements\n4. **Monitor Growth**: Check Rating tab to see score progression\n\n### Long-term Engagement\n- **Achievement Unlocking**: Celebrate milestones with popup notifications\n- **Rating Advancement**: Progress from Beginner (F) to Legend (SSS)\n- **Habit Evolution**: Add new habits and archive completed ones\n- **Data Insights**: Review historical data and identify patterns\n\n## 🤝 Contributing\n\nWe welcome contributions to make HabitDiary even better! Here's how you can help:\n\n### Development Process\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes following our coding standards\n4. Test thoroughly on multiple devices and iOS versions\n5. Commit your changes (`git commit -m 'Add amazing feature'`)\n6. Push to the branch (`git push origin feature/amazing-feature`)\n7. Open a Pull Request with detailed description\n\n### Code Style Guidelines\n- Follow Swift API Design Guidelines\n- Use meaningful variable and function names\n- Document complex logic with comments\n- Ensure all code compiles without warnings\n- Write unit tests for new functionality where appropriate\n\n### Testing Requirements\n- Test on both iPhone and iPad simulators\n- Verify functionality across iOS 17+ versions\n- Test edge cases and error scenarios\n- Validate accessibility features\n- Check database migrations and data integrity\n\n## 📄 License\n\nThis project is licensed under the **Creative Commons Attribution-NonCommercial 4.0 International License** ([CC BY-NC 4.0](https://creativecommons.org/licenses/by-nc/4.0/)).\n\n### What this means:\n- ✅ **Share**: Copy and redistribute the material in any medium or format\n- ✅ **Adapt**: Remix, transform, and build upon the material\n- ✅ **Attribution**: Give appropriate credit and indicate if changes were made\n- ❌ **NonCommercial**: You may not use the material for commercial purposes\n\nFor commercial use, please contact the author for licensing arrangements.\n\n## 🆘 Support \u0026 Community\n\n- **Issues**: [GitHub Issues](https://github.com/banghuazhao/habit-diary/issues) for bug reports and feature requests\n- **Discussions**: [GitHub Discussions](https://github.com/banghuazhao/habit-diary/discussions) for general questions\n- **Email**: Contact through GitHub for direct communication\n\n## 🗺️ Roadmap\n\n### Planned Features\n- [ ] **HealthKit Integration**: Sync with Apple Health for comprehensive wellness tracking\n- [ ] **Apple Watch App**: Quick habit check-ins from your wrist\n- [ ] **Widget Support**: iOS home screen widgets for at-a-glance progress\n- [ ] **Data Export**: CSV/JSON export for data portability\n- [ ] **Advanced Analytics**: Detailed insights and correlation analysis\n- [ ] **Community Features**: Share progress and compete with friends\n- [ ] **AI Recommendations**: Personalized habit suggestions based on user patterns\n- [ ] **iPad Optimization**: Enhanced interface for larger screens\n\n### Long-term Vision\n- Integration with wearable devices for automatic tracking\n- Machine learning for optimal habit scheduling\n- Advanced data visualization and insights\n- Multi-platform support (macOS, watchOS)\n\n## 🙏 Acknowledgments\n\n- **SwiftUI Community**: For excellent resources and best practices\n- **GRDB**: For providing a robust SQLite wrapper for Swift\n- **Design Inspiration**: From leading habit tracking and wellness applications\n- **Scientific Research**: Habit formation studies that inform our approach\n- **Beta Testers**: Community members who provided valuable feedback\n\n---\n\n**Built with ❤️ by [Banghua Zhao](https://github.com/banghuazhao)**\n\n*Transforming lives through the power of consistent habits* 🌟\n\n---\n\n### Quick Start Guide\n\n**New to HabitDiary?** Here's how to get the most out of your experience:\n\n1. **Start Small**: Choose 3-5 habits from our gallery to begin with\n2. **Be Consistent**: Focus on daily completion rather than perfection\n3. **Track Progress**: Check your Rating tab weekly to see improvement\n4. **Celebrate Wins**: Enjoy achievement notifications and share your success\n5. **Evolve Gradually**: Add new habits as existing ones become automatic\n\n**Remember**: Building habits is a journey, not a destination. HabitDiary is here to support you every step of the way! 🚀\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanghuazhao%2Fhabit-diary","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbanghuazhao%2Fhabit-diary","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbanghuazhao%2Fhabit-diary/lists"}