Smart Gym is a web-based Gym Management System built with PHP and MySQL. It provides three role-based portals — Admin, Trainer, and Member — for managing gym memberships, workout and diet plans, attendance, billing, and in-app messaging between trainers and members.
- Secure admin login (
admin.php) and dashboard (admin_dashboard.php) - Add new members and trainers (
add_member.php,add_trainer.php) - View and manage member and trainer lists (
view_members.php,view_trainers.php) - View detailed member/trainer profiles (
member_detail.php,trainer_detail.php) - Generate member bills/invoices (
generate_bill.php) - View reports and analytics (
reports.php) - Send email notifications (
admin_email.php)
- Trainer registration and login (
trainer_register.php,trainer_login.php) - Trainer dashboard and profile management (
trainer_dashboard.php,trainer_profile.php) - Chat and inbox for communicating with members (
trainer_chat.php,trainer_inbox.php) - Assign workout and diet plans to members (
assign_plans.php,manage_workouts.php,manage_diets.php)
- Member registration and login (
member_register.php,member_login.php) - Member dashboard and profile management (
member_dashboard.php,member_profile.php) - Track attendance (
member_attendance.php) - BMI calculator (
member_bmi.php) - View assigned workout/diet plans (
view_my_plans.php) - Make/view payments (
member_payment.php) - Chat and inbox for communicating with trainers (
member_chat.php,member_inbox.php)
- Landing page (
index.html,index.php) - Centralized database connection (
db.php) - Shared stylesheet (
style.css) - Session logout (
logout.php)
- Backend: PHP (procedural,
mysqliextension) - Database: MySQL / MariaDB
- Frontend: HTML, CSS
- Server environment: Apache (e.g. via XAMPP/WAMP/MAMP)
- PHP 7.4+ with the
mysqliextension enabled - MySQL or MariaDB
- A local server stack such as XAMPP, WAMP, or MAMP (recommended for easy setup)
-
Clone the repository
git clone https://github.com/tcoder14/Smart-Gym.git
-
Move the project into your server's web root For example, with XAMPP:
mv Smart-Gym /path/to/xampp/htdocs/
-
Create the database Create a MySQL database named
gym_project(matching the name configured indb.php):CREATE DATABASE gym_project;
Note: This repository does not currently include a
.sqlschema file. You'll need to create the tables required by the application (members, trainers, admins, plans, attendance, payments, messages, etc.) based on the fields referenced in the PHP files, or export your working schema and add it to the project asgym_project.sqlfor others to import. -
Configure the database connection
db.phpis set up for a default local environment:$host = "localhost"; $username = "root"; $password = ""; $dbname = "gym_project";
Update these values to match your own MySQL credentials if different.
-
Start Apache and MySQL from your XAMPP/WAMP/MAMP control panel.
-
Open the app in your browser
http://localhost/Smart-Gym/index.php
- Visit the landing page and choose to log in or register as a Member or Trainer.
- Admins log in separately via the admin portal to manage members, trainers, plans, billing, and reports.
- Members and trainers can message each other through the built-in chat/inbox system.
- The included
db.phpuses a blank root password, which is standard for local development only. Do not use these credentials in a production deployment. - Consider moving credentials to environment variables and adding input sanitization/prepared statements throughout if deploying beyond local/academic use.
Smart-Gym/
├── admin.php # Admin login
├── admin_dashboard.php # Admin dashboard
├── admin_email.php # Admin email notifications
├── add_member.php # Add new member
├── add_trainer.php # Add new trainer
├── assign_plans.php # Assign workout/diet plans
├── db.php # Database connection
├── generate_bill.php # Billing/invoice generation
├── index.html / index.php # Landing page
├── logout.php # Session logout
├── manage_diets.php # Diet plan management
├── manage_workouts.php # Workout plan management
├── member_*.php # Member portal (auth, dashboard, chat, BMI, attendance, payments, etc.)
├── trainer_*.php # Trainer portal (auth, dashboard, chat, profile)
├── reports.php # Reporting
├── view_members.php # List of members
├── view_trainers.php # List of trainers
├── style.css # Stylesheet