Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zadx Tracking Gym

Enterprise-Grade Multi-Branch Gym Management System

Java MySQL License Status

A comprehensive, production-ready gym management solution featuring role-based access control, real-time member tracking, multi-branch operations, and complete audit compliance.

FeaturesInstallationArchitectureDocumentationScreenshots


Overview

Zadx Tracking Gym is a full-featured desktop application designed for gym chains and fitness centers to manage their operations efficiently. Built with Java Swing and MySQL, it provides a robust, secure, and scalable solution for:

  • Managing multiple gym branches from a single interface
  • Tracking member subscriptions, payments, and attendance
  • Monitoring coach performance and training sessions
  • Generating comprehensive reports and analytics
  • Maintaining complete audit trails for compliance

Features

Core Functionality

Module Description
Branch Management Create, configure, and monitor multiple gym locations with independent operations
User Management Role-based access control with Owner, Admin, and Coach roles
Member Management Complete member lifecycle from registration to subscription renewal
Training Progress Track workout sessions, progress notes, and coach-member interactions
Reporting Branch performance reports, membership analytics, and financial summaries
Audit System Comprehensive logging of all system actions for security and compliance

Security Features

  • Password Hashing: BCrypt/PBKDF2 secure password storage
  • Session Management: Singleton-based session handling with timeout
  • Role-Based Access Control (RBAC): Granular permissions per user role
  • Audit Logging: Every action tracked with user, timestamp, and details
  • Email Verification: Secure password reset via SMTP

User Interface

  • Modern Glass-Panel Design: Sleek, professional appearance
  • Consistent Theming: Unified color scheme and typography via UIThemeUtil
  • Responsive Layouts: Adaptable to different screen sizes
  • Intuitive Navigation: Role-specific dashboards for quick access

Technology Stack

Component Technology
Language Java 17+
GUI Framework Java Swing
Database MySQL 8.0+
Email JavaMail API 1.6.2
PDF Generation Apache PDFBox 2.0.29
Date Picker JCalendar 1.4
Character Set UTF-8 (Arabic & Emoji support)

Dependencies

lib/
├── activation-1.1.1.jar      # JavaBeans Activation Framework
├── fontbox-2.0.29.jar        # Font handling for PDFBox
├── javax.mail-1.6.2.jar      # JavaMail API for email
├── jcalendar-1.4.jar         # Date picker component
└── pdfbox-2.0.29.jar         # PDF generation

Architecture

Project Structure

System_Gym/
│
├── src/
│   ├── app/
│   │   ├── dao/                    # Data Access Layer 
│   │   │   ├── AuditLogDAO.java
│   │   │   ├── BranchDAO.java
│   │   │   ├── MemberDAO.java
│   │   │   ├── SystemSettingsDAO.java
│   │   │   ├── TrainingProgressDAO.java
│   │   │   └── UserDAO.java
│   │   │
│   │   ├── model/                  # Domain Entities
│   │   │   ├── AuditLog.java
│   │   │   ├── Branch.java
│   │   │   ├── Member.java
│   │   │   ├── RegistrationUser.java
│   │   │   ├── SystemSetting.java
│   │   │   ├── TrainingProgress.java
│   │   │   ├── User.java
│   │   │   └── UserRole.java
│   │   │
│   │   ├── service/                # Business Logic Layer
│   │   │   ├── AuditService.java
│   │   │   ├── AuthenticationService.java
│   │   │   ├── BranchService.java
│   │   │   ├── MemberService.java
│   │   │   ├── TrainingProgressService.java
│   │   │   └── UserService.java
│   │   │
│   │   ├── util/                   # Utility Classes
│   │   │   ├── CSVUtil.java
│   │   │   ├── DatabaseUtil.java
│   │   │   ├── DateUtil.java
│   │   │   ├── EmailService.java
│   │   │   ├── PasswordUtil.java
│   │   │   ├── SessionManager.java
│   │   │   ├── UIThemeUtil.java
│   │   │   └── ValidationUtil.java
│   │   │
│   │   └── views/                  # Presentation Layer
│   │       ├── AuditLogsView.java
│   │       ├── LoginView.java
│   │       ├── admin/
│   │       │   ├── AdminDashboard.java
│   │       │   ├── AdminProfileView.java
│   │       │   ├── BranchReportsView.java
│   │       │   └── ManageCoachesView.java
│   │       ├── coach/
│   │       │   ├── CoachDashboard.java
│   │       │   ├── CoachMembersView.java
│   │       │   ├── CoachProfileView.java
│   │       │   └── TrainingProgressView.java
│   │       ├── owner/
│   │       │   ├── OwnerDashboard.java
│   │       │   └── SystemSettingsView.java
│   │       └── shared/
│   │
│   ├── config/
│   │   └── smtp.properties         # Email configuration
│   │
│   ├── Images/                     # UI Assets
│   └── Project/
│       └── ConnectionProvider.java # Legacy DB connection
│
├── sql/                            # Database Scripts
│   ├── schema_and_seed.sql         # Main schema + seed data
│   ├── realistic_data_all_quarters.sql
│   ├── check_database_status.sql
│   └── ...
│
├── docs/                           # Documentation
│   ├── database-schema-documentation.md
│   ├── database-er-diagram.md
│   └── view-layer-documentation.md
│
├── lib/                            # External JARs
├── logs/                           # Application logs
│   └── emails/                     # Email dry-run logs
│
└── README.md

Design Patterns

Pattern Implementation
MVC Separation of Views, Services, and DAOs
Singleton DatabaseUtil, SessionManager
DAO Pattern All database operations encapsulated in DAO classes
Service Layer Business logic isolated from presentation
Factory Pattern View creation based on user role

Database Schema

┌─────────────┐       ┌─────────────┐       ┌──────────────────┐
│  branches   │───────│    users    │───────│ training_progress│
│             │  1:M  │             │  1:M  │                  │
│ branch_id   │       │ user_id     │       │ progress_id      │
│ branch_name │       │ username    │       │ member_id        │
│ address     │       │ password    │       │ coach_id         │
│ phone       │       │ role        │       │ session_date     │
└─────────────┘       │ branch_id   │       │ notes            │
      │               └─────────────┘       └──────────────────┘
      │                     │
      │ 1:M                 │ 1:M
      │                     │
┌─────────────┐       ┌─────────────┐
│   members   │       │ audit_logs  │
│             │       │             │
│ member_id   │       │ log_id      │
│ full_name   │       │ user_id     │
│ subscription│       │ action      │
│ coach_id    │       │ timestamp   │
│ branch_id   │       │ details     │
└─────────────┘       └─────────────┘

Installation

Prerequisites

Step 1: Clone the Repository

git clone https://github.com/yourusername/System_Gym.git
cd System_Gym

Step 2: Database Setup

Option A: Automated Setup (Windows)

setup_database.bat

Option B: Manual Setup

-- Connect to MySQL
mysql -u root -p

-- Create database
CREATE DATABASE gymm CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
USE gymm;

-- Run schema and seed
SOURCE sql/schema_and_seed.sql;

Step 3: Configure Database Connection

Edit src/app/util/DatabaseUtil.java if needed:

private static final String DEFAULT_HOST = "localhost";
private static final String DEFAULT_PORT = "3306";
private static final String DEFAULT_DATABASE = "gymm";
private static final String DEFAULT_USER = "root";
private static final String DEFAULT_PASSWORD = "root";

Step 4: Configure Email (Optional)

Edit src/config/smtp.properties:

# Enable/disable email functionality
smtp.enabled=true
smtp.dryrun=false

# Gmail SMTP Configuration
mail.smtp.host=smtp.gmail.com
mail.smtp.port=587
mail.smtp.auth=true
mail.smtp.starttls.enable=true
mail.smtp.username=your-email@gmail.com
mail.smtp.password=your-app-password

# For testing without sending real emails
smtp.dryrun=true
smtp.dryrun.path=logs/emails/

Step 5: Run the Application

Windows (Command Prompt)

javac -cp "lib/*;src" -d out src/**/*.java
java -cp "lib/*;out" LOGIN

Windows (PowerShell)

javac -cp "lib/*;src" -d out (Get-ChildItem -Recurse src/*.java).FullName
java -cp "lib/*;out" LOGIN

User Roles & Permissions

Role Hierarchy

┌─────────────────────────────────────────────────────────┐
│                        OWNER                             │
│  • Full system access                                    │
│  • Manage all branches, users, and settings             │
│  • View all reports and audit logs                      │
└────────────────────────┬────────────────────────────────┘
                         │
┌────────────────────────▼────────────────────────────────┐
│                        ADMIN                             │
│  • Manage members and coaches within assigned branch    │
│  • View branch reports and performance metrics          │
│  • Access audit logs for their branch                   │
└────────────────────────┬────────────────────────────────┘
                         │
┌────────────────────────▼────────────────────────────────┐
│                        COACH                             │
│  • View and update assigned members                     │
│  • Record training sessions and progress notes          │
│  • Update personal profile                              │
└─────────────────────────────────────────────────────────┘

Detailed Permission Matrix

Feature Owner Admin Coach Description
Dashboard Role-specific dashboard with relevant metrics
Profile Management Update personal information
View Members ✅ All ✅ Branch ✅ Assigned Access to member records
Add/Edit Members Create and modify member profiles
Delete Members Remove member records
Manage Coaches Coach CRUD operations
Training Progress Record and view training sessions
Branch Management Create/configure branches
User Management Create admin/coach accounts
System Settings Configure application settings
View Reports ✅ All ✅ Branch Analytics and reports
Audit Logs Security and activity logs
Export Data CSV/PDF export functionality

Default Credentials

Role Username Password
Owner owner Owner@123
Admin admin Admin@123
Coach coach Coach@123

⚠️ Security Note: Change default passwords immediately after first login.


Screenshots

Login Screen

Modern login interface with role-based redirection

Login Screen

Owner Dashboard

Comprehensive system overview with branch statistics

Owner Dashboard

System Statistics

Revenue analytics, membership distribution, and quarterly growth trends

Statistics - Revenue

Statistics - Membership

System Settings

Configure gym-wide settings and business rules

System Settings

Audit Logs

Detailed activity tracking with filters

Audit Logs

Admin Dashboard

Branch-focused management interface

Admin Dashboard

Coach Dashboard

Member-centric training and progress tracking

Coach Dashboard


API Reference

Authentication Service

// Login
AuthenticationService auth = new AuthenticationService();
LoginResult result = auth.login("username", "password");

if (result.isSuccess()) {
    User user = result.getUser().get();
    // Redirect based on role
}

// Logout
auth.logout();

// Password Reset
auth.initiatePasswordReset("user@email.com");

Member Service

MemberService memberService = new MemberService();

// Get all members for a branch
List<Member> members = memberService.getMembersByBranch(branchId);

// Add new member
Member newMember = new Member();
newMember.setFullName("John Doe");
newMember.setEmail("john@example.com");
memberService.addMember(newMember);

// Update subscription
memberService.updateSubscription(memberId, newEndDate, amount);

Audit Service

AuditService auditService = new AuditService();

// Log an action
auditService.logAction(
    currentUser, 
    "MEMBER_CREATED", 
    "Created member: John Doe"
);

// Query logs
List<AuditLog> logs = auditService.getLogsByDateRange(startDate, endDate);

Testing

Database Connection Test

-- Run in MySQL
SOURCE sql/check_database_status.sql;

Email Configuration Test

Set smtp.dryrun=true in smtp.properties to log emails to logs/emails/ instead of sending.


Troubleshooting

Common Issues

Issue Solution
Database connection failed Verify MySQL is running and credentials in DatabaseUtil.java are correct
ClassNotFoundException Ensure all JARs in lib/ are in the classpath
Email not sending Check smtp.properties settings; use app password for Gmail
Characters not displaying Verify MySQL uses utf8mb4 character set
Login fails Run sql/check_database_status.sql to verify user data

Log Locations

  • Email logs: logs/emails/
  • Application errors: Console output

Documentation

Document Description
Database Schema Complete database documentation with all tables, relationships, and constraints
ER Diagram Visual representation of database relationships
View Layer Swing views documentation with UI patterns and guidelines

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Roadmap

  • Web-based dashboard companion
  • Mobile app for members
  • Biometric attendance integration
  • Payment gateway integration
  • Automated subscription reminders
  • Workout plan templates
  • Nutrition tracking module

License

This project is developed for educational purposes. Feel free to use, modify, and distribute for learning.


Acknowledgments

  • Java Swing UI Guidelines by Oracle
  • MySQL Documentation
  • Apache PDFBox Team
  • JCalendar Library

Made with ❤️ for Fitness Management

Back to Top

About

Zadx Tracking Gym is a full-featured desktop application designed for gym chains and fitness centers to manage their operations efficiently. Built with Java Swing and MySQL, it provides a robust, secure, and scalable solution

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages