A personal productivity application that transforms your daily tasks and goals into an engaging RPG experience. Complete Pomodoro sessions, earn rewards, achieve revelations, and track your progress toward long-term goals.
For Contributors: See COLLABORATIVE.md for development setup, workflow, and contribution guidelines.
ALWAYS follow these steps after ANY code modification:
- Test your changes - Verify TypeScript compilation and build
- Stage changes -
git addthe modified files - Commit with clear message - Explain what changed and why
- PUSH IMMEDIATELY -
git pushto keep remote repository up to date
โ NEVER leave changes uncommitted or unpushed!
- NEVER use foreign key constraints in the database schema
- Use
user_idfields for data ownership but WITHOUT foreign key relationships - When querying with joins, do NOT use Supabase's foreign key syntax - manually join data in application code
- This prevents cascading issues and keeps the database flexible
- Always test on both mobile and desktop - Check responsive design
- Run TypeScript checks -
npx tsc --noEmitbefore committing - Avoid over-engineering - Only implement what's requested
- Update documentation - Record significant changes in README.md
After ANY database migration (new tables, columns, etc.):
# 1. Apply migration
supabase db push
# 2. CRITICAL: Regenerate TypeScript types (use 2>&1 | grep -v to filter CLI messages)
supabase gen types typescript --project-id mcizaldoxrxgbpbbeytp 2>/dev/null | grep -v "^Initialising\|^A new version\|^We recommend" > frontend/src/types/database.ts
# 3. Verify types compile (catches CLI output accidentally captured in the file)
cd frontend && npx tsc --noEmit
# 4. Commit the updated types file
git add frontend/src/types/database.tsโ Vercel build WILL FAIL if types are not regenerated after schema changes!
ALWAYS run npx tsc --noEmit in the frontend directory before pushing:
cd frontend && npx tsc --noEmit- If TypeScript compilation fails, DO NOT push - fix the errors first
- This is especially critical for
src/types/database.tswhich is auto-generated - If the generated types file has errors, check for:
- CLI output text at the start (e.g., "Initialising login role...")
- Version update messages at the end (e.g., "A new version of Supabase CLI is available...")
- Remove any non-TypeScript text and regenerate if needed โ Pushing broken TypeScript files will cause Vercel builds to fail!
- 3-tier hierarchical goals: 3-year, 1-year, and 1-month goals
- Goals must be set on first login
- Edit goals anytime while maintaining original timeline
- Visual countdown showing time remaining
Daily Tasks:
- Recurring tasks with daily time targets (e.g., "Study - 60 min/day")
- Real-time progress calculation from pomodoro sessions
- Progress bars showing completion status
- Freshness cues: Task cards dim and show "Last worked" age when a task has been idle
- Automatic streak tracking with customizable day cut time
- Rest credits for maintaining flexibility
One-Time Tasks:
- Deadline-driven project tasks
- Estimated time/duration tracking
- Burn-down charts to visualize progress vs. deadline
- Archive completed tasks
- Link to daily tasks to share time tracking without double-counting statistics
- Priority badges use clear alert icons for fast scanning
- Choose duration: 15, 25, 45, 60 minutes (or custom)
- Real-time countdown timer with overtime tracking
- Overtime mode: Timer continues counting after reaching 0:00
- Pause tracking: Record multiple pause/resume cycles with timestamps
- Duration choice: Choose between original and extended time on completion
- Smart appearance: Orange theme when in overtime mode
- Focus rating (1-5 stars) after completion
- Accomplishment logging
- Real-time time tracking and statistics
- Streak tracking: Build and maintain daily completion streaks
- Rest credits: Banking system for missed days
- Time statistics: View Today, Week, and Total accumulated time
- Real-time status: Daily task "Done today" status calculated live from pomodoros
- Month navigation: Browse previous and future months
- Date-specific pomodoros: Click any date to view that day's completed pomodoros
- Monthly view of daily completions with color-coded status
- Visual streak display
- Rest credit management
- Make-up functionality for missed days
- React 19 with Vite - Fast, modern development
- TypeScript - Type safety
- TailwindCSS 4 - Utility-first styling
- React Router 7 - Client-side routing
- Zustand - Lightweight state management
- Framer Motion - Animations
- date-fns - Date manipulation
- Lucide React - Icon library
- Swift 5.9+ with SwiftUI - Native iOS development
- iOS 17.0+ target - Latest SwiftUI features
- Supabase Swift SDK - Shared backend with web app
- Combine - Reactive programming
- Feature parity with web app planned
- Supabase - PostgreSQL database + Authentication
- Row Level Security - Data isolation per user
- Automated user profile creation on signup
- Real-time data sync across web and iOS platforms
Level-Up/
โโโ frontend/ # React web application
โ โโโ src/
โ โ โโโ components/ # React components
โ โ โ โโโ battle/ # Pomodoro modal
โ โ โ โโโ calendar/ # Check-in calendar
โ โ โ โโโ dashboard/ # Dashboard widgets
โ โ โ โโโ goals/ # Goal setup forms
โ โ โ โโโ layout/ # Protected routes
โ โ โ โโโ tasks/ # Task cards & forms
โ โ โโโ hooks/ # Custom React hooks
โ โ โโโ lib/ # Supabase client
โ โ โโโ pages/ # Page components
โ โ โโโ store/ # Zustand stores
โ โ โโโ types/ # TypeScript types
โ โโโ package.json
โโโ database/ # Shared database schema
โ โโโ schema.sql # Complete DB setup
โโโ ios-app/ # iOS planning documents
โโโ SETUP.md # Legacy setup docs
โโโ README.md # Points to ~/code/revelation/
~/code/revelation/ # Native iOS application (NEW - separate location)
โโโ App/ # App entry point
โโโ Features/ # Feature modules (Auth, Goals, Tasks, etc.)
โ โโโ Auth/
โ โโโ Goals/
โ โโโ Tasks/
โ โโโ Dashboard/
โ โโโ Calendar/
โ โโโ Pomodoro/
โโโ Core/ # Shared utilities and services
โ โโโ Models/ # Swift data models
โ โโโ Services/ # Repositories and business logic
โ โโโ Supabase/ # Supabase client
โโโ UI/ # Reusable SwiftUI components
โโโ Resources/ # Assets, fonts, etc.
โโโ QUICKSTART.md # Step-by-step Xcode setup
โโโ SETUP.md # Detailed setup instructions
โโโ README.md # Project overview
โโโ IOS_CONVERSION_PLAN.md # Development roadmap
For Web App:
- Node.js >= 20.19.0
- npm >= 9.0.0
- Supabase account
For iOS App:
- macOS 14.0+
- Xcode 15.0+
- Active Apple Developer Account
- Same Supabase account (shared backend)
git clone <repository-url>
cd Level-Up- Create a new Supabase project at supabase.com
- Go to SQL Editor in your Supabase dashboard
- Run the entire
database/schema.sqlfile - Note your project URL and anon key (needed for both web and iOS)
cd frontend
npm installVercel Project URL: https://vercel.com/shawn-xiangs-projects/level-up/
Create frontend/.env.local:
VITE_SUPABASE_URL=your_supabase_project_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_keyRun development server:
npm run devVisit http://localhost:5173
Build for production:
npm run buildiOS source files are located at: ~/code/revelation/
See ~/code/revelation/QUICKSTART.md for step-by-step Xcode project creation.
Quick Start:
- Open Xcode and create a new iOS App project
- Save in existing
~/code/revelation/directory (files already there!) - Add existing Swift source files to Xcode project
- Add Supabase Swift SDK via Swift Package Manager
- Configure environment variables with your Supabase credentials
- Build and run on simulator or device
Documentation:
- Quick Start:
~/code/revelation/QUICKSTART.md - Detailed Setup:
~/code/revelation/SETUP.md - Project Overview:
~/code/revelation/README.md - Architecture Plan:
~/code/revelation/IOS_CONVERSION_PLAN.md
Note: Web and iOS apps share the same Supabase backend - data syncs in real-time across platforms!
- Sign up with email/password
- Set goals - Required: 3-year, 1-year, and 1-month goals
- Create tasks - Add daily recurring tasks and one-time project tasks
- Configure day cut - Set your preferred daily reset time and timezone
- Start working - Click "Start Pomodoro" on any task
- Complete session - Rate focus and log accomplishments
- Track progress - View real-time statistics and streaks
- View goals and tasks on main page
- Start Pomodoro sessions on tasks
- Complete daily task targets to maintain streak (resets at your custom day cut time)
- Check progress on burn-down charts for projects
- Monitor time statistics: Today, Week, and Total accumulated
- Review calendar to track consistency
- User authentication (Supabase Auth)
- Goal management (3-tier system)
- Task CRUD (daily and one-time)
- Pomodoro timer with focus tracking
- Overtime tracking system
- Pause period recording
- Smart time calculation: Different logic for natural vs manual completions
- Real-time daily task status calculation
- Customizable day cut time with timezone support
- Streak tracking with rest credits
- Check-in calendar with month navigation
- Date-specific pomodoro viewing
- Time statistics using actual duration (Today, Week, Total)
- Burn-down charts
- Task archiving
- Client-side prompt composition for Revelation/Next Move
- Mobile-responsive UI
- Icon-based buttons
Phase 1: Core Infrastructure (Completed)
- โ Project structure and Swift Package setup
- โ Supabase Swift SDK integration
- โ Data models matching database schema
- โ Repository layer for database operations
- โ Authentication views (Sign In / Sign Up)
Phase 2: Core Features (In Progress)
- โ Main tab navigation (Dashboard, Goals, Tasks, Calendar)
- โ Goals view with 3-tier system
- โ Tasks list and management (daily & one-time)
- โ Dashboard with statistics
- โ Calendar view with month navigation
- โ Basic Pomodoro timer (placeholder)
- โณ Full Pomodoro implementation (background execution, notifications)
- โณ Real-time data sync
- โณ Offline support
Phase 3: iOS-Specific Features (Planned)
- โณ Lock screen & home screen widgets
- โณ Live Activities for running Pomodoros
- โณ Local notifications
- โณ Siri shortcuts
- โณ Apple Watch companion app (future)
See IOS_CONVERSION_PLAN.md for complete iOS roadmap.
See future_features.md for comprehensive planned features:
- AI-powered Revelation continuity and overwhelm detection
- Internationalization (i18n) support
- Audio input/output with agent-based task manipulation
- Social features (user matching, messaging, templates)
- Normal calendar functionality
- Advanced calendar integration and MCP (Model Context Protocol)
New users automatically get a profile with default preferences.
- User profiles no longer store RPG level or stat attributes; prompts use raw data only.
Daily task "Done today" status is calculated in real-time from pomodoro sessions. No persistence needed - status reflects actual time logged since last day cut.
All data is isolated per user - you can only access your own tasks, goals, and progress.
Complete schema available in database/schema.sql, including:
user_profiles- User preferences and streak trackinggoals- 3-tier goal systemtasks- Daily and one-time taskstask_relationships- Links between one-time and daily taskspomodoros- Completed work sessions (source of truth for time tracking)active_pomodoros- Current running sessions
Note: Run database/cleanup-rewards-and-daily-completions.sql on existing databases to remove deprecated tables and columns.
This is a personal productivity app, but suggestions and feedback are welcome!
Private project - Not licensed for public use.
At its foundation, Revelation provides two fundamental things:
- Feedback - Tangible progress indicators, statistics, and validation of your efforts
- Meaning - A sense of purpose and significance in your daily actions
Rubric: Let users feel powerful and smart always.
While functionally an efficiency tool, Revelation transforms traditional productivity through a unique philosophy.
The AI-powered Revelation feature (future enhancement) is designed around four principles:
-
Provide Certainty
- Clear, confident recommendations instead of vague suggestions
- "Your next quest is..." not "You could consider..."
- Removes doubt about what to do next
-
Provide Emotional Value
- Recognizes effort, celebrates progress, acknowledges struggles
- Makes users feel seen and understood
- Warm, supportive tone that motivates
-
Reduce Decision Cost
- Eliminates choice paralysis with one clear path
- The mental load of "what should I do?" is lifted
- Mental energy saved for actual work
-
Provide Meaning - Re-enchant Life
- Tasks become quests, work becomes adventure
- Links daily actions to long-term dreams
- Makes mundane feel meaningful
- Personal Assistant: Helps schedule and prioritize existing tasks
- Personal Growth Coach: Aligns tasks with goals, suggests what matters
- Revelation (ๅคฉๅฏ): When you lack purpose, AI helps construct meaning and assigns tasks
This progression acknowledges that humans are "animals suspended in webs of self-woven meaning." When you can't weave your own, AI helps weave it for you.
Set Goals โ Complete Tasks โ Track Progress โ Maintain Streaks โ Achieve More
The app provides structure and motivation for productivity:
- Make task completion visible and measurable
- Visualize long-term progress with real-time statistics
- Encourage consistent daily habits with streak tracking
- Provide flexible goal setting with 3-tier timeline
- Balance work with rest (via rest credits and customizable day cut)
- Future: Progressively introduce AI assistance from assistant to revelation
This section contains additional technical details for specific scenarios.
- Avoid
.single()in Supabase queries - Use array accessdata?.[0]instead to prevent "excessively deep type instantiation" errors// โ Avoid - can cause TypeScript compilation errors const { data } = await supabase.from('table').select('*').single(); // โ Prefer - safer type instantiation const { data } = await supabase.from('table').select('*').limit(1); const record = data?.[0];
- Use direct type paths - Prefer
Database['public']['Tables']['table_name']['Row']overTables<'table_name'>helper - Test TypeScript compilation - Run
npx tsc --noEmitbefore committing to catch type errors early
- Update schema: Edit
database/schema.sql - Create migration:
supabase/migrations/YYYYMMDDHHmmss_description.sql# Generate timestamp and create migration file timestamp=$(date +"%Y%m%d%H%M%S") touch supabase/migrations/${timestamp}_your_migration_name.sql # Edit the file with your SQL changes
- Handle migration conflicts (if remote has migrations not in local):
# Check migration status supabase migration list --linked # If remote migrations are missing locally, create placeholder files # (Replace TIMESTAMP with the actual timestamp from the list) echo "-- Placeholder for remote migration" > supabase/migrations/TIMESTAMP_remote_migration.sql
- Deploy:
# Use auto-confirm to avoid interactive prompt echo "Y" | supabase db push --linked # Or manually confirm when prompted supabase db push --linked
โ ๏ธ CRITICAL - Update types (Vercel will fail without this):supabase gen types typescript --linked > frontend/src/types/database.ts cd frontend && npx tsc --noEmit # Verify no errors
- Commit changes:
git add supabase/migrations/ database/schema.sql frontend/src/types/database.ts git commit -m "Add database migration: [description]" git push
The native iOS app is in active development with core infrastructure and features implemented. The app shares the same Supabase backend as the web version, enabling seamless data sync across platforms.
- Native SwiftUI Interface: Modern, declarative UI matching iOS design patterns
- Shared Backend: Same Supabase database, authentication, and business logic
- Feature Modules: Clean architecture with separate modules for Auth, Goals, Tasks, Calendar, and Pomodoro
- Repository Pattern: Data access layer abstracting Supabase operations
- Real-Time Sync: Changes made on web instantly appear on iOS and vice versa
- Setup Guide: See
ios-app/SETUP.mdfor detailed Xcode setup instructions - Architecture Plan: See
IOS_CONVERSION_PLAN.mdfor complete development roadmap - Package Manager: Swift Package Manager for dependency management
- Complete Pomodoro timer with background execution and notifications
- Implement real-time Supabase subscriptions
- Add offline support with local caching
- Create iOS widgets (lock screen and home screen)
- Implement Live Activities for running Pomodoros
- Add Siri shortcuts integration
- Beta testing via TestFlight
- App Store submission
Note: Both web and iOS apps can be used interchangeably - user data stays perfectly in sync!
Built with โค๏ธ to make productivity feel like an adventure