|
|
- Habit Creation: Add custom habits with meaningful names
- Daily Tracking: Mark habits as completed each day with a simple tap
- Streak Counter: Track consecutive days of completion for each habit
- Visual Feedback: See your progress with emojis and visual indicators
- Data Persistence: Your habits and progress are saved locally
- Clean UI: Modern, intuitive interface focused on habit completion
The app features a clean, modern interface with:
- Header showing daily progress and total streak
- Individual habit cards with streak counters
- Floating action button to add new habits
- Modal for creating new habits
- Empty state when no habits are added
- Node.js (v14 or higher)
- npm or yarn
- Expo CLI (
npm install -g @expo/cli)
- Clone the repository:
git clone <repository-url>
cd habit-streak- Install dependencies:
npm install- Start the development server:
npm start- Run on your device:
- Install the Expo Go app on your phone
- Scan the QR code from the terminal
- Or press 'a' for Android or 'i' for iOS simulator
- Tap the floating action button (+)
- Enter a habit name (e.g., "Drink Water", "Exercise", "Read")
- Tap "Add Habit"
- Tap on any habit card to mark it as completed for today
- The streak counter will update automatically
- Tap again to unmark if needed
- Current Streak: Consecutive days completed (including today)
- Visual Indicators:
- π΄ No streak
- π₯ 1-2 days
- π₯π₯ 3-6 days
- π₯π₯π₯ 7-13 days
- π₯π₯π₯π₯ 14-29 days
- π₯π₯π₯π₯π₯ 30-99 days
- π 100+ days
- React Native: Cross-platform mobile development
- Expo: Development platform and tools
- TypeScript: Type safety and better development experience
- Expo SecureStore: Local data persistence
- React Native Gesture Handler: Touch interactions
src/
βββ components/ # Reusable UI components
β βββ HabitCard.tsx # Individual habit display
β βββ AddHabitModal.tsx # Modal for adding habits
β βββ EmptyState.tsx # Empty state component
βββ types/ # TypeScript type definitions
β βββ index.ts
βββ utils/ # Utility functions
β βββ dateUtils.ts # Date and streak calculations
β βββ storage.ts # Data persistence
βββ App.tsx # Main app component
interface Habit {
id: string;
name: string;
createdAt: string;
completedDates: string[];
currentStreak: number;
longestStreak: number;
}npm start: Start the Expo development servernpm run android: Run on Android device/emulatornpm run ios: Run on iOS device/simulatornpm run web: Run in web browser
- Streak Calculation: Smart algorithm that considers consecutive days
- Data Persistence: Uses Expo SecureStore for reliable local storage
- Responsive Design: Works on various screen sizes
- Type Safety: Full TypeScript implementation
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
- Habit categories and tags
- Reminder notifications
- Statistics and analytics
- Dark mode support
- Export/import data

