Skip to content

About

Interactive muscle map with exercises, an AI gym coach (Llama 3.1), diet plans and a BMI tracker. Full-stack React, Node, MongoDB and Stripe, in English and Bulgarian.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

37 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’ͺ MuscleMap AI β€” Interactive Fitness Intelligence Platform

Build Status Version License React Node MongoDB AI Infrastructure

MuscleMap AI is a full-stack fitness intelligence platform that combines an interactive anatomical muscle map with an AI-powered personal coach. Users can explore muscle groups, discover targeted exercises, generate custom diet plans, track their BMI, and get real-time coaching from an AI trained to think like an elite gym coach.


πŸ”₯ Features

πŸ—ΊοΈ Interactive Muscle Map

An SVG-based interactive anatomical model covering the full body. Click any muscle group to instantly explore curated exercises with GIF demonstrations, step-by-step instructions, difficulty levels, equipment requirements, and YouTube tutorial links.

πŸ€– MuscleMap AI Coach

A real-time AI chatbot powered by Llama 3.1 (via Groq). The coach mirrors the user's language (English or Bulgarian), responds like a real gym coach, and is aware of premium user profiles to give tailored advice based on age, weight, and goals.

  • Free Tier: 5 messages per rolling 24-hours.
  • MuscleMap Pro: Unlimited messages and deep contextual context injection.

πŸ₯— Custom Diet Plan Generator

Calculates daily caloric needs using the Harris-Benedict equation adjusted for activity level. Generates four structured diet blueprint plans: Balanced, High Protein, Ketogenic, and Low Fat β€” each with macro splits and recommended foods.

πŸ“ BMI Tracker

Calculates and categorises Body Mass Index with personalised advice based on result (Underweight, Normal, Overweight, Obese).

πŸ”– Bookmark System

Save and manage favourite exercises to a personal collection. Bookmarks are stored per user account and accessible from any device.

πŸ† Gamification & Badges

An achievement system that awards badges for platform milestones: first login (Rookie), email verification (Verified), completing a physical profile (Nutrition Analyst), saving 10+ exercises (Librarian), enabling dark mode (Night Owl), and switching to Bulgarian (Bilingual).

🌍 Bilingual Support (EN / BG)

Full app-wide localization using i18next. Every UI string β€” including the AI chatbot interface β€” switches seamlessly between English and Bulgarian.

πŸ” Authentication

  • Email/password registration with email verification
  • Google OAuth login
  • JWT-based session management
  • Forgot/reset password via email link

πŸ’Ž Premium Membership (Stripe)

A fully integrated Stripe checkout flow that unlocks MuscleMap Pro. Premium users receive:

  • Unlimited AI Coach Messages (with deep physical profile context injected).
  • AI Custom Workout Generator (Premium locked).
  • Unlimited Bookmarks (Free users restricted to 10).
  • Exclusive Pro Athlete user badge.

πŸ“¬ Contact Form

A fully functional contact form connected to a backend API endpoint. Submissions are sent directly to the support email (musclemap@yahoo.com) with styled HTML formatting, and users receive an automatic confirmation email. Rate-limited to 3 submissions per 15 minutes.

πŸ“„ Legal Compliance (GDPR / Stripe)

Full legal infrastructure for production readiness:

  • Terms and Conditions β€” usage rules and liability
  • Privacy Policy β€” GDPR-compliant data handling disclosure
  • Cookie Policy β€” localStorage and third-party cookie transparency
  • Refund Policy β€” Stripe-compliant digital product refund terms
  • FAQ β€” interactive accordion with common questions
  • About β€” platform mission and feature overview

All accessible via |-separated footer links.

πŸͺ Cookie Consent Banner

GDPR-compliant cookie consent banner that appears once on first visit. User choice is persisted in localStorage and the banner never reappears.


πŸ› οΈ Tech Stack

Frontend

Technology Purpose
React 18 + TypeScript Component framework with type safety
Vite Build tool and dev server
Tailwind CSS Utility-first styling
shadcn/ui Pre-built accessible UI components
i18next EN/BG localization
React Router v6 Client-side routing
TanStack Query Server state management
Lucide React Icon library
ReactBits (custom) Scroll, tilt, aurora, spotlight animations
ReactMarkdown Renders AI markdown responses
@vercel/analytics Page view tracking
@vercel/speed-insights Performance monitoring

Backend

Technology Purpose
Node.js + Express RESTful API server
MongoDB + Mongoose User data, exercises, bookmarks
Groq SDK Llama 3.1 inference for the AI coach
JWT Authentication tokens
Nodemailer Email verification & password reset
bcrypt Password hashing
Stripe Subscription & Checkout Sessions
express-rate-limit API rate limiting & anti-spam
CORS Cross-origin resource control

Infrastructure

Service Role
Vercel Frontend hosting + analytics
Koyeb Backend hosting
MongoDB Atlas Cloud database
Groq AI inference API
Stripe Payment processing


πŸš€ Local Setup

Prerequisites

1. Clone & install

git clone https://github.com/itsnotsimple/muscle-map-main.git
cd muscle-map-main
# Install frontend dependencies
cd client && npm install

# Install backend dependencies
cd ../server && npm install

2. Configure environment variables

Create server/.env:

MONGO_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
GROQ_API_KEY=your_groq_api_key
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_gmail_app_password
EMAIL_SERVICE=Gmail
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
FRONTEND_URL=http://localhost:8080
CLIENT_URL=http://localhost:8080

3. Run the app

# Terminal 1 β€” Backend
cd server
node server.js

# Terminal 2 β€” Frontend
cd client
npm run dev

Frontend: http://localhost:8080
Backend API: http://localhost:5000/api


🌐 Deployment

Frontend β†’ Vercel

The client/ directory is deployed to Vercel. The production API URL is set in client/src/services/api.ts:

const API_URL = IS_LOCAL
  ? 'http://localhost:5000/api'
  : 'https://your-koyeb-backend.koyeb.app/api';

Backend β†’ Koyeb

The server/ directory is deployed to Koyeb. Add all variables from .env as Environment Variables in the Koyeb dashboard β€” especially GROQ_API_KEY, which is required for the AI coach to function in production.


πŸ”Œ API Endpoints

Method Endpoint Auth Description
POST /api/register ❌ Register new user
POST /api/login ❌ Login with email/password
POST /api/google ❌ Google OAuth login
GET /api/verify/:token ❌ Verify email address
POST /api/forgot-password ❌ Send reset password email
POST /api/reset-password/:token ❌ Reset password
GET /api/user/status βœ… Get current user info
PUT /api/user/profile βœ… Update physical profile
DELETE /api/user/profile βœ… Delete account
PUT /api/user/badges βœ… Award a badge
GET /api/user/bookmarks βœ… Get saved exercises
POST /api/user/bookmark βœ… Save an exercise
DELETE /api/user/bookmarks/:id βœ… Remove a bookmark
GET /api/muscles/:key ❌ Get exercises for a muscle
GET /api/diets ❌ Get all diet plans
GET /api/chat/status βœ… Get daily AI message limit status
POST /api/chat βœ… Send message to AI coach
POST /api/workout/generate βœ… Generate AI workout plan
GET /api/workout/plans βœ… Get saved workout plans
DELETE /api/workout/plans/:id βœ… Delete a workout plan
POST /api/contact ❌ Submit contact form (sends email)
POST /api/stripe/create-checkout-session βœ… Create Stripe checkout session
POST /api/stripe/webhook ❌ Stripe payment webhook

πŸ“„ License

MIT Β© itsnotsimple

About

Interactive muscle map with exercises, an AI gym coach (Llama 3.1), diet plans and a BMI tracker. Full-stack React, Node, MongoDB and Stripe, in English and Bulgarian.

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages