Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

19 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ‹οΈ IronMind – AI Fitness Coach

IronMind is a full-stack AI-powered fitness platform designed to help users track their health, generate personalized workout and diet plans, analyze exercise form, and interact with an intelligent AI fitness coach.

The application combines modern web technologies, artificial intelligence, machine learning, computer vision, and real-time communication into a single fitness ecosystem.


πŸš€ Features

  • πŸ” JWT Authentication & Google Sign-In
  • πŸ“Š BMI Calculator with History & Trend Charts
  • πŸ€– AI Fitness Coach using Retrieval-Augmented Generation (RAG)
  • πŸ₯— Personalized Diet & Workout Plan Generator
  • ⏱️ Workout Timer with HIIT, Tabata & Custom Modes
  • πŸ“Ή AI Exercise Form Checker using MediaPipe Pose
  • πŸ”’ Real-Time Exercise Rep Counting
  • πŸ“ Joint Angle Detection & Form Analysis
  • πŸ”” Real-Time Notifications using Socket.IO
  • πŸ† Daily Streaks & Achievement Badges
  • πŸ“§ Daily Email Workout Reminders
  • πŸŒ™ Dark/Light Theme
  • 🎨 Modern Animated UI using Framer Motion
  • πŸ›‘οΈ Rate Limiting & Secure Authentication
  • πŸ§ͺ Backend Unit Testing with Pytest
  • 🐳 Docker & Docker Compose Support

πŸ› οΈ Tech Stack

Frontend

  • React
  • Vite
  • Tailwind CSS
  • Framer Motion
  • Axios
  • Socket.IO Client

Backend

  • FastAPI
  • SQLAlchemy
  • PostgreSQL
  • JWT Authentication
  • OAuth2
  • Google OAuth
  • Bcrypt Password Hashing
  • SlowAPI Rate Limiting

AI & Machine Learning

  • Retrieval-Augmented Generation (RAG)
  • ChromaDB
  • TF-IDF Retrieval
  • Latent Semantic Analysis (LSA)
  • Hugging Face Inference API
  • Cosine Similarity Search

Computer Vision

  • MediaPipe Pose Estimation
  • Webcam-Based Exercise Analysis
  • Real-Time Rep Counting
  • Joint Angle Detection
  • Exercise Form Feedback
  • On-Device Processing

DevOps & Deployment

  • Docker
  • Docker Compose
  • GitHub Actions
  • Pytest
  • GitHub
  • Render
  • Vercel
  • Supabase PostgreSQL

πŸ—οΈ System Architecture

                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚    React + Vite       β”‚
                         β”‚      Frontend        β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚
                                    β”‚
                                    β”‚ API Requests
                                    β–Ό
                         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                         β”‚       FastAPI        β”‚
                         β”‚       Backend        β”‚
                         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                    β”‚
                  β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                  β”‚                 β”‚                 β”‚
                  β–Ό                 β–Ό                 β–Ό
             PostgreSQL           RAG            MediaPipe
             (Supabase)         AI Coach         Form Checker
                  β”‚
                  β–Ό
             User Data

πŸ“‚ Project Structure

fitness-app/
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ routers/
β”‚   β”‚   β”œβ”€β”€ rag/
β”‚   β”‚   β”œβ”€β”€ models.py
β”‚   β”‚   β”œβ”€β”€ schemas.py
β”‚   β”‚   β”œβ”€β”€ security.py
β”‚   β”‚   β”œβ”€β”€ database.py
β”‚   β”‚   └── main.py
β”‚   β”‚
β”‚   β”œβ”€β”€ tests/
β”‚   β”œβ”€β”€ requirements.txt
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ frontend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ pages/
β”‚   β”‚   β”œβ”€β”€ components/
β”‚   β”‚   β”œβ”€β”€ context/
β”‚   β”‚   └── api/
β”‚   β”‚
β”‚   β”œβ”€β”€ package.json
β”‚   └── Dockerfile
β”‚
β”œβ”€β”€ docker-compose.yml
└── README.md

⚑ Installation

1. Clone the Repository

git clone https://github.com/anushkap0/IronMind.git
cd IronMind

2. Backend Setup

Navigate to the backend directory:

cd backend

Create a virtual environment:

Windows

python -m venv venv
venv\Scripts\activate

Linux / macOS

python -m venv venv
source venv/bin/activate

Install the required dependencies:

pip install -r requirements.txt

Start the FastAPI backend:

uvicorn app.main:app --reload

Backend runs at:

http://localhost:8000

Swagger API Documentation:

http://localhost:8000/docs

3. Frontend Setup

Open a new terminal and navigate to the frontend:

cd frontend

Install dependencies:

npm install

Start the development server:

npm run dev

Frontend runs at:

http://localhost:5173

πŸ” Environment Variables

Create a .env file for the backend and configure the required environment variables.

Example:

DATABASE_URL=your_postgresql_database_url

SECRET_KEY=your_secret_key
SESSION_SECRET_KEY=your_session_secret_key

FRONTEND_ORIGIN=http://localhost:5173

GOOGLE_CLIENT_ID=your_google_client_id
GOOGLE_CLIENT_SECRET=your_google_client_secret
GOOGLE_REDIRECT_URI=http://localhost:8000/auth/google/callback

HF_API_TOKEN=your_huggingface_api_token

⚠️ Important: Never commit your .env file or real passwords, API keys, tokens, or secret keys to GitHub.

Use .env.example with placeholder values when sharing the project.

For production deployment, configure environment variables through your hosting provider.


🐳 Docker

IronMind supports Docker and Docker Compose for containerized development and deployment.

Build and start the application:

docker compose up --build

Stop the containers:

docker compose down

PostgreSQL data is persisted using a Docker volume.


πŸ€– AI Fitness Coach

The AI Fitness Coach uses a Retrieval-Augmented Generation (RAG) pipeline to provide intelligent fitness-related responses.

RAG Pipeline

User Question
      ↓
TF-IDF Retrieval
      ↓
LSA Embeddings
      ↓
Cosine Similarity Search
      ↓
Relevant Fitness Context
      ↓
Hugging Face LLM
      ↓
AI-Generated Response

The system retrieves relevant information from a fitness knowledge base before generating a response.

If an AI API token is not available, the application can switch to Demo Mode.


πŸ“Ή AI Exercise Form Checker

IronMind uses MediaPipe Pose Estimation for real-time exercise analysis.

Supported Exercises

  • Squats
  • Push-ups

Features

  • Real-time exercise rep counting
  • Joint angle detection
  • Exercise form analysis
  • Real-time form feedback
  • Webcam-based exercise tracking
  • On-device pose processing

πŸ“Š Progress Tracking

Users can:

  • Calculate BMI
  • Store BMI history
  • View BMI progress charts
  • Track daily fitness streaks
  • Unlock achievement badges
  • Monitor workout progress

πŸ”” Real-Time Features

Socket.IO is used to provide real-time application functionality.

Features include:

  • Workout timer synchronization
  • Live notifications
  • Achievement updates
  • Real-time application events

πŸ” Authentication & Security

IronMind provides secure authentication and application protection through:

  • JWT Authentication
  • OAuth2 Password Flow
  • Google OAuth Login
  • Bcrypt Password Hashing
  • Rate Limiting using SlowAPI
  • Environment-based secret management
  • Secure API authentication

πŸ§ͺ Testing

Backend tests are implemented using Pytest.

Run the test suite:

cd backend
pytest tests/ -v

☁️ Deployment

IronMind can be deployed using the following architecture:

                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚ React + Vite     β”‚
                 β”‚ Frontend         β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          |
                          β–Ό
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚ FastAPI         β”‚
                 β”‚ Backend         β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
                      Render
                          β”‚
                          β–Ό
                 β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                 β”‚ PostgreSQL      β”‚
                 β”‚ Database        β”‚
                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                          β”‚
                          β–Ό
                      Supabase

Deployment Stack

Component Platform
Frontend Render
Backend Render
Database Supabase PostgreSQL
Source Code GitHub

For production deployment, configure all required environment variables in the hosting platform instead of committing secrets to the repository.


🌟 Future Improvements

  • πŸ₯— Nutrition Tracking
  • ⌚ Wearable Device Integration
  • 🧠 Intelligent Exercise Recommendation System
  • πŸŽ™οΈ Voice-Based AI Fitness Coach
  • πŸ“± Mobile Application
  • πŸ† Social Fitness Challenges
  • πŸ“ˆ Advanced Workout Analytics Dashboard

πŸ‘©β€πŸ’» Author

**Anushka **

GitHub: Anushka


⭐ Support

If you found this project helpful, consider giving the repository a ⭐ on GitHub!

Releases

Packages

Contributors

Languages