LogWise is a modern nutrition and habit tracking app designed to help users build healthier routines, break unhelpful habits, and monitor progress over time. It combines food logging, behavioral insights, habit coaching, and progress photo tracking in a single, privacy-first experience.
The app offers two modes:
- Guest Mode: Complete privacy with local-only data storage
- Account Mode: Cloud sync across devices with Supabase backend
- Food Logging: Track meals, macros, and calories with custom foods and quick entry
- Habit Coaching: Get daily behavioral tips and track habit streaks
- Progress Photos: Capture and review transformation photos over time
- Water & Weight Tracking:ing: Log hydration and weight changes, view charts
- Insights: See trends, achievements, and suggestions based on your data
- Push Notifications: Get meal reminders and habit coaching notifications
- Dual Storage Modes:
- Guest Mode: Complete privacy with local-only storage
- Account Mode: Cloud sync with Supabase + local backup
- Offline-first: Works seamlessly offline with optional cloud sync
- Cross-platform: Web, iOS, and Android support
- Frontend: React Native (Expo), TypeScript, Expo Router
- Local Storage: AsyncStorage for guest mode and local backup
- Cloud Backend: Supabase (PostgreSQL, Auth, Real-time)
- State Management: React Context with modular architecture
- Notifications: Expo Notifications
- Charts: React Native Chart Kit
- Nutrition: USDA Food Data Central & OpenFOodFactsacts
- Node.js (16+) & npm npm
- Expo CLI (
npm install -g @expo/cli) - Optional: Supabase account for cloud features
git clone https://github.com/AMEND09/Reality.git
cd Reality
npm install
npm run devevThe app will run in guest mode by default. Users can create accounts later if you set up Supabase.
If you want to enable user accounts and cloud synchronization:
- Go to supabase.com and create a new project
- Wait for the project to be ready (usually 1-2 minutes)
- Open your Supabase project dashboard
- Go to the SQL Editor
- Copy and run the SQL commands from
supabase-schema.sql:
-- Create profiles table
CREATE TABLE profiles (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
name TEXT NOT NULL,
age INTEGER NOT NULL,
sex TEXT NOT NULL CHECK (sex IN ('male', 'female')),
weight_kg DECIMAL NOT NULL,
height_cm INTEGER NOT NULL,
start_weight_kg DECIMAL NOT NULL,
goal_weight_kg DECIMAL NOT NULL,
activity_level TEXT NOT NULL CHECK (activity_level IN ('sedentary', 'light', 'moderate', 'active', 'very_active')),
goals JSONB NOT NULL,
eating_triggers TEXT[] DEFAULT '{}',
problem_foods TEXT[] DEFAULT '{}',
preferred_habits TEXT[] DEFAULT '{}',
motivation_reason TEXT DEFAULT '',
meal_times JSONB DEFAULT '{"breakfast": "08:00", "lunch": "12:30", "dinner": "18:30"}',
notifications_enabled BOOLEAN DEFAULT false,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Create daily_logs table
CREATE TABLE daily_logs (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
date DATE NOT NULL,
meals JSONB DEFAULT '{}',
workout_entries JSONB DEFAULT '[]',
water_ml INTEGER DEFAULT 0,
daily_habits JSONB DEFAULT '{}',
mood_checkins JSONB DEFAULT '{}',
reflection JSONB DEFAULT '{}',
habit_streak JSONB DEFAULT '{}',
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
UNIQUE(user_id, date)
);
-- Create custom_foods table
CREATE TABLE custom_foods (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
name TEXT NOT NULL,
grams INTEGER NOT NULL,
calories DECIMAL NOT NULL,
protein_g DECIMAL NOT NULL,
carbs_g DECIMAL NOT NULL,
fats_g DECIMAL NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Create weight_logs table
CREATE TABLE weight_logs (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
date DATE NOT NULL,
weight_kg DECIMAL NOT NULL,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
UNIQUE(user_id, date)
);
-- Create progress_photos table
CREATE TABLE progress_photos (
id UUID DEFAULT gen_random_uuid() PRIMARY KEY,
user_id UUID REFERENCES auth.users(id) ON DELETE CASCADE,
date DATE NOT NULL,
image_url TEXT NOT NULL,
notes TEXT,
created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW(),
updated_at TIMESTAMP WITH TIME ZONE DEFAULT NOW()
);
-- Enable Row Level Security
ALTER TABLE profiles ENABLE ROW LEVEL SECURITY;
ALTER TABLE daily_logs ENABLE ROW LEVEL SECURITY;
ALTER TABLE custom_foods ENABLE ROW LEVEL SECURITY;
ALTER TABLE weight_logs ENABLE ROW LEVEL SECURITY;
ALTER TABLE progress_photos ENABLE ROW LEVEL SECURITY;
-- Create policies
CREATE POLICY "Users can view own profile" ON profiles FOR SELECT USING (auth.uid() = user_id);
CREATE POLICY "Users can insert own profile" ON profiles FOR INSERT WITH CHECK (auth.uid() = user_id);
CREATE POLICY "Users can update own profile" ON profiles FOR UPDATE USING (auth.uid() = user_id);
CREATE POLICY Y "Users can view own daily logs" ON daily_logs FOR SELECT USING (auth.uid() = user_id);
CREATE POLICY "Users can insert own daily logs" ON daily_logs FOR INSERT WITH CHECK (auth.uid() = user_id);
CREATE POLICY "Users can update own daily logs" ON daily_logs FOR UPDATE USING (auth.uid() = user_id);
CREATE POLICY Y "Users can view own custom foods" ON custom_foods FOR SELECT USING (auth.uid() = user_id);
CREATE POLICY "Users can insert own custom foods" ON custom_foods FOR INSERT WITH CHECK (auth.uid() = user_id);
CREATE POLICY "Users can update own custom foods" ON custom_foods FOR UPDATE USING (auth.uid() = user_id);
CREATE POLICY "Users can delete own custom foods" ON custom_foods FOR DELETE USING (auth.uid() = user_id);
CREATE POLICY Y "Users can view own weight logs" ON weight_logs FOR SELECT USING (auth.uid() = user_id);
CREATE POLICY "Users can insert own weight logs" ON weight_logs FOR INSERT WITH CHECK (auth.uid() = user_id);
CREATE POLICY "Users can update own weight logs" ON weight_logs FOR UPDATE USING (auth.uid() = user_id);
CREATE POLICY Y "Users can view own progress photos" ON progress_photos FOR SELECT USING (auth.uid() = user_id);
CREATE POLICY "Users can insert own progress photos" ON progress_photos FOR INSERT WITH CHECK (auth.uid() = user_id);
CREATE POLICY "Users can delete own progress photos" ON progress_photos FOR DELETE USING (auth.uid() = user_id);- In Supabase dashboard, go to Authentication → Settings
- Enable email authentication
- Configure email templates (optional)
- Set site URL to your app's URL if deploying
Create a .env file in your project root:
# Supabase Configuration
EXPO_PUBLIC_SUPABASE_URL=https://your-project-ref.supabase.co
EXPO_PUBLIC_SUPABASE_ANON_KEY=your-anon-keyGet these values from your Supabase project settings → API.
npm run devThe app will now offer both guest mode and account creation options.
npm run build:web
npm run deployyexpo build:android
expo build:ioss- Privacy-first: All data stays on your device
- No sign-up required: Start using immediately
- Local storage only: Uses AsyncStorage
- Upgrade anytime: Can create an account later to sync data
- Cloud sync: Data synced across all your devices
- Backup protection: Never lose your data
- Email/password: Simple authentication
- Local fallback: Works offline, syncs when online
- First launch: Choose "Continue as Guest" or "Create Account"
- Profile setup: Enter your basic info and goals
- Start tracking: Log meals, workouts, water, and habits
- View insights: Check your progress in the Insights tab
- Tap the "+" button to log meals
- Search foods or add custom entries
- Track macros, calories, and portions
- Monitor eating triggers and mindfulness
- Set daily habit goals
- Track streaks and progress
- Get behavioral insights and tips
- Monitor mood and reflection
- Take progress photos
- Log weight changes
- Track water intake
- View charts and trends
- Set meal reminder times
- Get coaching tips and encouragement
- Configure in Profile → Notification Settings
- Create an account anytime from the Profile tab
- Your local data will be automatically synced
- Continue using the app seamlessly
- All data is accessible via Supabase dashboard
- JSON export available for developers
- Standard PostgreSQL backup/restore
┌─ App Launch ─┐
│ │
├─ Guest Mode ─┤─── AsyncStorage (Local Only)
│ │
└─ Account ────┤─── Supabase (Primary) + AsyncStorage (Backup)
Mode │
└─── Offline: Local → Online: Sync
Sync
App Start → Check Auth State
├─ No User & No Guest Flag → Show Auth Screen
├─ Guest Mode → Load Local Data
└─ Authenticated → Load Cloud Data + Local Backup
kup
up
- Write: Always write locally first, then sync to cloud
- Read: Try cloud first (if authenticated), fallback to local
- Conflict Resolution: Cloud data takes precedence
- Offline: All features work offline, sync when reconnected
app/
├─ (tabs)/ # Main app tabs
├─ auth.tsx # Authentication screen
└─ _layout.tsx # Root layout with providers
components/
├─ AuthGate.tsx # Authentication wrapper
└─ [Other components]
contexts/
├─ AuthContext.tsx # Authentication state
└─ DataContext.tsx # App data state
utils/
├─ storage.ts # Local storage (AsyncStorage)
├─ cloudStorage.ts # Supabase storage
└─ supabase.ts # Supabase client config
e client config
# Start the development server
npm run dev
# Run on specific platform
expo start --ios
expo start --android
expo start --web
b
# Clear cache if needed
expo start --clearrThe app detects Supabase configuration automatically:
- With Supabase: Shows auth options
- Without Supabase: Guest mode only
- Guest Mode: Just run the app normally
- Account Mode: Set up Supabase and test sign-up/sign-in
- Migration: Test creating account from guest mode
- Sync: Test data sync across devices/browsers
- Check that all imports use relative paths
- Ensure TypeScript path mapping is correct
- Try
npm installand restart Metro
- Verify environment variables are set correctly
- Check Supabase project is active
- Ensure RLS policies are properly configured
- Check network connectivity
- Verify user is authenticated
- Check Supabase project logs for errors
npm install
expo start --clearr- Check the Issues page
- Review Supabase documentation
- Test in guest mode to isolate auth issues
We welcome contributions! Please:
- Fork and branch: Create a feature branch from
main - Test both modes: Ensure guest and account modes work
- Follow patterns: Use existing code patterns and context structure
- Document changes: Update README for new features
- Test thoroughly: Test on web and mobile platforms
git clone your-fork-url
cd Reality
npm install
cp .env.example .env # Add your Supabase credentials
npm run devv- Social features and sharing
- Food database integration
- Enhanced analytics
- Meal planning features
- AI-powered recommendations
- Fitness tracker integration
- Nutrition coaching
- Community features
This project is licensed under the MIT License.
For questions or support:
- 📧 Open an issue
- 💬 Check existing discussions
- 📚 Review this documentation
Built with ❤️ using React Native, Expo, and Supabase.