Skip to content

Repository files navigation

HabitØ - Habit Tracker App

A beautiful, feature-rich habit tracking app built with React Native and Expo. Track your daily habits, build streaks, and achieve your goals with an intuitive and modern interface.

HabitØ React Native Expo

✨ Features

πŸ“± Core Features

  • Today View - See all habits scheduled for today with progress tracking
  • Habit Management - Create, edit, and organize habits with categories (Essential, Flexible, Weekly)
  • Streak Tracking - Visual streak badges and total streak counter
  • History Calendar - View your completion history in a beautiful calendar view
  • Dark/Light Mode - Automatic theme switching with system preference support
  • Onboarding Flow - Guided setup for first-time users

πŸ”” Notifications

  • Morning Reminders - Customizable daily morning motivation (default: 7:00 AM)
  • Evening Summaries - Daily progress recap (default: 9:30 PM)
  • Smart Reminders - AI-powered optimal timing reminders
  • Habit-Specific Reminders - Individual reminders for each habit
  • Streak Warnings - Alerts to prevent breaking your streak

🎯 Advanced Features

  • Flexible Streak Modes - Strict or lenient streak calculation
  • Grace Days - Configurable grace period for missed days
  • Habit Categories - Organize habits as Essential, Flexible, or Weekly
  • Archive Habits - Archive old habits without losing history
  • Real-time Updates - Instant UI updates when habits are added/edited
  • Data Export - Export your data as JSON (development mode)

πŸ› οΈ Tech Stack

  • Framework: React Native 0.81.5
  • Platform: Expo SDK 54
  • Language: TypeScript
  • Navigation: React Navigation (Stack & Bottom Tabs)
  • Database: Realm (local database)
  • Storage: AsyncStorage (settings & preferences)
  • Notifications: Expo Notifications
  • Date Handling: date-fns
  • Icons: Expo Vector Icons (Feather)

πŸ“‹ Prerequisites

  • Node.js 18+ and npm
  • iOS Simulator (for iOS development) or Android Emulator (for Android development)
  • Expo CLI (npm install -g expo-cli)
  • For iOS: Xcode 14+ (macOS only)
  • For Android: Android Studio

πŸš€ Getting Started

Installation

  1. Clone the repository

    git clone https://github.com/yourusername/habit-tracker.git
    cd habit-tracker
  2. Install dependencies

    npm install
  3. Start the development server

    npm start
    # or
    npx expo start

Running on iOS

npm run ios
# or
npx expo run:ios

Running on Android

npm run android
# or
npx expo run:android

Running on Web

npm run web
# or
npx expo start --web

πŸ“± Development Build

This app uses native modules (Realm), so you need a development build instead of Expo Go:

# Install expo-dev-client
npx expo install expo-dev-client

# Build for iOS
npx expo run:ios

# Build for Android
npx expo run:android

πŸ“ Project Structure

habit-tracker/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ components/          # Reusable UI components
β”‚   β”‚   β”œβ”€β”€ Screen.tsx
β”‚   β”‚   β”œβ”€β”€ StreakBadge.tsx
β”‚   β”‚   β”œβ”€β”€ TimeInput.tsx
β”‚   β”‚   └── WeekdaySelector.tsx
β”‚   β”œβ”€β”€ hooks/              # Custom React hooks
β”‚   β”‚   β”œβ”€β”€ useHabits.ts
β”‚   β”‚   β”œβ”€β”€ useOnboardingState.ts
β”‚   β”‚   └── useSettings.ts
β”‚   β”œβ”€β”€ navigation/         # Navigation configuration
β”‚   β”‚   β”œβ”€β”€ RootNavigator.tsx
β”‚   β”‚   └── types.ts
β”‚   β”œβ”€β”€ screens/            # Screen components
β”‚   β”‚   β”œβ”€β”€ TodayScreen.tsx
β”‚   β”‚   β”œβ”€β”€ HabitListScreen.tsx
β”‚   β”‚   β”œβ”€β”€ HabitFormScreen.tsx
β”‚   β”‚   β”œβ”€β”€ HabitDetailScreen.tsx
β”‚   β”‚   β”œβ”€β”€ HistoryScreen.tsx
β”‚   β”‚   β”œβ”€β”€ ProfileScreen.tsx
β”‚   β”‚   └── onboarding/
β”‚   β”œβ”€β”€ services/           # Business logic services
β”‚   β”‚   └── notifications.ts
β”‚   β”œβ”€β”€ storage/            # Data persistence
β”‚   β”‚   β”œβ”€β”€ habits.ts
β”‚   β”‚   └── realm-config.ts
β”‚   β”œβ”€β”€ theme/              # Theme configuration
β”‚   β”‚   β”œβ”€β”€ index.ts
β”‚   β”‚   β”œβ”€β”€ palettes.ts
β”‚   β”‚   └── tokens.ts
β”‚   β”œβ”€β”€ types/             # TypeScript type definitions
β”‚   β”‚   β”œβ”€β”€ habits.ts
β”‚   β”‚   └── settings.ts
β”‚   └── utils/             # Utility functions
β”‚       └── streak.ts
β”œβ”€β”€ assets/                # Images, icons, fonts
β”œβ”€β”€ App.tsx                # Root component
β”œβ”€β”€ app.json               # Expo configuration
└── package.json           # Dependencies

🎨 Key Features Explained

Habit Categories

  • Essential: Daily habits that are critical to your routine
  • Flexible: Habits that can be done on any day
  • Weekly: Habits that occur on specific days of the week

Streak Calculation

  • Strict Mode: Streak breaks if you miss a scheduled day
  • Lenient Mode: Allows grace days before breaking streak

Notifications

  • All notification times are customizable
  • Habit-specific reminders only fire on scheduled days
  • Smart reminders adapt to your completion patterns

πŸ”§ Development

Available Scripts

  • npm start - Start Expo development server
  • npm run ios - Run on iOS simulator
  • npm run android - Run on Android emulator
  • npm run web - Run on web browser

Development Tools

In development mode (__DEV__ === true), the app includes:

  • Database inspection tools
  • Data export functionality
  • Full reset option for testing

These are automatically removed in production builds.

πŸ“¦ Building for Production

Automated Builds with GitHub Actions

This repository includes GitHub Actions workflows for automated builds:

  • Android: Builds AAB for Google Play Store
  • iOS: Builds ad-hoc distribution for free Apple Developer accounts

Setup:

  1. Add EXPO_TOKEN to GitHub Secrets (Settings β†’ Secrets β†’ Actions)
  2. Push to main branch or create a release tag
  3. Builds run automatically

Manual Build Commands:

# Install EAS CLI
npm install -g eas-cli

# Login
eas login

# Configure (first time)
eas build:configure

# Build Android for Play Store
eas build --platform android --profile production-android

# Build iOS for ad-hoc (free account)
eas build --platform ios --profile ios-adhoc

Release Process

We have an automated release system that creates GitHub releases when you push a version tag:

Quick Release (Automated Script)

# Make the script executable (first time only)
chmod +x scripts/release.sh

# Create a new release
./scripts/release.sh 1.0.2

The script will:

  1. βœ… Update package.json and app.json versions
  2. βœ… Verify release notes exist in RELEASE_NOTES.md
  3. βœ… Commit and tag the release
  4. βœ… Push to GitHub
  5. βœ… Trigger automatic GitHub Release creation

Manual Release

# 1. Update versions in package.json and app.json
# 2. Add release notes to RELEASE_NOTES.md
# 3. Commit changes
git add .
git commit -m "chore: bump version to 1.0.2"

# 4. Create and push tag
git tag v1.0.2
git push origin main
git push origin v1.0.2

What Happens Automatically

  • πŸ“ GitHub Release is created with notes from RELEASE_NOTES.md
  • 🏷️ Release is tagged with version number
  • πŸ“‹ Commit history is included
  • πŸ”— Release appears on GitHub Releases page

πŸ“– See RELEASE_GUIDE.md for detailed release instructions
πŸ“– See DEPLOYMENT.md for complete deployment guide

πŸ—„οΈ Database

The app uses Realm for local data storage:

  • Habits and completions are stored in Realm
  • Settings and preferences are stored in AsyncStorage
  • Database file is automatically created on first launch

πŸ” Permissions

The app requests the following permissions:

  • Notifications - For habit reminders and daily summaries
  • Requested automatically on app launch

πŸ› Troubleshooting

Realm Database Issues

If you encounter database errors:

  1. Close the app completely
  2. Delete and reinstall the app
  3. Or use the reset option in Profile screen (development mode)

Notification Not Working

  1. Check device notification settings
  2. Ensure permissions are granted
  3. Verify notification times are set correctly

Build Errors

  • Ensure all dependencies are installed: npm install
  • Clear cache: npx expo start -c
  • For iOS: Clean build folder in Xcode
  • For Android: cd android && ./gradlew clean

πŸš€ Deployment

Google Play Store

  • βœ… Automated builds via GitHub Actions
  • βœ… Automatic submission to Play Store (after setup)
  • βœ… AAB format for Play Store submission
  • βœ… See DEPLOYMENT.md for details
  • βœ… See GOOGLE_PLAY_SETUP.md for Play Store automation setup

iOS (Free Developer Account)

  • βœ… Ad-hoc distribution (up to 100 devices)
  • βœ… No $99/year App Store fee required
  • βœ… Perfect for personal use and testing
  • βœ… See DEPLOYMENT.md for details

GitHub Actions

  • Android Build: .github/workflows/android.yml
  • iOS Build: .github/workflows/ios.yml
  • Release Build: .github/workflows/release.yml

All workflows trigger on:

  • Push to main/master branch
  • Release tags (e.g., v1.0.0)

πŸ“„ License

This project is private and proprietary.

πŸ‘€ Author

Musavir

πŸ™ Acknowledgments


Made with ❀️ using React Native and Expo

About

Habit Tracker with streak rewarding

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages