A comprehensive, production-ready gym management solution featuring role-based access control, real-time member tracking, multi-branch operations, and complete audit compliance.
Features • Installation • Architecture • Documentation • Screenshots
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
| 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 |
- 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
- 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
| Component | Technology |
|---|---|
| Language | Java 17+ |
| GUI Framework | Java Swing |
| Database | MySQL 8.0+ |
| JavaMail API 1.6.2 | |
| PDF Generation | Apache PDFBox 2.0.29 |
| Date Picker | JCalendar 1.4 |
| Character Set | UTF-8 (Arabic & Emoji support) |
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
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
| 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 |
┌─────────────┐ ┌─────────────┐ ┌──────────────────┐
│ 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 │
└─────────────┘ └─────────────┘
git clone https://github.com/yourusername/System_Gym.git
cd System_GymOption A: Automated Setup (Windows)
setup_database.batOption 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;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";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/Windows (Command Prompt)
javac -cp "lib/*;src" -d out src/**/*.java
java -cp "lib/*;out" LOGINWindows (PowerShell)
javac -cp "lib/*;src" -d out (Get-ChildItem -Recurse src/*.java).FullName
java -cp "lib/*;out" LOGIN┌─────────────────────────────────────────────────────────┐
│ 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 │
└─────────────────────────────────────────────────────────┘
| 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 |
| Role | Username | Password |
|---|---|---|
| Owner | owner |
Owner@123 |
| Admin | admin |
Admin@123 |
| Coach | coach |
Coach@123 |
⚠️ Security Note: Change default passwords immediately after first login.
Modern login interface with role-based redirection
Comprehensive system overview with branch statistics
Revenue analytics, membership distribution, and quarterly growth trends
Configure gym-wide settings and business rules
Detailed activity tracking with filters
Branch-focused management interface
Member-centric training and progress tracking
// 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");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);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);-- Run in MySQL
SOURCE sql/check_database_status.sql;Set smtp.dryrun=true in smtp.properties to log emails to logs/emails/ instead of sending.
| 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 |
- Email logs:
logs/emails/ - Application errors: Console output
| 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 |
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Web-based dashboard companion
- Mobile app for members
- Biometric attendance integration
- Payment gateway integration
- Automated subscription reminders
- Workout plan templates
- Nutrition tracking module
This project is developed for educational purposes. Feel free to use, modify, and distribute for learning.
- Java Swing UI Guidelines by Oracle
- MySQL Documentation
- Apache PDFBox Team
- JCalendar Library
Made with ❤️ for Fitness Management