# Gym Management System

A comprehensive multi-tenant SaaS gym management software built with Laravel 12 and Tailwind CSS.

## Features

### 1. User Roles & Access Control
- **Super Admin**: Full system access
- **Gym Owner/Admin**: Manage their gym(s)
- **Trainer**: Manage assigned members and workout plans
- **Member**: View their membership and attendance
- **Receptionist**: Handle check-ins and payments

### 2. Gym Setup Module
- Gym profile management
- Logo upload
- Address and contact details
- Operating hours and days
- Currency and tax settings

### 3. Member Management
- Add/edit/delete members
- Member profiles with photos
- Emergency contacts
- Membership status tracking
- Join and expiry dates

### 4. Membership & Plans
- Create membership plans (Monthly, Quarterly, Yearly)
- Custom plans
- Trial memberships
- Facility access control
- Freeze/pause options

### 5. Attendance Management
- Manual check-in
- QR code support (ready for implementation)
- Daily attendance logs
- Attendance history

### 6. Payment & Billing
- Invoice generation
- Multiple payment methods (Cash, Bank, Online)
- Due amount tracking
- Payment history
- Revenue reports

### 7. Trainer Management
- Trainer profiles
- Skills and certifications
- Member assignments
- Commission tracking
- Availability management

### 8. Workout & Diet Plans
- Predefined workout plans
- Custom plans per member
- Exercise library
- Diet plans with calorie tracking
- PDF upload support

### 9. Class Scheduling
- Class creation and management
- Trainer assignment
- Capacity limits
- Member booking system

### 10. Notifications & Reminders
- Membership expiry reminders
- Payment due reminders
- Class reminders
- Email notifications (SMS/WhatsApp ready)

### 11. Reports & Analytics
- Active vs inactive members
- Revenue reports
- Attendance trends
- Trainer performance
- Export to PDF/Excel

### 12. Inventory Management
- Product catalog
- Stock management
- Low stock alerts
- Sales tracking

## Installation

1. Clone the repository
2. Install dependencies:
   ```bash
   composer install
   npm install
   ```

3. Copy `.env.example` to `.env` and configure your database

4. Generate application key:
   ```bash
   php artisan key:generate
   ```

5. Run migrations:
   ```bash
   php artisan migrate
   ```

6. Seed super admin:
   ```bash
   php artisan db:seed --class=SuperAdminSeeder
   ```

7. Build assets:
   ```bash
   npm run build
   ```

8. Start the server:
   ```bash
   php artisan serve
   ```

## Default Credentials

- **Email**: saeedmubeen20@gmail.com
- **Password**: 03149039599M

## Database Structure

The system uses a multi-tenant architecture where each gym has isolated data. Key tables:

- `gyms` - Gym information
- `users` - System users with roles
- `members` - Gym members
- `membership_plans` - Available membership plans
- `memberships` - Member subscriptions
- `attendance` - Daily attendance logs
- `payments` - Payment transactions
- `trainers` - Trainer information
- `workout_plans` - Workout plans
- `diet_plans` - Diet plans
- `classes` - Gym classes
- `class_bookings` - Class reservations
- `products` - Inventory items
- `exercises` - Exercise library
- `notifications` - System notifications

## Technology Stack

- **Backend**: Laravel 12
- **Frontend**: Blade Templates with Tailwind CSS
- **Authentication**: Laravel Breeze
- **Database**: MySQL/PostgreSQL/SQLite

## API Architecture

The system is built with API-based architecture in mind. Controllers are structured to support both web and API responses.

## Security Features

- Password hashing
- Role-based access control
- Multi-tenant data isolation
- Activity logging (ready for implementation)

## License

MIT License
