A comprehensive React Native application built with Expo Router for tracking sobriety milestones, managing wellness goals, and supporting recovery journeys. Sobrixity combines beautiful design with powerful features to help users maintain their sobriety and build healthy habits.
- Sobriety Tracking: Real-time calculation of days, weeks, months, and years sober
- Daily Check-ins: Morning and evening mood/wellness tracking
- Goal Management: Set, track, and complete personal recovery goals
- Progress Analytics: Visual charts and statistics of your journey
- Wellness Resources: Mindfulness activities, breathing exercises, and motivational content
- Emergency Support: Quick access to crisis hotlines and support contacts
- Beautiful UI: Modern design with smooth animations and micro-interactions
- Dark/Light Theme: Automatic theme switching with user preference storage
- Responsive Design: Optimized for all screen sizes and orientations
- Offline Support: Core features work without internet connection
- Secure Authentication: Email/password authentication with Supabase
- React Native (0.79.4) - Cross-platform mobile development
- Expo (SDK 53) - Development platform and tooling
- Expo Router (5.1.0) - File-based routing system
- TypeScript - Type-safe development
- React Native Reanimated (3.17.4) - High-performance animations
- Lucide React Native - Beautiful icon library
- Supabase - Backend-as-a-Service with PostgreSQL
- Row Level Security (RLS) - Secure data access
- Real-time subscriptions - Live data updates
- React Native StyleSheet - Native styling approach
- Linear Gradients - Beautiful gradient backgrounds
- Custom Animations - Smooth micro-interactions
- Particle Background - Dynamic visual effects
- Victory Native - Data visualization and analytics charts
The project follows a modular, scalable architecture with clear separation of concerns:
sobrixity/
βββ app/ # Expo Router pages (max 200 lines per file)
β βββ _layout.tsx # Root layout with providers
β βββ welcome.tsx # Welcome/landing page
β βββ +not-found.tsx # 404 page
β βββ (auth)/ # Authentication flow
β β βββ _layout.tsx # Auth layout
β β βββ signin.tsx # Sign in screen
β β βββ signup.tsx # Sign up screen
β β βββ onboarding/ # Onboarding flow
β β βββ index.tsx # Main onboarding controller
β β βββ components/ # Step components
β β βββ WelcomeStep.tsx
β β βββ SobrietyDateStep.tsx
β β βββ AddictionTypeStep.tsx
β β βββ CheckInPreferencesStep.tsx
β β βββ NotificationSettingsStep.tsx
β β βββ FinancialTrackingStep.tsx
β β βββ SupportNetworkStep.tsx
β β βββ CompletionStep.tsx
β βββ (tabs)/ # Main app tabs
β βββ _layout.tsx # Tab navigation
β βββ index.tsx # Dashboard/Home
β βββ goals/ # Goal management
β β βββ index.tsx # Goals list and main functionality
β β βββ components/ # Goal-specific components
β β βββ GoalCard.tsx
β β βββ GoalFormModal.tsx
β βββ progress/ # Analytics & charts
β β βββ index.tsx
β βββ wellness/ # Wellness resources
β β βββ index.tsx
β βββ profile/ # User profile
β βββ index.tsx
βββ components/ # Reusable UI components
β βββ AnimatedCard.tsx # Animated card component
β βββ CheckInButtons.tsx # Daily check-in interface
β βββ HeroCard.tsx # Main dashboard card
β βββ StatsGrid.tsx # Statistics display
β βββ OnboardingProgress.tsx # Progress indicator
β βββ common/ # Common utilities
β β βββ AccessibilityWrapper.tsx # Accessibility helper
β βββ forms/ # Form components
β β βββ DatePicker.tsx # Custom date picker
β βββ particles/ # Visual effects
β βββ ParticleBackground.tsx # Animated background
βββ services/ # API and data services
β βββ supabaseClient.ts # Supabase client configuration
β βββ auth.ts # Authentication services
β βββ profiles.ts # Profile management
β βββ goals.ts # Goals management
β βββ checkins.ts # Check-ins management
β βββ financial.ts # Financial tracking
β βββ mindfulness.ts # Mindfulness sessions
βββ contexts/ # React contexts
β βββ AuthContext.tsx # Authentication state
β βββ ThemeContext.tsx # Theme management
βββ hooks/ # Custom hooks
β βββ useFrameworkReady.ts # Framework initialization
βββ types/ # TypeScript definitions
β βββ app.ts # App-specific types
β βββ database.ts # Database schema types
β βββ onboarding.ts # Onboarding types
βββ utils/ # Utility functions
β βββ onboarding.ts # Onboarding utilities
βββ constants/ # App constants
β βββ theme.ts # Theme definitions
βββ assets/ # Static assets
βββ images/ # App icons and images
- Single Responsibility: Each file focuses on one specific functionality
- Size Limits: Files are kept under 200 lines for maintainability
- Clear Separation: Components, services, and utilities are clearly separated
- Atomic Design: Small, reusable components that can be composed
- Feature-Based: Components grouped by functionality (forms, particles, etc.)
- Prop Interfaces: Strong typing for all component props
- API Abstraction: All external API calls are abstracted into service functions
- Data Management: Centralized data fetching and caching logic
- Error Handling: Consistent error handling across all services
- Database Types: Auto-generated types from Supabase schema
- Component Props: Strongly typed component interfaces
- API Responses: Typed service responses
- Context API: Global state management for auth and theme
- Local State: Component-level state for UI interactions
- Async Storage: Persistent storage for user preferences
- Node.js (v18 or higher)
- npm or yarn
- Expo CLI
- iOS Simulator (for iOS development)
- Android Studio (for Android development)
-
Clone the repository
git clone <repository-url> cd sobrixity
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env
Update
.envwith your Supabase credentials:EXPO_PUBLIC_SUPABASE_URL=your_supabase_url EXPO_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key -
Start the development server
npm run dev
npm run dev
# Press 'w' to open in web browsernpm run dev
# Press 'i' to open iOS simulatornpm run dev
# Press 'a' to open Android emulator- Install Expo Go app on your device
- Scan the QR code from the terminal
- The app will load on your device
-
Create a Supabase project at supabase.com
-
Run the database migrations (SQL scripts in
/supabase/migrations/) -
Set up Row Level Security policies for data protection
The app uses the following main tables:
- profiles - User profile information
- check_ins - Daily mood and wellness check-ins
- goals - User-defined recovery goals
- financial_tracking - Money saved tracking
- mindfulness_sessions - Wellness activity tracking
- Primary: Purple (#8B5CF6) - Main brand color
- Secondary: Cyan (#06B6D4) - Accent color
- Success: Green (#22C55E) - Positive actions
- Warning: Amber (#F59E0B) - Caution states
- Error: Red (#EF4444) - Error states
- Font Family: Inter (Google Fonts)
- Weights: Regular (400), Medium (500), SemiBold (600), Bold (700)
- xs: 4px
- sm: 8px
- md: 16px
- lg: 24px
- xl: 32px
- xxl: 48px
-
Component Files (max 200 lines)
- Single component per file
- Related components grouped in subdirectories
- Clear, descriptive naming
-
Service Files (max 200 lines)
- One service per domain (auth, profiles, goals, etc.)
- Consistent API patterns
- Proper error handling
-
Page Files (max 200 lines)
- Main page logic only
- Complex components extracted to separate files
- Clean separation of concerns
- Use TypeScript for all new code
- Follow React Native best practices
- Use functional components with hooks
- Implement proper error handling
- Write descriptive commit messages
- Keep components focused and reusable
- Use proper TypeScript interfaces
- Implement loading and error states
- Follow the established design system
- Use React Native Reanimated for animations
- Keep animations smooth (60fps)
- Provide meaningful feedback to user actions
- Consider accessibility in animations
- Primary development platform
- Full feature compatibility
- Responsive design implementation
- Progressive Web App capabilities
- Native performance optimizations
- Platform-specific UI adaptations
- Gesture handling with react-native-gesture-handler
- Proper keyboard handling
- Unit tests for utility functions
- Component testing with React Native Testing Library
- Service layer testing for API calls
- Integration tests for critical user flows
- Cross-platform compatibility testing
- Performance testing on various devices
- Accessibility testing
- User experience validation
npm run build:web# Development build
npx expo build:android
npx expo build:ios
# Production build
npx expo build:android --release-channel production
npx expo build:ios --release-channel production- Web: Netlify, Vercel, or any static hosting
- Mobile: App Store (iOS) and Google Play Store (Android)
- Over-the-air updates: Expo Updates for instant deployments
- Row Level Security (RLS) on all database tables
- Secure authentication with Supabase Auth
- Environment variables for sensitive data
- Input validation and sanitization
- Minimal data collection
- User consent for data usage
- Secure data transmission (HTTPS)
- Regular security audits
- Fork the repository
- Create a feature branch
- Follow file organization guidelines
- Keep files under 200 lines
- Write/update tests
- Submit a pull request
- All changes require review
- Automated testing must pass
- File size limits enforced
- Architecture compliance check
- Performance impact assessment
- Automatic Refactoring: Files approaching 200 lines are automatically split
- Lazy Loading: Components loaded on demand
- Tree Shaking: Unused code eliminated during build
- Bundle Analysis: Regular monitoring of bundle size
- React Native Reanimated: High-performance animations
- Memoization: Prevent unnecessary re-renders
- Image Optimization: Proper image loading and caching
- Memory Management: Efficient state management
This project is licensed under the MIT License - see the LICENSE file for details.
- Check the documentation first
- Search existing issues on GitHub
- Create a new issue with detailed information
- Join our community Discord server
The app includes built-in emergency contacts:
- Crisis Hotline: 988 (National Suicide Prevention Lifeline)
- Substance Abuse Hotline: 1-800-662-4357 (SAMHSA National Helpline)
- Expo Team - Amazing development platform
- Supabase Team - Excellent backend-as-a-service
- React Native Community - Continuous innovation
- Recovery Community - Inspiration and feedback
- Version: 1.0.0
- Status: Active Development
- Architecture: Modular, Scalable
- File Organization: Optimized for Maintainability
- Last Updated: 2025
- Maintainers: Sobrixity Team
- Modular Structure: Implemented clear separation of concerns
- Component Organization: Grouped by functionality (forms, particles, common)
- Service Layer: Centralized API management
- Type Safety: Enhanced TypeScript integration
- File Size Management: Enforced 200-line file limits
- Onboarding Split: Broke monolithic onboarding into manageable components
- Feature Grouping: Organized related functionality together
- Improved Maintainability: Easier to locate and modify specific functionality
- Enhanced Scalability: Clear patterns for adding new features
- Better Collaboration: Multiple developers can work on different components
- Reduced Complexity: Smaller, focused files are easier to understand
- Performance Optimization: Better tree-shaking and code splitting
- Testing Efficiency: Isolated components are easier to test
Built with β€οΈ for the recovery community
Sobrixity is more than an app - it's a companion on your journey to wellness and sobriety.