A full-stack fitness application that combines gym management, social networking, and health tracking features.
- 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
- 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
- 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
- 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
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
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd my-fitness-buddy
-
Set up environment variables
cp .env.example .env # Edit .env with your configuration -
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd ../client npm install -
Set up MongoDB
- Start MongoDB service
- Update MONGODB_URI in .env file
-
Start the backend server
cd ../backend npm run dev # Server runs on http://localhost:5000
-
Start the frontend application
cd ../client npm start # App runs on http://localhost:3000
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- Home: Landing page with feature overview
- Login/Register: User authentication
- 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
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
- Real-time availability tracking
- Queue management for busy equipment
- Alternative exercise suggestions
- Trainer oversight and slot management
- Image upload and processing
- Automatic food identification
- Calorie and nutrition calculation
- Manual correction capabilities
- Progress sharing and tracking
- Community engagement features
- Achievement system
- Fitness buddy connections
- Unique user QR codes
- Real-time occupancy tracking
- Check-in/out history
- Peak hour insights
# Backend tests
cd backend
npm test
# Frontend tests
cd client
npm testcd backend
npm run build
npm startcd client
npm run build
# Deploy build folder to your hosting service- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License.
For support and questions:
- Create an issue in the repository
- Check the documentation
- Review the code comments
- 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