Skip to content

An AI-powered wellness platform that delivers personalized fitness and nutrition guidance for a smarter, healthier lifestyle.

License

Notifications You must be signed in to change notification settings

syeda434am/VitaFlex-AI

Repository files navigation

VitaFlex-AI πŸ‹οΈβ€β™€οΈπŸ€–

Live Demo

An AI-powered wellness platform that delivers personalized fitness and nutrition guidance for a smarter, healthier lifestyle. VitaFlex-AI combines FastAPI backend with OpenAI GPT-4o integration and a modern React frontend to create a comprehensive wellness companion.

Grief Compass

✨ Features

  • πŸ€– AI Coach - Personalized fitness coaching powered by GPT-4o
  • πŸ“± Food Scanner - AI-powered food recognition and nutritional analysis
  • 🍽️ Meal Planner - Smart meal planning with dietary preferences
  • πŸ’ͺ Workout Planner - Custom workout routines tailored to your fitness level
  • πŸ“± Responsive Design - Seamless experience across all devices
  • 🐳 Docker Support - Easy deployment with Docker and docker-compose

πŸ› οΈ Tech Stack

Backend

  • FastAPI - Modern Python web framework
  • OpenAI GPT-4o - Advanced language model for AI recommendations
  • Tavily API - Search and data retrieval service
  • Uvicorn - ASGI server
  • Python 3.8+ - Backend runtime
  • Docker - Containerization support
  • Nginx - Web server and reverse proxy

Frontend

  • React 18 - UI library with TypeScript
  • Vite - Build tool and development server
  • TailwindCSS - CSS framework
  • ShadCN UI - Component library
  • React Router - Client-side routing
  • React Query - Data fetching and state management

πŸš€ Getting Started

Prerequisites

  • Python 3.8+
  • Node.js 18+
  • npm or yarn or pnpm
  • OpenAI API Key
  • Tavily API Key

Installation

  1. Clone the repository:
git clone https://github.com/syeda434am/VitaFlex-AI.git
cd VitaFlex-AI
  1. Backend Setup:
# Navigate to backend directory (if separate) or root
# Install Python dependencies
pip install -r requirements.txt
  1. Frontend Setup:
# Navigate to frontend directory or install frontend dependencies
npm install
# or
yarn install
# or
pnpm install

Running the Application

Important: Start the backend first, then the frontend.

Option 1: Using Docker (Recommended)

# Start all services with docker-compose
docker-compose up -d

# View logs
docker-compose logs -f

# Stop services
docker-compose down

Option 2: Manual Setup

  1. Start the FastAPI Backend:
uvicorn com.mhire.app.main:app --reload

The backend will be available at http://localhost:8000

  1. Start the React Frontend:
npm run dev
# or
yarn dev
# or
pnpm dev

The frontend will be available at http://localhost:5173

πŸ“ Project Structure

  • Set the project within below structure by copying the files and folders inside com/mhire/ui/ and paste them outside of the com folder. The structure will then look like below:
VitaFlex-AI/
β”œβ”€β”€ com/
β”‚   └── mhire/
β”‚       └── app/
β”‚           β”œβ”€β”€ main.py              # FastAPI main application
β”‚           β”œβ”€β”€ config/              # Configuration files
β”‚           └── services/            # AI-powered microservices
β”‚               β”œβ”€β”€ ai_coach/        # AI fitness coaching service
β”‚               β”œβ”€β”€ food_scanner/    # Food recognition and analysis
β”‚               β”œβ”€β”€ meal_planner/    # AI meal planning service
β”‚               └── workout_planner/ # Workout generation service
β”œβ”€β”€ nginx/                           # Nginx configuration
β”œβ”€β”€ public/                          # Static assets
β”œβ”€β”€ src/                             # React frontend source
β”‚   β”œβ”€β”€ components/                  # React components
β”‚   β”‚   β”œβ”€β”€ ui/                      # ShadCN UI components
β”‚   β”‚   β”œβ”€β”€ fitness/                 # Fitness-related components
β”‚   β”‚   β”œβ”€β”€ nutrition/               # Nutrition components
β”‚   β”‚   └── dashboard/               # Dashboard components
β”‚   β”œβ”€β”€ hooks/                       # Custom React hooks
β”‚   β”œβ”€β”€ lib/                         # Frontend utilities
β”‚   β”œβ”€β”€ pages/                       # React pages/routes
β”‚   β”œβ”€β”€ services/                    # API client services
β”‚   β”œβ”€β”€ App.tsx                      # Main React component
β”‚   └── main.tsx                     # React entry point
β”œβ”€β”€ .dockerignore                    # Docker ignore file
β”œβ”€β”€ .gitignore                       # Git ignore file
β”œβ”€β”€ Dockerfile                       # Docker configuration
β”œβ”€β”€ LICENSE                          # Project license
β”œβ”€β”€ README.md                        # Project documentation
β”œβ”€β”€ components.json                  # ShadCN components config
β”œβ”€β”€ docker-compose.yml               # Docker compose configuration
β”œβ”€β”€ eslint.config.js                 # ESLint configuration
β”œβ”€β”€ index.html                       # HTML entry point
β”œβ”€β”€ package-lock.json                # NPM lock file
β”œβ”€β”€ package.json                     # Node.js dependencies
β”œβ”€β”€ postcss.config.js                # PostCSS configuration
β”œβ”€β”€ requirements.txt                 # Python dependencies
β”œβ”€β”€ tailwind.config.ts               # TailwindCSS configuration
β”œβ”€β”€ tsconfig.app.json                # TypeScript app configuration
β”œβ”€β”€ tsconfig.json                    # TypeScript configuration
β”œβ”€β”€ tsconfig.node.json               # TypeScript Node configuration
└── vite.config.ts                   # Vite configuration

βš™οΈ Configuration

Environment Variables

Create a .env file in the root directory:

# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
MODEL=model_name

# Tavily API Configuration
TAVILY_API_KEY=your_tavily_api_key_here

πŸ”Œ API Endpoints

The FastAPI backend provides the following key endpoints through specialized services:

AI Coach Service

  • POST /api/v1/coach - Get personalized coaching advice

Food Scanner Service

  • POST /api/v1/food-scanner - Analyze food images for nutritional content

Meal Planner Service

  • POST /api/v1/meal-planner - Generate personalized meal plans

Workout Planner Service

  • POST /api/v1/workout-planner - Create custom workout routines

API documentation is available at http://localhost:8000/docs when the backend is running.

πŸ€– AI Integration

Tavily AI API

  • Enhanced search capabilities for fitness and nutrition information
  • Real-time data retrieval for up-to-date health trends
  • Fact-checking and information validation

Service Architecture with OpenAI's GPT-4o GenAI Model

  • AI Coach Service: Handles all AI-powered coaching interactions
  • Food Scanner Service: Uses computer vision for food recognition and analysis
  • Meal Planner Service: Manages meal planning algorithms and nutrition data
  • Workout Planner Service: Generates and manages fitness routines

πŸ—οΈ Building for Production

Backend

# For production deployment, consider using:
gunicorn -w 4 -k uvicorn.workers.UvicornWorker com.mhire.app.main:app

Frontend

npm run build
# or
yarn build
# or
pnpm build

πŸš€ Deployment

Backend Deployment Options

  • Heroku - Easy Python app deployment
  • AWS EC2/Lambda - Scalable cloud deployment
  • DigitalOcean - Simple cloud hosting
  • Railway - Modern deployment platform

Frontend Deployment Options

  • Vercel - Recommended for React applications
  • Netlify - Great for static site hosting
  • AWS S3 + CloudFront - Scalable static hosting

🀝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“„ License

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

VitaFlex-AI - Empowering your wellness journey with AI 🌟

About

An AI-powered wellness platform that delivers personalized fitness and nutrition guidance for a smarter, healthier lifestyle.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •