Build habits together, stay accountable, and grow stronger with your partner!
- Frontend Framework: React Native with Expo
- Styling: NativeWind (TailwindCSS for React Native)
- State Management: Zustand
- Backend & Authentication: Supabase
- Navigation: Expo Router
- Storage: MMKV for local storage
- Animations: React Native Reanimated
HabitMates/
├── app/ # Application screens and navigation
│ ├── (auth)/ # Authenticated routes
│ │ ├── (tabs)/ # Bottom tab navigation
│ │ │ ├── habits/ # Habits management
│ │ │ ├── home/ # Home dashboard
│ │ │ ├── partners/ # Partners management
│ │ │ └── profile/ # User profile
│ ├── login.tsx # Login screen
│ └── _layout.tsx # Root layout
├── components/ # Reusable components
├── lib/ # Core functionality
│ ├── stores/ # Zustand stores
│ ├── types.ts # TypeScript definitions
│ └── supabase.ts # Supabase client
└── assets/ # Static assets
-
users
- id (UUID, PK)
- username (text)
- avatar_url (text)
- is_active (boolean)
- banned (boolean)
- streak_rescues_remaining (integer)
- created_at (timestamp)
- updated_at (timestamp)
-
habits
- id (UUID, PK)
- name (text)
- description (text)
- frequency ('daily' | 'weekly')
- owner_id (UUID, FK)
- partner_id (UUID, FK)
- current_streak (integer)
- longest_streak (integer)
- is_public (boolean)
- created_at (timestamp)
- updated_at (timestamp)
-
streaks
- id (UUID, PK)
- habit_id (UUID, FK)
- date (date)
- user_completed (boolean)
- partner_completed (boolean)
- created_at (timestamp)
-
Authentication
- Email/Password login
- Session persistence
- Protected routes
-
Habit Management
- Create habits
- Track daily/weekly progress
- Streak tracking
- Public/Private habits
-
Theme System
- Light/Dark mode
- System theme support
- Persistent theme preferences
- Install dependencies:
npm install- Set up environment variables:
Create a
.envfile with:
EXPO_PUBLIC_SUPABASE_URL=your_supabase_url
EXPO_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
- Start the development server:
npm start- Enable Row Level Security (RLS)
ALTER TABLE habits ENABLE ROW LEVEL SECURITY;- Create RLS Policies
-- Habits table policies
CREATE POLICY "Users can create their own habits"
ON habits FOR INSERT TO authenticated
WITH CHECK (auth.uid() = owner_id::uuid);
CREATE POLICY "Users can view their own habits"
ON habits FOR SELECT TO authenticated
USING (auth.uid() = owner_id::uuid OR is_public = true);
CREATE POLICY "Users can update their own habits"
ON habits FOR UPDATE TO authenticated
USING (auth.uid() = owner_id::uuid);
CREATE POLICY "Users can delete their own habits"
ON habits FOR DELETE TO authenticated
USING (auth.uid() = owner_id::uuid);eas build --platform ioseas build --platform android-
Supabase RLS Policies
- Issue: UUID comparison in RLS policies
- Solution: Cast owner_id to UUID using
owner_id::uuid
-
Theme Persistence
- Using MMKV storage for better performance
- Theme state managed through Zustand store
-
Partner System
- Implement partner invitations
- Add partner streak tracking
- Add partner chat/communication
-
Achievements System
- Track milestones
- Award badges/rewards
- Implement streak rescue system
-
Social Features
- Public habit discovery
- Community challenges
- Social sharing
-
Accountability Deposit System
- Allow users to deposit money when creating habits
- Implement partner accountability with financial incentives
- Automate payout based on habit completion
- Integrate secure payment processing
-
Advanced Analytics
- Detailed habit performance metrics
- Personalized insights and recommendations
- Visual progress tracking with charts and graphs
-
Offline Support
- Local data persistence
- Background syncing when connection is restored
- Optimistic UI updates
HabitMates is currently undergoing a UI/UX redesign to improve user experience and visual appeal. Key focus areas include:
- Creating a consistent design system
- Implementing a modern, clean interface
- Enhancing visual hierarchy and readability
- Adding micro-interactions and feedback animations
- Improving user flows and interactions
We welcome contributions to HabitMates! Here's how you can help:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Please read our Contributing Guidelines for more details.
Please read our Code of Conduct to understand the community standards we uphold.
This project is licensed under the MIT License - see the LICENSE file for details.