Skip to content

kumarpiyushraj/Fit-Yoga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation


Platform  Frontend  Backend  Database  Stars



Book mindfully  ·  Train consistently  ·  Live vibrantly





📊  At a Glance

🌐 Stack 🏗️ Architecture 💾 Database 🔐 Auth 🎨 UI ⚡ Routing
MERN RESTful API MongoDB + Mongoose express-session Framer Motion + CSS3 React Router







Fit-Yoga is a full-stack web application built with the MERN stack (MongoDB, Express.js, React.js, Node.js) that bridges traditional yoga practices with modern digital convenience. It provides a comprehensive Fitness and Yoga Booking and Content Management System — streamlining class bookings, content management, and user engagement in one unified platform.


  What It Offers How It Delivers
🎟️ Smart Booking System Real-time seat tracking with automatic discount calculation
📊 Admin Dashboard Powerful content, booking, and review management tools
🎥 Video Library Instructional tutorials and fitness content on demand
🎨 Modern Interface Responsive design with smooth Framer Motion animations
🔒 Role-Based Access Secure session management for users and admins




👤 User Features

Feature Detail
🔐 Authentication System Secure registration and login with session management
📦 Package Browsing View detailed fitness and yoga packages with pricing
🎟️ Smart Booking System Real-time seat availability, auto discounts, instant confirmation
📚 Class Listings Browse available yoga and fitness classes
🎥 Video Library Access instructional videos and tutorials
📖 Booking History Track all your bookings in one place
Reviews Read feedback from other users


🛡️ Admin Features

Feature Detail
📊 Booking Management View and cancel user bookings across the platform
Content Management Add new classes and video tutorials effortlessly
🗑️ Review Moderation Manage user reviews for quality control
👥 User Oversight Monitor booking patterns and seat availability


⚡ Technical Highlights

Smart Discount Engine:
  • 20% discount  →  for bookings of 20+ seats
  • 50% discount  →  for bookings of 50+ seats
  • Instant receipt generation on confirmation
Highlight Implementation
🔄 Session Management Secure user sessions with express-session
🎨 Responsive Design Mobile-friendly interface with smooth animations
🚀 RESTful API Clean, structured backend architecture
💾 MongoDB Integration Efficient NoSQL operations with Mongoose ODM
🔒 Role-Based Access Separate user and admin functionality with protected routes




Frontend Backend
React.js Component-based UI library Node.js JavaScript runtime environment
React Router Client-side routing Express.js Web application framework
Axios HTTP client for API requests MongoDB NoSQL database
Framer Motion Animation library Mongoose MongoDB object modeling
CSS3 Custom styling with animations express-session Session middleware
CORS Cross-origin resource sharing

🧰 Development Tools

Tool Purpose
Visual Studio Code Primary code editor
MongoDB Compass Database management GUI
dotenv Environment variable management




graph TB
    subgraph ClientLayer["📱 Client Layer (Port 3000)"]
        A1["HomePage"]
        A2["PackagesPage"]
        A3["BookingSystem"]
        A4["VideoLibrary"]
        A5["ReviewsPage"]
        A6["UserDashboard"]
    end

    subgraph AdminLayer["🛡️ Admin Layer (Protected)"]
        B1["AdminDashboard"]
        B2["BookingManager"]
        B3["ContentManager"]
        B4["ReviewModerator"]
    end

    subgraph ServerLayer["⚙️ Server Layer (Port 5000)"]
        C1["Express Router"]
        C2["Session Middleware"]
        C3["CORS Handler"]
        C4["Auth Guards"]
    end

    subgraph DataLayer["💾 Data Layer"]
        D1[("MongoDB\nDatabase")]
        D2["Mongoose ODM"]
    end

    A1 --> C1
    A2 --> C1
    A3 --> C1
    A4 --> C1
    A5 --> C1
    A6 --> C1
    B1 --> C4
    B2 --> C4
    B3 --> C4
    B4 --> C4
    C4 --> C1
    C1 --> C2
    C2 --> C3
    C3 --> D2
    D2 --> D1

    style A1 fill:#d97706,stroke:#92400e,stroke-width:3px,color:#000
    style A2 fill:#d97706,stroke:#92400e,stroke-width:3px,color:#000
    style A3 fill:#d97706,stroke:#92400e,stroke-width:3px,color:#000
    style A4 fill:#d97706,stroke:#92400e,stroke-width:3px,color:#000
    style A5 fill:#d97706,stroke:#92400e,stroke-width:3px,color:#000
    style A6 fill:#d97706,stroke:#92400e,stroke-width:3px,color:#000
    style B1 fill:#b91c1c,stroke:#7f1d1d,stroke-width:3px,color:#fff
    style B2 fill:#b91c1c,stroke:#7f1d1d,stroke-width:3px,color:#fff
    style B3 fill:#b91c1c,stroke:#7f1d1d,stroke-width:3px,color:#fff
    style B4 fill:#b91c1c,stroke:#7f1d1d,stroke-width:3px,color:#fff
    style C1 fill:#c2410c,stroke:#7c2d12,stroke-width:3px,color:#fff
    style C2 fill:#c2410c,stroke:#7c2d12,stroke-width:3px,color:#fff
    style C3 fill:#c2410c,stroke:#7c2d12,stroke-width:3px,color:#fff
    style C4 fill:#c2410c,stroke:#7c2d12,stroke-width:3px,color:#fff
    style D1 fill:#92400e,stroke:#451a03,stroke-width:3px,color:#fff
    style D2 fill:#92400e,stroke:#451a03,stroke-width:3px,color:#fff

    style ClientLayer fill:#fef3c7,stroke:#d97706,stroke-width:2px,color:#000
    style AdminLayer fill:#fee2e2,stroke:#b91c1c,stroke-width:2px,color:#000
    style ServerLayer fill:#ffedd5,stroke:#c2410c,stroke-width:2px,color:#000
    style DataLayer fill:#fef9c3,stroke:#92400e,stroke-width:2px,color:#000
Loading

🗄️ Database Schema

Collections:

Collection Purpose
users User credentials and roles
classes Fitness and yoga class details
packages Booking packages with pricing and availability
bookings User booking records
videos Tutorial video information
reviews User feedback and ratings




Prerequisites

Requirement Detail
🟢 Node.js v14 or higher
🍃 MongoDB v4 or higher
📦 Package Manager npm or yarn

Step 1 — Clone the Repository

git clone https://github.com/kumarpiyushraj/Fit-Yoga.git
cd fit-yoga

Step 2 — Install Backend Dependencies

cd backend
npm install

Required backend packages:

{
  "express": "^4.18.0",
  "mongoose": "^6.0.0",
  "cors": "^2.8.5",
  "express-session": "^1.17.0",
  "dotenv": "^16.0.0"
}

Step 3 — Install Frontend Dependencies

cd ../frontend
npm install

Required frontend packages:

{
  "react": "^18.2.0",
  "react-dom": "^18.2.0",
  "react-router-dom": "^6.0.0",
  "axios": "^1.0.0",
  "framer-motion": "^10.0.0"
}

Step 4 — Setup MongoDB

Ensure MongoDB is running locally or use a cloud instance (MongoDB Atlas).




Backend Configuration

Create a .env file in the backend directory:

# MongoDB Connection
MONGO_URI=mongodb://localhost:27017/FitnessYogaApp

# Session Secret
SESSION_SECRET=G8#j2Lr@9vPqXz$MnT3yB!dK

# Server Port
PORT=5000

Frontend Configuration

Update API endpoints in your components if needed (default: http://localhost:5000).




Running the Application

Terminal 1 — Start Backend Server:

cd backend
node server.js
# Server running on http://localhost:5000

Terminal 2 — Start Frontend:

cd frontend
npm start
# React app running on http://localhost:3000

Default Admin Credentials

You'll need to manually create an admin user in MongoDB with role: "admin".


User Workflow

sequenceDiagram
    participant User
    participant Auth as Auth System
    participant App as Application
    participant DB as MongoDB

    User->>Auth: Register new account
    Auth->>DB: Store user credentials
    DB-->>Auth: User created
    Auth-->>User: Registration success

    User->>Auth: Login
    Auth->>DB: Verify credentials
    DB-->>Auth: User validated
    Auth-->>User: Session established

    User->>App: Browse packages & classes
    App->>DB: Fetch packages, videos, reviews
    DB-->>App: Content data
    App-->>User: Display content

    User->>App: Select package & book
    App->>App: Calculate discount (20%/50%)
    App->>DB: Save booking record
    App->>DB: Update seat availability
    DB-->>App: Booking confirmed
    App-->>User: Show receipt

    User->>App: View booking history
    App->>DB: Fetch user bookings
    DB-->>App: Booking records
    App-->>User: Display history
Loading

Admin Workflow

sequenceDiagram
    participant Admin
    participant Dashboard as Admin Dashboard
    participant DB as MongoDB

    Admin->>Dashboard: Login with admin role
    Dashboard-->>Admin: Access granted

    Admin->>Dashboard: View all bookings
    Dashboard->>DB: Fetch all bookings
    DB-->>Dashboard: Booking list
    Dashboard-->>Admin: Display bookings

    alt Cancel Booking
        Admin->>Dashboard: Select booking to cancel
        Dashboard->>DB: Delete booking
        Dashboard->>DB: Restore seat count
        DB-->>Dashboard: Updated
        Dashboard-->>Admin: Cancellation confirmed
    end

    Admin->>Dashboard: Add new class/video
    Dashboard->>DB: Insert new document
    DB-->>Dashboard: Content saved
    Dashboard-->>Admin: Content live

    Admin->>Dashboard: Moderate reviews
    Dashboard->>DB: Delete inappropriate review
    DB-->>Dashboard: Review removed
    Dashboard-->>Admin: Moderation complete
Loading




🎯 User Experience



Homepage
Clean interface · Intuitive navigation · Call-to-action buttons


Package Selection
Detailed pricing · Real-time seat availability · Auto discounts (20%/50%)


Smart Booking System
Instant price calculation · Seat validation · Pre-filled user data

🧾 Booking & History



Booking Confirmation
Complete booking details · Applied discounts · Receipt generation


Personal Dashboard
Booking history · Date & time tracking · Pricing details

🎥 Content & Community



Video Library
Embedded videos · Category filtering · Tutorial access


Community Reviews
Star ratings · User testimonials · Feedback display

🔐 Authentication System



User Sign In
Secure login · Session management · Role-based access


User Registration
Form validation · Pattern matching · Error handling

🛡️ Administrative Control Panel



Admin Dashboard
Booking overview · User management · Content control


Class Management
Create classes · Set schedules · Assign instructors


Review Moderation
View all reviews · Delete inappropriate content · Quality control




Authentication

Method Endpoint Description
POST /api/register Register new user
POST /api/login User/Admin login
POST /api/logout Logout user
GET /api/currentUser Get session user

User Endpoints

Method Endpoint Description
GET /api/classes Fetch all classes
GET /api/packages Fetch all packages
GET /api/videos Fetch all videos
GET /api/reviews Fetch all reviews
POST /api/bookings Create new booking
GET /api/userbookings Fetch user's bookings

Admin Endpoints (Protected)

Method Endpoint Description
GET /api/admin/bookings View all bookings
DELETE /api/bookings/:id Cancel booking
POST /api/admin/classes Add new class
POST /api/admin/videos Add new video
GET /api/admin/reviews View all reviews
DELETE /api/admin/reviews/:id Delete review




📦 Version 1.1 — Next Release
  • 💳 Payment Gateway Integration — Secure online payment processing
  • 🔐 Password Encryption — bcrypt implementation
  • 📧 Email Confirmations — Automated booking receipts
  • 🔔 Push Notifications — Class reminders and updates

📦 Version 1.2
  • 📱 Mobile Application — Native iOS and Android apps
  • 🎬 Live Streaming — Real-time class broadcasting
  • 📊 Analytics Dashboard — User engagement metrics
  • 📈 Progress Tracking — User fitness journey monitoring

🚀 Version 2.0 — Future Vision
  • 🤖 AI Recommendations — Personalized fitness plans
  • 🌐 Multi-language Support — International accessibility
  • ⌚ Wearable Integration — Connect with fitness trackers
  • 📱 Cross-platform — Unified mobile and desktop experience




  Acknowledgment
🌍 MERN Stack Community — For excellent libraries and documentation
💬 Stack Overflow Community — For invaluable problem-solving assistance
🌟 Open Source Contributors — Everyone who helped shape this project




Need Help or Have Questions?


GitHub Issues  GitHub Discussions  Email




Built with ❤️ for mindful living  ·  React  ·  Node.js  ·  MongoDB


Star this repo


© 2025 Kumar Piyush Raj  ·  GitHub @kumarpiyushraj

About

Full-stack MERN fitness and yoga booking platform with smart discount engine (20%/50% auto-discount), video library, role-based access for users and admins, real-time seat tracking, and Framer Motion animated UI.

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors