A gamified productivity app where users upload iPhone Screen Time screenshots daily to track and improve their app usage habits. Users earn points based on their app usage patterns, maintain streaks, compete on leaderboards, and unlock emojis with coins.
- 🔐 Email/password authentication with Supabase
- 📸 Daily screenshot upload (mandatory once per day)
- 🤖 OpenAI-powered image analysis (GPT-4o)
- 🏆 Scoring system (0-10000 points) based on app usage patterns
- 🔥 Streak tracking (consecutive daily uploads)
- 📊 Weekly points graph visualization
- 🏅 Leaderboards (Overall, Weekly, Today)
- 🪙 Coins system (earned as 10% of points, rounded up)
- 🛍️ Emoji Store (purchase emojis with coins)
- ✨ Custom emojis displayed in leaderboard
- 🌙 Dark mode with purple-to-blue gradient theme
npm install- Create a Supabase project at supabase.com
- Run the migration scripts in order:
- Go to SQL Editor in your Supabase dashboard
- Run
migrations/001_initial_schema.sql(creates users and submissions tables) - Run
migrations/003_add_coins_and_emoji.sql(adds coins and selected_emoji columns) - Run
migrations/004_add_user_emojis_table.sql(creates user_emojis table for owned emojis)
See migrations/README.md for detailed migration instructions.
Note: Images are sent directly to OpenAI for analysis and are not stored, so no storage bucket is needed.
Create a .env.local file in the root directory:
NEXT_PUBLIC_SUPABASE_URL=your_supabase_project_url
NEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key
OPENAI_API_KEY=your_openai_api_key
NEXT_PUBLIC_SITE_URL=http://localhost:3000npm run devOpen http://localhost:3000 with your browser.
- Landing Page (
/) - Welcome page with app information and navigation to sign in/sign up - Sign In (
/auth/signin) - User authentication - Sign Up (
/auth/signup) - Create new account - Dashboard (
/dashboard) - Main app interface with three tabs:- Me: Personal stats (points, coins, streak, today's score), weekly points graph
- Leaderboard: Rankings (Overall, Weekly, Today) with user emojis
- Store: Purchase emojis with coins, select/unselect owned emojis
- Next.js 14 (App Router)
- TypeScript
- Tailwind CSS
- Supabase (Database & Authentication)
- OpenAI API (Image Analysis)
- React 18
- Daily Upload: Users must upload a screenshot of their iPhone Screen Time screen once per day
- AI Analysis: OpenAI GPT-4o analyzes the screenshot to:
- Categorize apps as "good", "bad", or "neutral"
- Calculate a score (0-10000) based on:
- Reduced usage of "bad" apps (social media, entertainment, etc.)
- Overall reduced screen time
- Balanced usage patterns
- Scoring & Rewards:
- Points (0-10000): Added to total points
- Coins: Earned as 10% of points (rounded up), used to purchase emojis
- Streak: Increments if uploaded yesterday, resets to 0 otherwise
- Leaderboards: Users compete on Overall, Weekly, and Today leaderboards
- Emoji Store: Users can purchase emojis with coins and select one to display next to their name in leaderboards
See migrations/ directory for all migration scripts.
-
users:
id(UUID, primary key)email(TEXT)points(INTEGER) - Total points earnedcoins(INTEGER) - Currency for purchasing emojisstreak(INTEGER) - Consecutive daily uploadslast_upload_date(DATE) - Last upload date for streak calculationselected_emoji(TEXT, nullable) - Currently selected emoji for leaderboardcreated_at,updated_at(TIMESTAMP)
-
submissions:
id(UUID, primary key)user_id(UUID, foreign key to users)image_url(TEXT) - Empty string (images not stored)score(INTEGER) - Score from 0-10000date(DATE) - Submission datecreated_at(TIMESTAMP)
-
user_emojis:
id(UUID, primary key)user_id(UUID, foreign key to users)emoji(TEXT) - Emoji characterpurchased_at(TIMESTAMP)- Unique constraint on (user_id, emoji)
- Row Level Security (RLS): Enabled on all tables for data protection
- Automatic User Creation: Trigger creates user profile on signup
- Streak Calculation: Function calculates streak based on consecutive uploads