A modern habit-tracking iOS app built with SwiftUI and GRDB, designed to help users build and maintain habits that promote long-term health and longevity. Longevity Master focuses on evidence-based habits that contribute to healthy aging and overall well-being.
Now available on the App Store! π
Build powerful daily habits to extend your lifespan. Longevity Master helps you live longer and feel better with science-based routines for health and wellness.
The app features a clean, modern interface with habit cards, tracking views, and intuitive navigation designed to help users build lasting health habits.
- Habit Tracking: Create, edit, and track daily habits with customizable frequencies
- Anti-Aging Rating System: Each habit includes a 1-5 star rating based on scientific evidence for longevity benefits
- Smart Categories: Organized into 5 key areas (Diet, Exercise, Sleep, Preventive Health, Mental Health)
- 24 Achievements: Streak milestones, check-in goals, perfect weeks/months, category mastery, time-based challenges
- Progress Tracking: Visual progress bars and celebration animations
- Social Sharing: Share achievements with friends
- Customizable Notifications: Set personalized reminder times for each habit
- Habit-Specific Alerts: Link reminders directly to individual habits
- Easy Management: Simple setup and notification preferences
- 12-Level Rating: From Beginner (F) to Legend (SSS) based on overall health habits
- Multi-Dimensional Scoring: Active habits, anti-aging ratings, achievements, check-ins, and streaks
- Progress Analytics: Detailed breakdowns and improvement tips
- Modern SwiftUI Interface: Clean, intuitive design following iOS guidelines
- Flexible Scheduling: Support for various frequency patterns (weekly, monthly, custom)
- Theme Customization: Multiple color themes and personalization options
- Haptic Feedback & Sound Effects: Enhanced user interaction
- GRDB Database: Robust local data storage with SQLite
- Calendar Integration: Monthly and yearly habit tracking views
- Streak Calculation: Automatic streak tracking with flexible settings
- Data Export: Built-in data export capabilities
- Habit Statistics: Detailed analytics for each habit
- Progress Visualization: Calendar views showing completion patterns
- Category Analysis: Performance breakdown by habit category
- Achievement Progress: Visual progress tracking for all achievements
- Habit Archiving: Archive habits without losing data
- Icon Customization: Choose from extensive emoji icon library
- Multi-language Support: English and Simplified Chinese localization
- SwiftUI 5.0: Modern declarative UI framework
- GRDB: SQLite database with Swift integration
- Observation Framework: Reactive data binding
- SwiftUINavigation: Type-safe navigation handling
LongevityMaster/
βββ App/
β βββ LongevityMasterApp.swift # App entry point
βββ Components/
β βββ Common/ # Reusable UI components
β β βββ HabitCardView.swift
β β βββ HabitItemView.swift
β βββ Habits/ # Habit management views
β β βββ HabitForm.swift
β β βββ HabitIconEdit.swift
β β βββ HabitsGallery.swift
β β βββ HabitsList.swift
β βββ Me/ # User profile and settings
β β βββ AppItem.swift
β β βββ MeFeature.swift
β β βββ MoreAppsView.swift
β βββ Today/ # Daily habit tracking
β βββ TodayView.swift
β βββ TodayViewModel.swift
βββ Model/ # Data models
β βββ CheckIn.swift
β βββ Habit.swift
β βββ TodayHabit.swift
βββ Service/ # Business logic and data services
β βββ HabitIconColorDataSource.swift
β βββ HabitIconDataSource.swift
β βββ HabitsDataStore.swift
βββ Utilities/ # Helper functions and extensions
βββ Constants.swift
βββ Extension/
β βββ Color+Extensions.swift
β βββ Date+Extension.swift
β βββ Habit+Extension.swift
βββ HashableObject.swift
βββ Schema.swift
Download Longevity Master from the App Store and start building healthy habits today!
- Xcode 15.0 or later
- iOS 17.0+ deployment target
- macOS 14.0+ (for development)
-
Clone the repository
git clone https://github.com/banghuazhao/longevity-master.git cd longevity-master -
Open in Xcode
open LongevityMaster.xcodeproj
-
Build and Run
- Select your target device or simulator
- Press
Cmd + Rto build and run the app
The project uses several key dependencies managed through Swift Package Manager:
- GRDB: Database layer
- SwiftUINavigation: Navigation handling
- Observation: Reactive programming
The app uses GRDB for local data storage. The database is automatically initialized when the app launches.
- Habit Categories: Easily extend the
HabitCategoryenum to add new categories - Frequency Types: Modify
HabitFrequencyto support different scheduling patterns - UI Themes: Customize colors and styling in the
Constants.swiftfile
We welcome contributions! Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- Follow Swift style guidelines
- Use meaningful variable and function names
- Add comments for complex logic
- Ensure all code compiles without warnings
- Test on both iPhone and iPad simulators
- Verify functionality across different iOS versions
- Test edge cases and error scenarios
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International License (CC BY-NC 4.0).
This means you can:
- β Use, share, and modify the code for non-commercial purposes
- β Distribute the code with proper attribution
- β Use the code for commercial purposes without permission
- App Store: Longevity Master on the App Store
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: Open an issue for direct contact
- AI powered scientific habit recommendations
- Integration with HealthKit
- Data export and backup
- Community features
- Built with β€οΈ using SwiftUI and modern iOS development practices
- Inspired by scientific research on longevity and healthy aging
- Thanks to the open-source community for amazing tools and libraries
Made with β€οΈ by Banghua Zhao
Empowering users to build habits that last a lifetime π



