Skip to content

RishavTiwari25/FB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

1 Commit
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

My Fitness Buddy - Comprehensive Fitness App

A full-stack fitness application that combines gym management, social networking, and health tracking features.

๐Ÿš€ Features

Core Functionality

  • Gym Equipment Booking: Smart slot booking with queue management and alternative exercise suggestions
  • AI Food Detection: Upload food photos for instant calorie and nutrition analysis
  • Social Fitness Network: Share progress, connect with fitness enthusiasts, and build community
  • QR Check-in/out: Real-time gym occupancy tracking with unique QR codes
  • Streak & Rewards System: Earn points for consistency and redeem for gym rewards
  • Home Workout Alternatives: Complete workout routines when you can't make it to the gym
  • Payment Management: Track gym fees, manage payments, and handle gym finances

User Roles

  • Members: Book equipment, track nutrition, share progress, earn rewards
  • Trainers: Monitor trainees, track progress, manage equipment bookings
  • Gym Owners: Manage payments, track occupancy, oversee operations
  • Administrators: Full system access and user management

๐Ÿ› ๏ธ Technology Stack

Backend

  • Node.js with Express.js framework
  • MongoDB database with Mongoose ODM
  • JWT authentication with bcrypt password hashing
  • Socket.io for real-time features
  • Multer for file uploads
  • QR Code generation and management

Frontend

  • React.js with modern hooks and functional components
  • React Router for navigation and routing
  • Tailwind CSS for styling and responsive design
  • React Query for data fetching and state management
  • React Hook Form for form handling
  • React Dropzone for file uploads
  • Framer Motion for animations
  • React Hot Toast for notifications

๐Ÿ“ Project Structure

my-fitness-buddy/
โ”œโ”€โ”€ backend/                 # Node.js backend
โ”‚   โ”œโ”€โ”€ models/             # MongoDB schemas
โ”‚   โ”œโ”€โ”€ routes/             # API endpoints
โ”‚   โ”œโ”€โ”€ middleware/         # Authentication & authorization
โ”‚   โ”œโ”€โ”€ server.js           # Main server file
โ”‚   โ””โ”€โ”€ package.json        # Backend dependencies
โ”œโ”€โ”€ client/                 # React frontend
โ”‚   โ”œโ”€โ”€ src/
โ”‚   โ”‚   โ”œโ”€โ”€ components/     # Reusable UI components
โ”‚   โ”‚   โ”œโ”€โ”€ pages/          # Main application pages
โ”‚   โ”‚   โ”œโ”€โ”€ contexts/       # React contexts (Auth)
โ”‚   โ”‚   โ”œโ”€โ”€ App.js          # Main app component
โ”‚   โ”‚   โ””โ”€โ”€ index.js        # Entry point
โ”‚   โ””โ”€โ”€ package.json        # Frontend dependencies
โ””โ”€โ”€ .env                    # Environment configuration

๐Ÿš€ Getting Started

Prerequisites

  • Node.js (v16 or higher)
  • MongoDB (local or cloud instance)
  • npm or yarn package manager

Installation

  1. Clone the repository

    git clone <repository-url>
    cd my-fitness-buddy
  2. Set up environment variables

    cp .env.example .env
    # Edit .env with your configuration
  3. Install backend dependencies

    cd backend
    npm install
  4. Install frontend dependencies

    cd ../client
    npm install
  5. Set up MongoDB

    • Start MongoDB service
    • Update MONGODB_URI in .env file
  6. Start the backend server

    cd ../backend
    npm run dev
    # Server runs on http://localhost:5000
  7. Start the frontend application

    cd ../client
    npm start
    # App runs on http://localhost:3000

๐Ÿ”ง Environment Configuration

Create a .env file in the root directory:

# Server Configuration
PORT=5000
NODE_ENV=development

# Database
MONGODB_URI=mongodb://localhost:27017/fitness_buddy

# JWT Secret
JWT_SECRET=your_super_secret_jwt_key_here_change_in_production

# File Upload
MAX_FILE_SIZE=10485760
UPLOAD_PATH=./uploads

# QR Code
QR_SECRET=your_qr_secret_key_here

# Points System
POINTS_PER_WORKOUT=10
POINTS_PER_MEAL=5
POINTS_PER_STREAK_DAY=15

๐Ÿ“ฑ Application Pages

Public Pages

  • Home: Landing page with feature overview
  • Login/Register: User authentication

Protected Pages

  • Dashboard: Overview of fitness stats and quick actions
  • Gym Booking: Equipment reservation and availability
  • Food Tracking: AI-powered nutrition tracking
  • Social: Fitness community and progress sharing
  • Profile: User profile and fitness information
  • Streaks: Consistency tracking and rewards
  • QR Check-in: Gym entry/exit and occupancy
  • Home Workouts: Alternative exercise routines
  • Payments: Membership fee management

๐Ÿ” Authentication & Authorization

The app uses JWT tokens for authentication with role-based access control:

  • Members: Access to personal features and gym booking
  • Trainers: Additional access to trainee management
  • Gym Owners: Access to payment tracking and gym operations
  • Administrators: Full system access

๐ŸŽฏ Key Features Explained

Smart Equipment Booking

  • Real-time availability tracking
  • Queue management for busy equipment
  • Alternative exercise suggestions
  • Trainer oversight and slot management

AI Food Detection

  • Image upload and processing
  • Automatic food identification
  • Calorie and nutrition calculation
  • Manual correction capabilities

Social Fitness Network

  • Progress sharing and tracking
  • Community engagement features
  • Achievement system
  • Fitness buddy connections

QR Check-in System

  • Unique user QR codes
  • Real-time occupancy tracking
  • Check-in/out history
  • Peak hour insights

๐Ÿงช Testing

# Backend tests
cd backend
npm test

# Frontend tests
cd client
npm test

๐Ÿš€ Deployment

Backend Deployment

cd backend
npm run build
npm start

Frontend Deployment

cd client
npm run build
# Deploy build folder to your hosting service

๐Ÿค Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

๐Ÿ“„ License

This project is licensed under the MIT License.

๐Ÿ†˜ Support

For support and questions:

  • Create an issue in the repository
  • Check the documentation
  • Review the code comments

๐Ÿ”ฎ Future Enhancements

  • Real AI Integration: Replace simulated AI with actual machine learning models
  • Mobile App: Native iOS and Android applications
  • Wearable Integration: Connect with fitness trackers and smartwatches
  • Advanced Analytics: Detailed fitness insights and recommendations
  • Video Workouts: Exercise form guidance and virtual training sessions
  • Nutrition Planning: AI-powered meal planning and recipes

Built with โค๏ธ for the fitness community

About

An app where you get all related to you fitness

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors