Skip to content
DevLifeOfficialPublic

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

🏋️ AI Gym — Your Personal AI Fitness Coach

Personalized workout plans, AI-generated exercise visuals, and voice-guided coaching — built solo as a full-stack AI integration project.

Next.js TypeScript Tailwind OpenAI

🔗 Live demo: https://ai-gym-two.vercel.app/gym


What it does

AI Gym takes a few inputs about your goals and generates a complete, personalized fitness plan — then brings it to life with AI-generated visuals and spoken coaching, instead of just handing back a wall of text.

Feature Status Details
🧠 AI Workout Plans ✅ GPT-4o generates a full weekly schedule based on your goals
🥗 Custom Diet Plans ✅ Macro-optimized meal plans tailored to the same inputs
🖼️ AI-Generated Visuals ✅ Fal.ai Flux.1 renders exercise/meal images on the fly
🎤 Voice Coaching ✅ ElevenLabs (+ browser TTS fallback) narrates your plan
🌓 Dark / Light Mode ✅ Full theme switching
📱 Mobile Responsive ✅ Tested across breakpoints
🖨️ PDF Export ✅ Print-ready plan output
⚡ Performance ✅ Edge-optimized API routes on Vercel

Tech Stack

  • Frontend: Next.js 15 (App Router), TypeScript, Tailwind CSS, shadcn/ui
  • AI: OpenAI GPT-4o (plan generation) · Fal.ai Flux.1 (images) · ElevenLabs (voice)
  • State: Zustand
  • Deployment: Vercel (Edge Runtime)

Project Structure

ai-gym/
├── app/
│   ├── gym/page.tsx        # Main app — form + generated plan
│   ├── about/page.tsx      # Portfolio / tech stack page
│   └── api/image/route.ts  # Fal.ai image generation endpoint
├── components/
│   ├── Navbar.tsx           # Theme toggle + navigation
│   ├── UserForm.tsx         # Multi-step fitness intake form
│   └── PlanDisplay.tsx      # Workout/diet tabs + AI images
├── hooks/
│   └── useImageGeneration.ts
├── lib/
│   ├── store/fitnessStore.ts  # Zustand state
│   └── voices/ttsClient.ts    # ElevenLabs TTS client
└── README.md

Getting Started

git clone https://github.com/DevLifeOfficial/AI-Gym.git
cd AI-Gym
npm install

Create a .env.local file:

NEXT_PUBLIC_OPENAI_API_KEY=sk-...
FAL_AI_KEY=flm-...
NEXT_PUBLIC_ELEVENLABS_API_KEY=...    
REPLICATE_API_TOKEN=r8_...              

Run it locally:

npm run dev
# open http://localhost:3000/gym

Build and deploy:

npm run build
vercel --prod

API Keys — Free Tier Notes

Service Free tier Get a key
OpenAI $5 trial credit platform.openai.com
Fal.ai Generous free tier fal.ai → Dashboard → API Key
ElevenLabs 10k characters/month elevenlabs.io

Customization

Swap the image model speed/quality tradeoff in app/api/image/route.ts:

'https://fal.run/fal-ai/flux/schnell'  // fast, ~4s
'https://fal.run/fal-ai/flux/dev'      // higher quality, ~8s

Edit available fitness goals in UserForm.tsx:

const GOALS = ["Weight Loss", "Muscle Gain", "Fat Loss", "Strength"]

Roadmap

  • Persist generated plans (currently session-only)
  • Progress tracking across multiple sessions
  • Swap placeholder screenshots for real captures

Author

Ram Kumar — Full-stack developer (React · TypeScript · Next.js · Supabase) GitHub: @DevLifeOfficial

License

MIT — free to use for portfolios or commercial projects.

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages