Skip to content

Repository files navigation

ELITE Gym & Fitness

TypeScript Next.js Convex Stripe Clerk Vapi

πŸ‡±πŸ‡° Sri Lanka's Premier AI-Powered Digital Fitness Management Platform

Live Demo

Features β€’ Tech Stack β€’ Installation β€’ Usage β€’ Architecture


Overview

ELITE Gym & Fitness is a cutting-edge, full-stack fitness management platform engineered specifically for the Sri Lankan fitness industry. Combining the power of modern web technologies with AI-driven personalization, this platform delivers an all-in-one solution for gym members, personal trainers, and facility administrators.

Built with Next.js 15, Convex real-time database, Stripe payment processing, Clerk authentication, and Vapi voice AI for conversational program generation, ELITE transforms how fitness businesses operate and how members achieve their health goals.

Features

AI-Powered Fitness Program Generator

  • Voice-Enabled Consultation - Interactive voice conversations with Vapi AI to create personalized plans
  • Conversational Input - Natural dialogue to gather fitness goals, limitations, and preferences
  • Smart Workout Plans - Customized training programs generated by Google Gemini AI
  • Personalized Diet Plans - Nutrition recommendations tailored to individual goals
  • Real-Time Transcripts - Live display of conversation during AI consultation
  • Seamless Experience - Voice consultation automatically redirects to profile with generated plans

Comprehensive Membership Management

  • Flexible Membership Tiers - Basic, Premium, and Elite packages
  • Automated Renewals - Stripe-powered subscription management
  • Member Dashboards - Track workouts, attendance, and progress
  • QR Code Check-ins - Contactless gym access (planned)
  • Membership History - Complete transaction and usage records

Professional Trainer Booking System

  • Trainer Profiles - Detailed bios, specializations, and certifications
  • Real-Time Availability - Live scheduling and booking calendar
  • Session Management - Track past and upcoming training sessions
  • Trainer Applications - Apply to become a trainer with admin approval
  • Salary Management - Admin dashboard for trainer compensation
  • Booking Payments - Stripe integration for session payments

E-Commerce Marketplace

  • Product Catalog - Supplements, equipment, apparel, and accessories
  • Shopping Cart - Add multiple items and manage quantities
  • Secure Checkout - Stripe-integrated payment processing
  • Inventory Management - Admin control of stock levels
  • Order History - Complete purchase records in user profile
  • Product Reviews - Community-driven ratings and feedback

Payment Integration

  • Local Currency Support - Optimized for Sri Lankan Rupees (LKR)
  • Multiple Payment Gateways - Stripe for cards and digital wallets
  • Subscription Billing - Automated recurring membership payments
  • One-Time Payments - Trainer bookings and product purchases
  • Webhook Integration - Real-time payment status updates
  • Payment Slips - Track all transaction history

Advanced Authentication & Authorization

  • Secure Login - Clerk-powered authentication
  • Role-Based Access Control - Separate permissions for users, trainers, and admins
  • Social Login - Google and email authentication
  • Session Management - Secure token-based sessions
  • Protected Routes - Middleware-based route protection

Admin Dashboard

  • User Management - CRUD operations for all user accounts
  • Membership Analytics - Track active subscriptions and revenue
  • Trainer Administration - Approve applications and manage trainers
  • Inventory Control - Manage products, stock, and pricing
  • Blog Management - Create and manage fitness content
  • Recipe Database - Add and manage healthy recipes
  • Salary Management - Track and manage trainer payments
  • System Configuration - Platform settings and customization

Mobile-First Design

  • Responsive UI - Optimized for all screen sizes
  • Dark/Light Mode - Theme toggle with next-themes
  • Touch-Friendly Interface - Intuitive mobile interactions
  • Fast Loading - Turbopack for rapid development
  • Modern Components - shadcn/ui component library

Localization

  • Sri Lankan Focus - Currency (LKR), language, and cultural considerations
  • Time Zone Support - Accurate scheduling for local time (Asia/Colombo)
  • Local Payment Methods - Stripe configured for Sri Lankan market

Tech Stack

Frontend Architecture

Technology Purpose Version
Next.js React framework with App Router and Server Components 15.2
TypeScript Type-safe development 5.0+
React UI component library 19.0
TailwindCSS Utility-first CSS framework 4.0
shadcn/ui Beautiful, accessible UI components Latest
next-themes Dark/Light mode theming Latest
Lucide React Modern icon library Latest
Leaflet Interactive maps for gym locations 1.9

Backend & Database

Technology Purpose
Convex Real-time backend-as-a-service with TypeScript
Convex HTTP API routes and webhook handlers
Convex Functions Queries, mutations, and actions

Authentication & Authorization

Technology Purpose
Clerk Complete user authentication and management
Clerk Middleware Route protection and session handling
Role-Based Access Admin, Trainer, and User roles

Payment Processing

Technology Purpose
Stripe Payment gateway for memberships, bookings, and products
Stripe Checkout Secure hosted payment pages
Stripe Webhooks Real-time payment event handling
Subscription Management Recurring membership billing

AI & Voice Integration

Technology Purpose
Vapi Voice AI for conversational fitness program generation
Google Gemini AI Workout and diet plan generation (Gemini 2.5 Flash)
Speech Recognition Real-time voice transcription during consultation
Natural Language Processing Understanding user fitness goals and preferences
Workflow Integration Vapi workflows with custom variable passing

Development Tools

Technology Purpose
Turbopack Next-gen bundler for faster development
ESLint Code linting and quality control
Git Version control

Deployment & Infrastructure

Technology Purpose
Vercel Hosting and deployment
Edge Functions Global CDN and low latency
Serverless Architecture Scalable infrastructure

System Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       NEXT.JS 15 FRONTEND                       β”‚
β”‚                     (App Router + React 19)                     β”‚
β”‚                                                                 β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   User      β”‚  β”‚   Trainer    β”‚  β”‚   Admin            β”‚   β”‚
β”‚  β”‚   Portal    β”‚  β”‚   Dashboard  β”‚  β”‚   Dashboard        β”‚   β”‚
β”‚  β”‚             β”‚  β”‚              β”‚  β”‚                    β”‚   β”‚
β”‚  β”‚ - Profile   β”‚  β”‚ - Sessions   β”‚  β”‚ - User Mgmt       β”‚   β”‚
β”‚  β”‚ - Plans     β”‚  β”‚ - Schedule   β”‚  β”‚ - Memberships     β”‚   β”‚
β”‚  β”‚ - Orders    β”‚  β”‚ - Earnings   β”‚  β”‚ - Inventory       β”‚   β”‚
β”‚  β”‚ - Bookings  β”‚  β”‚              β”‚  β”‚ - Blog/Recipes    β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚         β”‚                β”‚                     β”‚               β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β”‚
β”‚                          β”‚                                     β”‚
β”‚                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”                           β”‚
β”‚                 β”‚  Clerk Auth     β”‚                           β”‚
β”‚                 β”‚  Middleware     β”‚                           β”‚
β”‚                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜                           β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                           β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                    CONVEX BACKEND LAYER                        β”‚
β”‚                                                                β”‚
β”‚  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   β”‚
β”‚  β”‚   Queries     β”‚  β”‚  Mutations  β”‚  β”‚    Actions       β”‚   β”‚
β”‚  β”‚ (Read Data)   β”‚  β”‚ (Write Data)β”‚  β”‚ (External APIs)  β”‚   β”‚
β”‚  β”‚               β”‚  β”‚             β”‚  β”‚                  β”‚   β”‚
β”‚  β”‚ - Users       β”‚  β”‚ - Create    β”‚  β”‚ - Stripe         β”‚   β”‚
β”‚  β”‚ - Plans       β”‚  β”‚ - Update    β”‚  β”‚ - Webhooks       β”‚   β”‚
β”‚  β”‚ - Products    β”‚  β”‚ - Delete    β”‚  β”‚ - Email          β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β”‚         β”‚                 β”‚                    β”‚              β”‚
β”‚         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜              β”‚
β”‚                           β”‚                                   β”‚
β”‚                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”                         β”‚
β”‚                  β”‚  Convex RT DB   β”‚                         β”‚
β”‚                  β”‚  - users        β”‚                         β”‚
β”‚                  β”‚  - memberships  β”‚                         β”‚
β”‚                  β”‚  - bookings     β”‚                         β”‚
β”‚                  β”‚  - products     β”‚                         β”‚
β”‚                  β”‚  - trainers     β”‚                         β”‚
β”‚                  β”‚  - fitnessPlans β”‚                         β”‚
β”‚                  β”‚  - dietPlans    β”‚                         β”‚
β”‚                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                         β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
        β”‚                 β”‚                 β”‚       β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”  β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β” β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
β”‚   Stripe     β”‚  β”‚  Google       β”‚  β”‚  Clerk    β”‚ β”‚   Vapi      β”‚
β”‚   Payment    β”‚  β”‚  Gemini AI    β”‚  β”‚  Auth     β”‚ β”‚  Voice AI   β”‚
β”‚   Gateway    β”‚  β”‚  (v2.5)       β”‚  β”‚  Service  β”‚ β”‚   Agent     β”‚
β”‚              β”‚  β”‚               β”‚  β”‚           β”‚ β”‚             β”‚
β”‚ - Checkout   β”‚  β”‚ - Workout Gen β”‚  β”‚ - Users   β”‚ β”‚ - Voice Callβ”‚
β”‚ - Webhooks   β”‚  β”‚ - Diet Gen    β”‚  β”‚ - Sessionsβ”‚ β”‚ - Workflow  β”‚
β”‚ - Subs       β”‚  β”‚               β”‚  β”‚ - Roles   β”‚ β”‚ - Variables β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Installation

Prerequisites

  • Node.js 18.x or higher
  • npm or yarn or pnpm
  • Git
  • Convex Account (Sign up)
  • Stripe Account (Sign up)
  • Clerk Account (Sign up)
  • Google Gemini API Key (Get key)
  • Vapi Account (Sign up)

Step-by-Step Setup

  1. Clone the repository
git clone https://github.com/PasinduSuraweera/ELITE-Gym-and-Fitness.git
cd ELITE-Gym-and-Fitness
  1. Install dependencies
npm install
# or
yarn install
# or
pnpm install
  1. Set up environment variables

Create a .env.local file in the root directory:

# Convex
CONVEX_DEPLOYMENT=your_convex_deployment_url
NEXT_PUBLIC_CONVEX_URL=your_convex_public_url

# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key
CLERK_SECRET_KEY=your_clerk_secret_key
NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in
NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up

# Stripe
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=your_stripe_publishable_key
STRIPE_SECRET_KEY=your_stripe_secret_key
STRIPE_WEBHOOK_SECRET=your_stripe_webhook_secret

# Google Gemini AI
GEMINI_API_KEY=your_gemini_api_key

# Vapi Voice AI (for AI Program Generator)
NEXT_PUBLIC_VAPI_API_KEY=your_vapi_public_key
NEXT_PUBLIC_VAPI_WORKFLOW_ID=your_vapi_workflow_id

# Optional: Chatbase
NEXT_PUBLIC_CHATBASE_ID=your_chatbase_id
  1. Set up Convex
npx convex dev

This will:

  • Initialize your Convex project
  • Set up the database schema
  • Deploy functions to development
  1. Configure Vapi Workflow
# In your Vapi dashboard:
1. Create a new workflow
2. Configure workflow to call your Convex HTTP endpoint
3. Set up function calling for fitness plan generation
4. Configure variables: full_name, user_id
5. Test voice interactions
  1. Set up Stripe webhooks (for local development)
stripe listen --forward-to localhost:3000/api/webhooks/stripe
  1. Run the development server
npm run dev
# or
yarn dev
# or
pnpm dev
  1. Access the application
http://localhost:3000

Project Structure

ELITE-Gym-and-Fitness/
β”‚
β”œβ”€β”€ convex/                         # Convex backend
β”‚   β”œβ”€β”€ schema.ts                  # Database schema definitions
β”‚   β”œβ”€β”€ http.ts                    # HTTP routes & Vapi webhook handler
β”‚   β”œβ”€β”€ users.ts                   # User queries/mutations
β”‚   β”œβ”€β”€ memberships.ts             # Membership management
β”‚   β”œβ”€β”€ bookings.ts                # Trainer booking system
β”‚   β”œβ”€β”€ products.ts                # Marketplace products
β”‚   β”œβ”€β”€ trainers.ts                # Trainer management
β”‚   β”œβ”€β”€ fitnessPlans.ts            # Workout plans
β”‚   β”œβ”€β”€ dietPlans.ts               # Diet plans
β”‚   └── payments.ts                # Payment processing
β”‚
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ app/                       # Next.js 15 App Router
β”‚   β”‚   β”œβ”€β”€ (auth)/               # Authentication routes
β”‚   β”‚   β”‚   β”œβ”€β”€ sign-in/
β”‚   β”‚   β”‚   └── sign-up/
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ admin/                # Admin dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx          # Admin home
β”‚   β”‚   β”‚   β”œβ”€β”€ users/            # User management
β”‚   β”‚   β”‚   β”œβ”€β”€ memberships/      # Membership control
β”‚   β”‚   β”‚   β”œβ”€β”€ inventory/        # Product inventory
β”‚   β”‚   β”‚   β”œβ”€β”€ blog/             # Blog management
β”‚   β”‚   β”‚   β”œβ”€β”€ recipes/          # Recipe management
β”‚   β”‚   β”‚   β”œβ”€β”€ salary/           # Trainer salary
β”‚   β”‚   β”‚   └── trainer-applications/
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ api/                  # API routes
β”‚   β”‚   β”‚   β”œβ”€β”€ create-checkout-session/
β”‚   β”‚   β”‚   β”œβ”€β”€ create-marketplace-checkout/
β”‚   β”‚   β”‚   β”œβ”€β”€ create-booking-checkout/
β”‚   β”‚   β”‚   └── webhooks/
β”‚   β”‚   β”‚       └── stripe/
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ generate-program/     # πŸŽ™οΈ Voice AI program generator
β”‚   β”‚   β”‚   └── page.tsx          # Vapi voice consultation page
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ profile/              # User dashboard
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx          # Profile overview
β”‚   β”‚   β”‚   β”œβ”€β”€ fitness-plans/    # View workout plans
β”‚   β”‚   β”‚   β”œβ”€β”€ diet-plans/       # View diet plans
β”‚   β”‚   β”‚   β”œβ”€β”€ training-sessions/
β”‚   β”‚   β”‚   β”œβ”€β”€ orders/
β”‚   β”‚   β”‚   β”œβ”€β”€ payment-slips/
β”‚   β”‚   β”‚   └── settings/
β”‚   β”‚   β”‚
β”‚   β”‚   β”œβ”€β”€ membership/           # Membership purchase
β”‚   β”‚   β”œβ”€β”€ trainer-booking/      # Book training sessions
β”‚   β”‚   β”œβ”€β”€ become-trainer/       # Trainer application
β”‚   β”‚   β”œβ”€β”€ marketplace/          # E-commerce
β”‚   β”‚   β”‚   β”œβ”€β”€ page.tsx
β”‚   β”‚   β”‚   β”œβ”€β”€ cart/
β”‚   β”‚   β”‚   └── checkout/
β”‚   β”‚   β”œβ”€β”€ blog/                 # Fitness blog
β”‚   β”‚   β”œβ”€β”€ recipes/              # Recipe database
β”‚   β”‚   β”œβ”€β”€ reviews/              # Product reviews
β”‚   β”‚   β”œβ”€β”€ about/
β”‚   β”‚   β”œβ”€β”€ contact/
β”‚   β”‚   β”œβ”€β”€ help/
β”‚   β”‚   β”œβ”€β”€ privacy/
β”‚   β”‚   └── terms/
β”‚   β”‚
β”‚   β”œβ”€β”€ components/               # React components
β”‚   β”‚   β”œβ”€β”€ ui/                  # shadcn/ui components
β”‚   β”‚   β”œβ”€β”€ Navbar.tsx           # Navigation
β”‚   β”‚   β”œβ”€β”€ Footer.tsx
β”‚   β”‚   β”œβ”€β”€ AdminLayout.tsx      # Admin dashboard layout
β”‚   β”‚   β”œβ”€β”€ UserLayout.tsx       # User dashboard layout
β”‚   β”‚   β”œβ”€β”€ RoleGuard.tsx        # Authorization
β”‚   β”‚   β”œβ”€β”€ ThemeToggle.tsx      # Dark/Light mode
β”‚   β”‚   β”œβ”€β”€ NoFitnessPlan.tsx    # Empty state component
β”‚   β”‚   └── UserPrograms.tsx     # Display user programs
β”‚   β”‚
β”‚   β”œβ”€β”€ lib/                     # Utility functions
β”‚   β”‚   β”œβ”€β”€ utils.ts
β”‚   β”‚   β”œβ”€β”€ membership-utils.ts
β”‚   β”‚   └── vapi.ts              # πŸŽ™οΈ Vapi SDK initialization
β”‚   β”‚
β”‚   β”œβ”€β”€ providers/               # Context providers
β”‚   β”‚   └── ConvexClerkProvider.tsx
β”‚   β”‚
β”‚   └── middleware.ts            # Clerk auth middleware
β”‚
β”œβ”€β”€ public/                       # Static assets
β”‚   β”œβ”€β”€ logo.png
β”‚   β”œβ”€β”€ logo2.png
β”‚   └── hero-ai.png
β”‚
β”œβ”€β”€ .env.local                    # Environment variables
β”œβ”€β”€ next.config.js
β”œβ”€β”€ tailwind.config.ts
β”œβ”€β”€ tsconfig.json
└── package.json

Usage

For Gym Members

  1. Sign Up & Profile Setup

    • Create account via Clerk authentication
    • Complete profile information
    • Choose membership tier
  2. Generate AI Fitness Plan πŸŽ™οΈ

    • Navigate to "AI Plan Generator" page
    • Click "Start Voice Consultation"
    • Have a natural conversation with Vapi AI:
      • State your age, height, weight
      • Mention any injuries or limitations
      • Specify available workout days
      • Describe your fitness goals
      • Indicate fitness level
      • Share dietary restrictions
    • View real-time transcript of conversation
    • AI generates personalized workout and diet plans
    • Automatically redirected to profile with saved plans
  3. View Your Plans

    • Access Workout Plans in profile sidebar
    • Access Diet Plans in profile sidebar
    • Download plans for offline reference
    • Track your progress
  4. Book Training Sessions

    • Browse available trainers
    • Check schedules and specializations
    • Book sessions via Stripe checkout
    • View bookings in profile
  5. Shop Products

    • Browse marketplace
    • Add to cart
    • Secure Stripe checkout
    • Track orders in profile

For Trainers

  1. Apply to Become Trainer

    • Submit application via "Become Trainer" page
    • Wait for admin approval
    • Set up trainer profile
  2. Manage Schedule

    • View upcoming sessions
    • Track earnings in dashboard
    • Manage availability
  3. Track Clients

    • View assigned clients
    • Access session history

For Administrators

  1. Dashboard Overview

    • Monitor platform metrics
    • View user statistics
    • Track revenue
  2. User Management

    • View all users
    • Manage memberships
    • Handle support requests
  3. Trainer Administration

    • Review trainer applications
    • Approve or reject applications
    • Manage trainer salaries
  4. Content Management

    • Create blog posts
    • Add recipes
    • Manage product inventory
  5. System Configuration

    • Configure membership tiers
    • Set pricing
    • Manage platform settings

Voice AI Program Generator Details

How It Works

The /generate-program page uses Vapi for voice-based fitness plan generation:

  1. Voice Call Initiation

    • User clicks "Start Consultation" button
    • Vapi initializes voice call with workflow
    • Custom variables passed: full_name, user_id
  2. Conversational Data Collection

    • Vapi AI asks questions naturally
    • User responds via voice
    • Real-time transcript displayed on screen
    • Visual indicators show AI speaking state
  3. Backend Processing

    • Vapi workflow calls Convex HTTP endpoint /vapi/generate-program
    • Payload includes user responses
    • Google Gemini AI generates workout and diet plans
    • Plans saved to Convex database
  4. Completion & Redirect

    • Voice call ends
    • Success message displayed
    • Auto-redirect to profile page (1.5s delay)
    • Plans immediately available in profile

Voice AI Features

// Vapi Event Listeners
- call-start: Voice call begins
- call-end: Voice call completed
- speech-start: AI starts speaking
- speech-end: AI stops speaking
- message: Real-time transcripts
- error: Error handling

Key Features in Detail

Membership Tiers

Basic - Entry-level access Premium - Enhanced features Elite - Complete access with all benefits

(Configure pricing via Stripe products and Convex database)

Booking System

  • Real-time availability checking
  • Stripe integration for payments
  • Automated booking confirmations
  • Calendar management

E-Commerce

  • Full shopping cart functionality
  • Secure Stripe checkout
  • Order tracking
  • Admin inventory control

Security Features

  • Clerk Authentication - Enterprise-grade security
  • Role-Based Access Control - Admin, Trainer, User roles
  • Stripe PCI Compliance - Secure payment handling
  • Protected Routes - Middleware-based authorization
  • HTTPS Encryption - All data encrypted in transit
  • Environment Variables - Sensitive data protection
  • Webhook Verification - Stripe signature validation

Performance Optimizations

  • Turbopack - Ultra-fast development builds
  • Convex Real-time - Instant data updates
  • Image Optimization - Next.js Image component
  • Code Splitting - Automatic route-based splitting
  • Server Components - React 19 Server Components
  • Edge Runtime - Global low-latency responses

Roadmap & Future Features

Planned Features

  • Native Mobile Apps - iOS and Android
  • Video Workouts - On-demand fitness classes
  • Gamification - Achievements and leaderboards
  • Progress Analytics - Body composition tracking
  • Push Notifications - Real-time alerts
  • Multi-Language - Sinhala and Tamil support
  • Virtual Training - Live video sessions
  • Multi-Location - Support for gym chains

Contributing

Contributions are welcome! Help make ELITE even better.

How to Contribute:

  1. Fork the Project
  2. Create your Feature Branch
    git checkout -b feature/AmazingFeature
  3. Commit your Changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the Branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

Pasindu Suraweera

Acknowledgments

  • Next.js - The React framework for production
  • Convex - Real-time backend platform
  • Stripe - Payment infrastructure
  • Clerk - Authentication and user management
  • Vapi - Voice AI platform for conversational interfaces
  • Google Gemini - AI-powered plan generation
  • shadcn/ui - Beautiful component library
  • Tailwind CSS - Utility-first CSS framework
  • πŸ‡±πŸ‡° The Sri Lankan fitness community

Support

Need help or have questions?


If you find ELITE Gym & Fitness useful, please give it a star!

Made for Sri Lanka πŸ‡±πŸ‡°

Visitors

Transform your fitness journey with AI-powered voice consultations and personalized plans

About

AI-powered gym management platform for Sri Lanka. Next.js 15 + Convex + Stripe. Features: memberships, trainer booking, AI workout/diet plans, e-commerce marketplace. Built with TypeScript, Clerk auth & real-time updates. πŸ‡±πŸ‡°

Topics

Resources

Stars

6 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages