- π Tech stack: Next.js, React, Tailwind & Shadcn UI
- ποΈ Voice AI Assistant (Vapi)
- π§ LLM Integration (Gemini AI)
- ποΈ Personalized Workout Plans
- π₯ Custom Diet Programs
- π Authentication & Authorization (Clerk)
- πΎ Database (Convex)
- π¬ Real-time Program Generation
- π» Layouts
- π Client & Server Components
- Smart AI Assistant: Engage in conversation with an AI that asks about your fitness goals, physical condition, and preferences
- Personalized Workout Plans: Get custom exercise routines based on your fitness level, injuries, and goals
- Diet Recommendations: Receive personalized meal plans accounting for your allergies and dietary preferences
- User Authentication: Sign in with GitHub, Google, or email/password
- Program Management: Create and view multiple fitness programs with only the latest one active
- Responsive Design: Beautiful UI that works across all devices
npm run dev- Start Next.js development servernpm run build- Build the application for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run convex:dev- Start Convex development mode (watches for changes)npm run convex:deploy- Deploy Convex functions to developmentnpm run convex:deploy:prod- Deploy Convex functions to production
-
Clone the repository
git clone <repository-url> cd ai-fitness-trainer
-
Install dependencies
npm install
-
Set up Convex (Database)
Important: Convex setup is required before running the app!
# Install Convex CLI (if not already installed) npm install -g convex # Login to Convex npx convex login # Initialize and deploy Convex backend npx convex dev
This will:
- Create a new Convex project
- Generate your deployment URL
- Create a
.env.localfile withNEXT_PUBLIC_CONVEX_URL
For detailed Convex setup instructions, see SETUP.md
-
Set up your environment variables
Create a
.env.localfile in the root directory with the following variables:# Convex Database (auto-generated by `npx convex dev`) CONVEX_DEPLOYMENT=your-deployment-name NEXT_PUBLIC_CONVEX_URL=https://your-deployment.convex.cloud # Clerk Authentication NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_test_... CLERK_SECRET_KEY=sk_test_... # Clerk Redirect URLs NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up # Clerk Webhook Secret (for Convex HTTP endpoint) CLERK_WEBHOOK_SECRET=whsec_... # Gemini AI (for Convex HTTP endpoint) # Also set in Convex: npx convex env set GEMINI_API_KEY your-key GEMINI_API_KEY=your-gemini-api-key # Vapi Voice AI NEXT_PUBLIC_VAPI_WORKFLOW_ID=your-workflow-id NEXT_PUBLIC_VAPI_API_KEY=your-vapi-api-key
-
Update Convex configuration
- Create JWT Template in Clerk (REQUIRED):
- Go to Clerk Dashboard β Configure β JWT Templates
- Create a new template with name exactly
convex(lowercase) - This fixes the "No JWT template exists with name: convex" error
- Update
convex/auth.config.tswith your Clerk domain (see SETUP.md for details) - Set Convex environment variables:
npx convex env set GEMINI_API_KEY your-gemini-api-key npx convex env set CLERK_WEBHOOK_SECRET your-clerk-webhook-secret
- Create JWT Template in Clerk (REQUIRED):
-
Run the development server
npm run dev
-
Open http://localhost:3000 in your browser
For detailed setup instructions, especially for Convex configuration, see SETUP.md.
This application can be easily deployed to Vercel:
npm run build
npm run startOr connect your GitHub repository to Vercel for automatic deployments.
- Next.js: React framework for building the frontend and API routes
- Tailwind CSS & Shadcn UI: For styling and UI components
- Clerk: Authentication and user management
- Vapi: Voice agent platform for conversational AI
- Convex: Real-time database
- Gemini AI: Large Language Model for generating personalized fitness programs
To learn more about the technologies used in this project:
