Skip to content

Cozkou/ofit

Repository files navigation

ofit ๐Ÿ’ช

AI-Powered Fitness Transformation Visualization with Johnny Bravo Style

Transform your fitness journey with AI! ofit shows you what you could look like at different stages of your fitness transformation - from your current state to peak performance over 5 years.

๐ŸŒŸ What is ofit?

ofit is an interactive web app that uses AI to visualize your fitness transformation potential. Upload a photo or use your webcam, and instantly see yourself at different fitness levels. Get motivated with personalized workout plans, track your progress with XP and levels, and stay on track with helpful notifications.

๐ŸŽฏ Key Features

  • ๐ŸŽฅ Live Webcam Transformation: See yourself transform in real-time using your webcam
  • ๐Ÿ“ธ Photo Timeline: Upload a photo and explore 7 different transformation stages
  • ๐Ÿ’ช Personalized Workout Plans: Detailed gym routines for each fitness goal
  • ๐ŸŽฎ Gamification: Earn XP, level up, and track your progress
  • ๐Ÿ”” Smart Notifications: Stay motivated with reminders to hydrate, train, and rest
  • ๐Ÿฆธ Johnny Bravo Theme: Fun, motivational design inspired by the iconic cartoon

๐Ÿš€ Quick Start

Prerequisites

  • Node.js (v16 or higher)
  • npm or bun
  • Modern web browser with webcam support

Installation

  1. Clone the repository
git clone <your-repo-url>
cd ofit
  1. Install dependencies
npm install
  1. Set up environment variables Create a .env file with your Supabase credentials:
VITE_SUPABASE_URL=your-supabase-url
VITE_SUPABASE_ANON_KEY=your-supabase-key
  1. Start the development server
npm run dev
  1. Open in browser Navigate to http://localhost:5173

๐Ÿ“– How to Use

1. Get Started

  • Land on the homepage and hover over Johnny Bravo to see him flex
  • Click "START YOUR TRANSFORMATION" to begin

2. Set Your Goal

  • Enter your name and fitness goal
  • Set your commitment level
  • Upload a photo of yourself

3. Choose Your Path

  • Live Stream: Real-time transformation using your webcam
  • Photo Goals: See your transformation timeline with your uploaded photo

4. Explore Transformations

Live Webcam Mode

  • Adjust the intensity slider from "Lean" to "TREN" mode
  • See yourself transform in real-time as you move
  • Watch the "breaking scale" effect in TREN mode!

Photo Goals Mode

  • Use the vertical slider to navigate through 7 stages:
    • Extra Skinny
    • Skinny
    • Very Fat
    • Current (your starting point)
    • 6 Months
    • 1 Year
    • 5 Years (peak physique)
  • Click to flip between front and back views
  • View personalized workout plans for each stage
  • Check your commitment warnings and motivation

5. Track Progress

  • Earn XP for completing actions
  • Level up as you use the app
  • Check notifications for fitness reminders

๐Ÿ—๏ธ Project Structure

ofit/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”‚   โ”œโ”€โ”€ WebcamCapture.tsx           # Webcam capture component
โ”‚   โ”‚   โ”œโ”€โ”€ TransformationControls.tsx   # Intensity slider & controls
โ”‚   โ”‚   โ”œโ”€โ”€ OutputDisplay.tsx            # Stream display with Johnny Bravo loading
โ”‚   โ”‚   โ””โ”€โ”€ ui/                          # shadcn/ui components
โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”‚   โ”œโ”€โ”€ Landing.tsx                  # Homepage with Johnny Bravo
โ”‚   โ”‚   โ”œโ”€โ”€ Onboarding.tsx               # Goal setting & photo upload
โ”‚   โ”‚   โ”œโ”€โ”€ Dashboard.tsx                # Choose your path (notifications here)
โ”‚   โ”‚   โ”œโ”€โ”€ WebcamTransform.tsx          # Live webcam transformation
โ”‚   โ”‚   โ””โ”€โ”€ ImageTransform.tsx           # Photo timeline & workout plans
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ utils.ts                     # Utility functions
โ”‚   โ”‚   โ””โ”€โ”€ daydream.ts                  # Livepeer Daydream API integration
โ”‚   โ”œโ”€โ”€ integrations/
โ”‚   โ”‚   โ””โ”€โ”€ supabase/                    # Supabase client & types
โ”‚   โ””โ”€โ”€ hooks/                           # Custom React hooks
โ”œโ”€โ”€ supabase/
โ”‚   โ”œโ”€โ”€ functions/                       # Edge functions for AI processing
โ”‚   โ””โ”€โ”€ migrations/                      # Database migrations
โ”œโ”€โ”€ public/                              # Static assets (Johnny Bravo images)
โ””โ”€โ”€ package.json

๐ŸŽจ Tech Stack

Frontend

  • React 18 - UI framework
  • TypeScript - Type safety
  • Vite - Fast build tool
  • Tailwind CSS - Utility-first styling
  • shadcn/ui - Beautiful UI components

Backend & AI

  • Supabase - Backend as a service
  • Livepeer Daydream API - Real-time AI video transformation
  • Image Generation API - Photo transformation

Features

  • Gamification - XP system with localStorage
  • Notifications System - Smart reminders
  • Workout Plans - 7 detailed training programs
  • WebRTC - Real-time video streaming

๐ŸŽฎ Features Breakdown

๐ŸŽฅ Live Webcam Transformation

  • Real-time body transformation using AI
  • Adjustable intensity slider (Lean โ†’ Beast โ†’ Muscular โ†’ TREN)
  • TREN mode breaks the scale for extreme transformation
  • 20-second Johnny Bravo loading screen

๐Ÿ“ธ Photo Transformation Timeline

  • 7-stage transformation journey
  • Smooth crossfade transitions between stages
  • Flip to see front/back views
  • Auto-generates all transformations on upload
  • Preserves background, only transforms the body

๐Ÿ’ช Workout Plans

Click any training plan to see:

  • Daily exercise routines (sets, reps, rest)
  • Nutrition guidelines specific to your goal
  • Pro tips for consistency and recovery

Plans include:

  • Recovery & Rebuilding (Extra Skinny)
  • Building Foundation (Skinny)
  • Fat Loss Focus (Very Fat)
  • Maintenance Mode (Current)
  • 6-Month Transformation (4-5 days/week)
  • 1-Year Elite Training (5-6 days/week)
  • 5-Year Peak Performance (6-7 days/week)

๐ŸŽฎ Gamification

  • Earn XP for completing actions:
    • Complete onboarding: +30 XP
    • Upload photo: +25 XP
    • Generate transformation: +20 XP
    • Use webcam: +15 XP
    • Choose feature: +10 XP
  • Level up every 100 XP
  • Visual progress bar in header
  • Level badge with trophy icon

๐Ÿ”” Notifications

Smart reminders to keep you on track:

  • ๐Ÿ’ง Stay Hydrated - drink water reminders
  • ๐Ÿ‹๏ธ Gym Time - workout reminders
  • ๐Ÿ˜ด Rest Day - sleep reminders
  • ๐Ÿฑ Meal Prep - nutrition reminders
  • ๐Ÿ“Š Progress Check - tracking reminders

๐ŸŽจ Design System

Colors

  • Background: Deep dark (#000000)
  • Primary: Orange gradient
  • Accent: Warm amber/yellow
  • Text: Light gray to white

Typography

  • Huge titles: 7xl to 9xl font sizes
  • Gradient text: Animated color gradients
  • Glow effects: Blur shadows behind text

Johnny Bravo Theme

  • Character images for icons and buttons
  • Comic book style loading screens
  • Action lines and POW effects
  • Rotating logo animations

๐Ÿ“š What Do These Mean?

Technical Paper

A technical paper is a detailed document that explains:

  • How the technology works
  • Architecture and design decisions
  • Implementation details
  • Algorithms and methods used
  • Performance analysis

For this project, a technical paper would explain:

  • How the AI transformation works
  • How we integrate with Livepeer Daydream
  • Real-time video streaming architecture
  • Image processing pipeline
  • Gamification system design

Live Site

A live site is the deployed, publicly accessible version of the app that anyone can visit online. Instead of running the code on your local computer, it's hosted on a server and has a public URL (like ofit.com or ofit.vercel.app).

To create a live site, you would deploy this app to:

  • Vercel (recommended for React apps)
  • Netlify
  • AWS Amplify
  • GitHub Pages
  • Any other hosting platform

๐Ÿš€ Deployment

Deploy to Vercel (Recommended)

  1. Install Vercel CLI
npm i -g vercel
  1. Deploy
vercel
  1. Add environment variables in Vercel dashboard:
  • VITE_SUPABASE_URL
  • VITE_SUPABASE_ANON_KEY
  1. Visit your live site! Your app will be available at your-app.vercel.app

๐Ÿค Contributing

Contributions are welcome! Here's how:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ› Troubleshooting

Webcam not working

  • Check browser permissions for camera access
  • Ensure you're using HTTPS or localhost
  • Try a different browser

Images not generating

  • Check Supabase connection
  • Verify API keys in .env
  • Check browser console for errors

XP not saving

  • Check localStorage is enabled
  • Clear browser cache and try again

๐Ÿ“ License

MIT License - feel free to use this project for learning or building your own fitness app!


๐Ÿ™ Acknowledgments

  • Livepeer for the Daydream API
  • Supabase for backend infrastructure
  • shadcn/ui for beautiful components
  • Johnny Bravo for the inspiration and motivation ๐Ÿ’ช

๐Ÿ“ง Contact & Support

Questions? Found a bug? Want to contribute?

  • Open an issue on GitHub
  • Submit a pull request
  • Star the repo if you found it helpful!

Built for Encode Club Hackathon 2025 ๐Ÿ†

Transform your body, visualize your goals, and become the best version of yourself with ofit! ๐Ÿ’ช


๐ŸŽฏ Quick Links

  • Live Site: [Your deployed URL here]
  • Technical Paper: [Your technical documentation here]
  • Demo Video: [Your demo video here]
  • Presentation: [Your presentation slides here]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages