Personalized workout plans, AI-generated exercise visuals, and voice-guided coaching — built solo as a full-stack AI integration project.
🔗 Live demo: https://ai-gym-two.vercel.app/gym
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 |
- 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)
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
git clone https://github.com/DevLifeOfficial/AI-Gym.git
cd AI-Gym
npm installCreate 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/gymBuild and deploy:
npm run build
vercel --prod| 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 |
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, ~8sEdit available fitness goals in UserForm.tsx:
const GOALS = ["Weight Loss", "Muscle Gain", "Fat Loss", "Strength"]- Persist generated plans (currently session-only)
- Progress tracking across multiple sessions
- Swap placeholder screenshots for real captures
Ram Kumar — Full-stack developer (React · TypeScript · Next.js · Supabase) GitHub: @DevLifeOfficial
MIT — free to use for portfolios or commercial projects.