Zadx Tracking Gym
Enterprise-Grade Multi-Branch Gym Management System
A comprehensive, production-ready desktop application designed for gym chains and fitness centers. Built with Java Swing and MySQL, it provides role-based access control, real-time member tracking across multiple branches, training progress monitoring, financial analytics, and a complete audit trail system for compliance.
Contributors
Screenshots
A walkthrough of the application's key interfaces — from login to audit logs.
Modern Login Interface
A sleek glass-panel login screen with role-based redirection. Users enter credentials and are automatically routed to their role-specific dashboard — Owner, Admin, or Coach. Supports secure password hashing via BCrypt/PBKDF2 and email-based password reset.
Owner Dashboard — System-Wide Overview
The Owner dashboard provides a comprehensive view across all branches: total members, active subscriptions, revenue summaries, and branch performance comparisons. Full access to all system modules including branch creation, user management, system settings, and audit logs.
Admin Dashboard — Branch Management
Branch-scoped management interface for administrators. Displays member counts, coach assignments, subscription statuses, and branch-specific statistics. Admins can manage members and coaches within their assigned branch, view reports, and access audit logs.
Coach Dashboard — Training & Progress Tracking
Member-centric view for coaches showing their assigned members, upcoming training sessions, and progress history. Coaches can record workout sessions with detailed notes, track member progress over time, and update their personal profile.
Revenue Analytics & Financial Reports
Visual analytics showing revenue breakdowns by branch, quarterly growth trends, and subscription income over time. Supports CSV and PDF export of financial data for accounting and compliance purposes.
Membership Distribution & Growth
Membership analytics displaying active vs expired subscriptions, member distribution across branches, new registrations over time, and retention rates. Helps owners identify trends and optimize branch operations.
System Configuration Panel
Owner-exclusive settings panel for configuring gym-wide business rules, subscription plans, email SMTP settings, and application preferences. Changes propagate across all branches immediately.
Audit Trail & Activity Logs
Comprehensive activity logging with filters by user, action type, date range, and branch. Every system action is recorded with timestamp, user identity, and detailed description — ensuring full compliance and security traceability.
Key Features
Multi-Branch Management
Create, configure, and monitor multiple gym locations from a single application. Each branch operates independently with its own members, coaches, and settings while the owner maintains a consolidated overview across the entire chain.
Role-Based Access Control (RBAC)
Three-tier permission system — Owner, Admin, and Coach — with granular access controls. Each role sees only the dashboards, data, and actions relevant to their responsibilities. Permissions are enforced at both the UI and service layer.
Member Lifecycle Management
Complete member management from registration through subscription renewal. Track personal information, subscription status, payment history, assigned coach, and training progress. Supports subscription expiration alerts and renewal workflows.
Training Progress Tracking
Coaches record detailed workout sessions with progress notes for each member. The system maintains a chronological training history, enabling coaches and admins to monitor member progress over time and identify trends.
Comprehensive Reporting
Branch performance reports, membership analytics, revenue summaries, and subscription distribution charts. Data can be exported to CSV and PDF formats for external reporting and accounting needs.
Full Audit Trail
Every system action is logged with user identity, timestamp, action type, and detailed description. Filterable audit logs support compliance requirements and security investigations. Logs can be exported for external review.
Secure Authentication
BCrypt/PBKDF2 password hashing, singleton-based session management with timeout, and email-based password reset via SMTP. All authentication events are recorded in the audit log for security monitoring.
Modern Glass-Panel UI
Professionally designed Swing interface with consistent theming via UIThemeUtil, unified color scheme and typography, responsive layouts, and role-specific dashboards for intuitive navigation. Supports UTF-8 with Arabic and emoji characters.
Architecture
Zadx Tracking Gym follows a clean MVC architecture with a dedicated service layer for business logic. The DAO pattern encapsulates all database operations, and utility classes handle cross-cutting concerns like authentication, theming, and email.
Java Swing views organized by role — views/owner/, views/admin/, views/coach/, and views/shared/. Each dashboard is role-specific with relevant widgets and navigation. Glass-panel design with consistent theming via UIThemeUtil.
Six service classes — AuthenticationService, BranchService, MemberService, UserService, TrainingProgressService, and AuditService. Business rules, validation, and orchestration live here — not in views or DAOs.
Six DAO classes encapsulating all MySQL queries — UserDAO, MemberDAO, BranchDAO, AuditLogDAO, TrainingProgressDAO, and SystemSettingsDAO. Prepared statements prevent SQL injection. Connection pooling via DatabaseUtil.
Five core tables — branches, users, members, training_progress, and audit_logs. UTF-8mb4 character set for full Unicode support. Foreign key constraints enforce referential integrity across all relationships.
Design Patterns
MVC Architecture
Clear separation between Views (Swing panels), Services (business logic), and DAOs (data access). Views never query the database directly — all data flows through the service layer.
DAO Pattern
All database operations are encapsulated in dedicated DAO classes. Each DAO uses prepared statements to prevent SQL injection and handles connection management via the singleton DatabaseUtil.
Singleton Pattern
DatabaseUtil manages a single database connection pool. SessionManager maintains one active user session with timeout handling. Both ensure consistent resource management.
Factory Pattern
View creation is role-based — after login, the AuthenticationService determines the user's role and instantiates the appropriate dashboard (Owner, Admin, or Coach) via factory logic.
Tech Stack
| Component | Technology | Purpose |
|---|---|---|
| Language | Java 17+ | Core application language with modern features |
| GUI | Java Swing | Desktop UI framework with glass-panel custom theming |
| Database | MySQL 8.0+ | Relational data store with UTF-8mb4 support |
| JavaMail API 1.6.2 | SMTP-based password reset and notifications | |
| Apache PDFBox 2.0.29 | Report generation and data export to PDF | |
| Date Picker | JCalendar 1.4 | Calendar component for date selection in forms |
| Security | BCrypt / PBKDF2 | Secure password hashing and verification |
System Modules
The application is organized into six core modules, each with its own DAO, service, and model classes. This separation ensures maintainability and allows independent development of each feature domain.
Login, logout, session management with timeout, and email-based password reset. BCrypt/PBKDF2 password hashing. Role-based redirection to Owner, Admin, or Coach dashboard after successful login.
Create and configure multiple gym locations. Each branch has its own address, phone, and independent member/coach roster. Owners can compare branch performance metrics side-by-side.
CRUD operations for Owner, Admin, and Coach accounts. Role assignment with permission enforcement. User profiles with personal information and branch assignment for Admins and Coaches.
Complete member lifecycle — registration, subscription management, payment tracking, coach assignment, and progress monitoring. Subscription status tracking with expiration alerts and renewal workflows.
Coaches record workout sessions with detailed notes for each member. Chronological progress history enables tracking member development over time. Supports session date, exercise details, and performance metrics.
Every system action logged with user, timestamp, and details. Reports include branch performance, revenue analytics, membership distribution, and subscription trends. Export to CSV and PDF for external use.
User Roles & Permissions
A three-tier permission hierarchy ensures each user only accesses data and actions relevant to their responsibilities. Permissions are enforced at both the UI level (hiding inaccessible features) and the service layer (rejecting unauthorized operations).
| Role | Key | Capabilities |
|---|---|---|
| Owner | OWNER | Full system access — manage all branches, users, settings, view all reports and audit logs across the entire gym chain. |
| Admin | ADMIN | Manage members and coaches within assigned branch, view branch reports and performance metrics, access branch-scoped audit logs. |
| Coach | COACH | View and update assigned members, record training sessions and progress notes, update personal profile. |
Permission Matrix
| Feature | Owner | Admin | Coach |
|---|---|---|---|
| Dashboard | All branches | Assigned branch | Assigned members |
| Profile Management | ✅ | ✅ | ✅ |
| View Members | All | Branch only | Assigned only |
| Add/Edit Members | ✅ | ✅ | — |
| Manage Coaches | ✅ | ✅ | — |
| Training Progress | ✅ | ✅ | ✅ |
| Branch Management | ✅ | — | — |
| System Settings | ✅ | — | — |
| View Reports | All | Branch | — |
| Audit Logs | ✅ | ✅ | — |
| Export Data (CSV/PDF) | ✅ | ✅ | — |
Database Design
Five core tables with foreign key constraints enforcing referential integrity. The schema uses UTF-8mb4 character set for full Unicode support including Arabic text and emoji characters.
branches
├── users (branch_id → branches.branch_id)
│ ├── members (coach_id → users.user_id)
│ │ └── training_progress (member_id → members.member_id, coach_id → users.user_id)
│ └── audit_logs (user_id → users.user_id)
└── members (branch_id → branches.branch_id) Service API
All business logic is accessed through service classes. Views call services — never DAOs directly. Example usage patterns for the core services.
Authentication Service
AuthenticationService auth =
new AuthenticationService();
// Login with role-based redirect
LoginResult result =
auth.login("username", "password");
if (result.isSuccess()) {
User user = result.getUser().get();
// Routes to role dashboard
}
// Password reset via email
auth.initiatePasswordReset(
"user@email.com"
); Member Service
MemberService memberService =
new MemberService();
// Get branch members
List<Member> members =
memberService.getMembersByBranch(
branchId
);
// Add new member
Member m = new Member();
m.setFullName("Ahmed Hassan");
m.setEmail("ahmed@example.com");
memberService.addMember(m);
// Update subscription
memberService.updateSubscription(
memberId, newEndDate, amount
); Contributions
Zadx Tracking Gym is open-source and welcomes contributions. The clean MVC architecture makes it straightforward to add new features or improve existing modules.
Adding a New Module
Create model class in app/model/, DAO class in app/dao/, service class in app/service/, and view in app/views/. Follow existing patterns for database connection handling and session validation.
Code Standards
Java follows standard naming conventions — PascalCase for classes (MemberService), camelCase for methods (getMembersByBranch), and UPPER_SNAKE_CASE for constants. DAO methods use prepared statements exclusively.
Database Changes
Add SQL scripts to sql/ directory. Use utf8mb4 character set for all new tables. Include both schema creation and seed data in separate files. Update check_database_status.sql for verification.
Getting Started
Clone the repo, install Java 17+ and MySQL 8, run sql/schema_and_seed.sql, configure database credentials in DatabaseUtil.java, then compile and run with the JARs in lib/ on the classpath.
Project Structure
System_Gym/
├── src/
│ ├── app/
│ │ ├── dao/ # Data Access Layer (6 DAOs)
│ │ ├── model/ # Domain Entities (8 models)
│ │ ├── service/ # Business Logic (6 services)
│ │ ├── util/ # Utilities (8 helpers)
│ │ │ ├── DatabaseUtil ├── SessionManager
│ │ │ ├── PasswordUtil ├── EmailService
│ │ │ ├── UIThemeUtil ├── ValidationUtil
│ │ │ ├── CSVUtil └── DateUtil
│ │ └── views/ # Swing UI
│ │ ├── LoginView.java
│ │ ├── owner/ # Owner dashboards
│ │ ├── admin/ # Admin dashboards
│ │ ├── coach/ # Coach dashboards
│ │ └── shared/ # Shared components
│ ├── config/
│ │ └── smtp.properties # Email configuration
│ └── Images/ # UI assets
├── sql/ # Database scripts
│ ├── schema_and_seed.sql
│ └── check_database_status.sql
├── lib/ # External JARs
│ ├── javax.mail-1.6.2.jar
│ ├── pdfbox-2.0.29.jar
│ ├── jcalendar-1.4.jar
│ └── ...
├── docs/ # Documentation
│ ├── database-schema-documentation.md
│ ├── database-er-diagram.md
│ └── view-layer-documentation.md
└── logs/ # Application logs