MinMaxLife is a React Native application built with Expo that gamifies personal development. It maps real-world habits and tasks to RPG-style attributes (Strength, Intelligence, Discipline, etc.), allowing users to track progress through a quantitative stat system.
The application leverages Supabase for backend persistence and OpenAI's GPT-4o-mini to intelligently categorize user-defined tasks into appropriate stat buckets.
The core concept involves "quests"—tasks with defined frequencies (daily, weekly, monthly, one-time). Completion of these quests awards experience points to specific stats. The application handles complex logic for stat decay (missing recurrence windows) and diminishing returns to simulate realistic habit formation.
Frontend
- Framework: React Native (Expo SDK 54)
- Routing: Expo Router (File-based routing)
- Language: TypeScript
- State Management: TanStack Query (React Query)
- Styling: NativeWind (Tailwind CSS implementation for React Native)
- Visualization: Victory Native (Charts)
Backend & Services
- Database: Supabase (PostgreSQL)
- Authentication: Supabase Auth
- AI Integration: OpenAI API (GPT-4o-mini with structured outputs)
- Schema Validation: Zod
- Attribute System: Tracks 8 core stats: Strength, Intelligence, Discipline, Charisma, Growth, Efficiency, Health, and Creativity.
- Automated Categorization: Utilizes OpenAI to analyze quest titles/descriptions and automatically assign relevant stat points and difficulty multipliers.
- Temporal Logic: Implements logic for daily, weekly, and monthly recurrence, including penalties for missed periods.
- Data Visualization: Renders historical progress of attributes using interactive line charts.
- Cross-Platform: Compatible with iOS, Android, and Web clients.
The project uses a relational schema hosted on Supabase:
profiles: User identity and metadata.user_stats: Aggregated current values for each of the 8 attributes.quests: Active and inactive tasks with JSONB columns for assigned stat rewards.quest_completions: Ledger of all completed events for history tracking and auditing.
- Node.js (LTS)
- npm or yarn
- Expo Go (for device testing) or Android/iOS Simulators
-
Clone the repository:
git clone [https://github.com/your-username/min-max-life.git](https://github.com/your-username/min-max-life.git) cd min-max-life -
Install dependencies:
npm install
-
Configure environment variables: Create a
.envfile in the root directory.EXPO_PUBLIC_SUPABASE_URL=your_supabase_url EXPO_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key EXPO_PUBLIC_OPENAI_API_KEY=your_openai_api_key
-
Initialize Database: Execute the contents of
supabase-setup.sqlin your Supabase SQL Editor to generate the required tables, Row Level Security (RLS) policies, and indexes. -
Start the development server:
npx expo start
- Stat Assignment: The
ai-service.tsmodule uses OpenAI's JSON mode to ensure strictly typed responses when parsing user input for quest creation. - Optimistic Updates: The application uses TanStack Query's optimistic updates to ensure immediate UI feedback upon quest completion, syncing with Supabase in the background.