លំហសិក្សាធិការកម្ពុជា
V1.0
Many small and medium-sized gyms still manage members using paper forms, spreadsheets, and manual payment records. These methods can take time, cause data entry mistakes, and make it difficult for staff to know whether a member is active or has expired. This project proposes a Gym Membership Management System to make these tasks easier and more organized. The system will be a web application developed using Python, Flask, and MySQL, with Object-Oriented Programming principles. It will provide separate access for Admin, Staff, Trainer, and Member users. Admin and Staff can manage members, membership plans, payments, and attendance. Trainers can view assigned members and training sessions, while Members can view their own membership, payment, and attendance information. The system will also provide search, filtering, expiry status, and simple reports such as daily revenue and membership status. The application will use a four-layer structure: Model, Repository, Service, and Route. Development will follow five two-week sprints, with testing performed during development. The expected result is a working prototype that reduces manual work, keeps records organized, improves membership checking, and provides a clear way to manage gym information in one system.
Advanced OOP with Python
Python + Flask + MySQL
Course: Object-Oriented Programming II
Many small and medium-sized gyms still manage members using paper forms, spreadsheets, and manual payment records. Staff may need to check payment records and membership dates manually. This can cause duplicate records, incorrect information, and slow check-in processes.
As the number of members increases, managing these records becomes more difficult. A centralized system can store member information, membership plans, payments, and attendance in one place. It can also make it easier to check membership status and identify memberships that are about to expire.
Therefore, this project aims to develop a Gym Membership Management System that reduces manual work, improves record accuracy, and makes common gym management tasks faster and easier.
2. Objectives
General Objective
To develop a web-based Gym Membership Management System using Python, Flask, MySQL, and Object-Oriented Programming to manage members, memberships, payments, attendance, and basic gym reports.
Specific Objectives
4.1 Scope
| Role | Main Responsibility |
|---|---|
| Admin | Manages users, membership plans, payments, reports, and overall system information. |
| Staff | Registers members, manages memberships, records payments, and handles attendance. |
| Trainer | View assigned members and manages basic training session information. |
| Member | View their own profile, membership status, payment history, and attendance history |
| Gym Owner | Use reports to monitor memberships, revenue, and gym performance. |
6. Proposed System Features
| Module | Description |
|---|---|
| Authentication&Authorization | Login/logout ,password hashing ,sessions and role based access. |
| Member Management | Create, view, update, and delete member profiles. |
| Membership Plan Management | CRUD for plan name, duration, and price. |
| Membership Enrollment& Renewal | Assign plans, calculate expiry dates, and identify expiring or expired memberships. |
| Payment Recording& Verification | Record amount and method and verify payment Records. |
| Attendance Check in | Record check in time and allow check in only when memberships is active. |
| Training Sessions | Trainers can view assigned members and manage basic training session information. |
| Search& Filter | Search members and filter by plan or membership status |
| Reporting Dashboard | Show daily revenue, active memberships, and expiring/expired memberships. |
7. OOP Design Plan
The system will use Object-Oriented Programming so
each class has a clear responsibility. Admin, Staff, Trainer, and Member
inherit common features from User. Services use repositories to separate
business logic from database access.
| Class | Responsibility |
|---|---|
| User | Base class for system accounts and common user information. |
| Admin | Manages users, membership plans, payments ,and reports |
| Staff | Manages memberships, payments and attendance. |
| Trainer | Views assigned members and manages training sessions. |
| Member | Views personal membership, payments , and attendance. |
| Membership Plan | Defines a gym package, including name, duration, and price. |
| Membership | Represents a member's enrollment in a membership plan, including plan, including dates and status. |
| Payment | Represents a payment for a membership, including amount, date, method, and status |
| Attendance | Represents a member check in record |
| Training Session | Represents a schedule training session between a trainer and a member. |
| Service | Responsibility |
|---|---|
| Auth-Service | Login, password checking, sessions, and role checks. |
| User-Service | Creates accounts, updates profiles, and manages account status. |
| Membership-Service | Creates and renews memberships and calculates status. |
| Payment-Service | Records and verifies payments and creates revenue summaries |
| Attendance-Service | Records check in and checks active membership. |
| Training-Service | Manages trainer assignments and training sessions. |
| Repository | Responsibility |
|---|---|
| User-Repository | Reads and changes user data. |
| MembershipPlan-Repository | CRUD for membership plans. |
| Membership-Repository | CRUD for memberships and finds expiring/expired memberships. |
| Payment-Repository | CRUD for payments and calculates revenue totals |
| Attendance-Repository | Creates and reads attendance records. |
| TrainingScedule-Repository | Creates and reads training session record |
7.5Class Relationship
Figure 1. Simplified OOP class diagram showing domain, service, and repository layers
The system will use a four-layer architecture. The
browser sends a request to a Flask route. The route calls a service for
business logic. The service uses a repository to access MySQL.
The system will use a four-layer architecture. The
browser sends a request to a Flask route. The route calls a service for
business logic. The service uses a repository to access MySQL.
Figure 2. System
architecture: Browser → Flask routes → Services → Repositories → MySQL.
| Layer | Purpose |
|---|---|
| Browser/HTML/CSS | Provides the user interface |
| Flask Routes | Receives requests and returns pages or responses |
| Service | Handles business rules and validation |
| Repositories | Handles MySQL database operations |
| MySQL | Store system data permanently |
| Python OOP | Provides classes and OOP principles. |
9. Database Plan
Figure
3. Draft entity-relationship diagram (ERD) for the Gym membership sytem
database.
| Table | Main Columns | Purpose |
|---|---|---|
| roles | role_id (PK), role_name | Stores ADMIN,STAFF,TRAINER, and MEMBER. |
| users | user_id (PK), full_name, email, password_hash, role_id (FK), status | Stores user accounts. Email is unique |
| membership plans | plan_id (PK), plan_name, duration_months, price | Stores gym membership plans |
| memberships | membership_id (PK), member_id (FK), plan_id (FK), start_date, end_date, status | Connects a Member to a Membership Plans |
| payments | payment_id (PK), membership_id (FK), amount, payment_date, method, status | Stores membership payments |
| attendance | attendance_id (PK), member_id (FK), check_in_time | Stores member check ins |
| training schedule | schedule_id (PK), trainer_id (FK), member_id (FK), session_date, session_time, status | Stores training sessions |
Main Relationships
| Period | Main Tasks |
|---|---|
| Week1 | Requirements, research, OOP design, architecture, ERD, database schema, and project setup. |
| Week2 | Users, roles, authentication, authorization, and member profiles. |
| Week3 | Membership plans, memberships, expiry status, and renewal |
| Week4 | Payments, attendance, training sessions, search, filtering, and reports |
| Week5-6 | Integration, testing, bug fixing, security checks, documentation, screenshots, and final demo. |
| Risk | Impact | Mitigation |
|---|---|---|
| Large project scope | May be difficult to finish. | Keep only core features and move extra ideas to future work. |
| Unequal group contribution | Some members may not understand the whole project. | Use code reviews and make sure each member understands the main layers. |
| Testing takes too long | Bugs may remain until the deadline. | Test features during development. |
| Late database changes | Can cause integration problems. | Review the ERD before implementing repositories. |
| Team member unavailable | Tasks may be delayed. | Document work and share the project through Git. |
[1] A. D. Rahma, V. K. Bakti, and A. Basit, “Biometric
Based Personal Identification for Cashless Payment Systems in Gym Memberships,”
SISFO: Jurnal Ilmiah Sistem Informasi, vol. 10, no. 2, pp. 458–470, Oct. 2026.
[2] R. Trisudarmo, A. Ramdhani, D. Mardiyanti, and N.
A. Permatasari, “Web-Based Gym Membership System with Semi-Automated QRIS
Verification Developed Through Agile-Scrum,” Nusantara Journal of Artificial
Intelligence and Information Systems, vol. 2, no. 1, pp. 17–26, Jun. 2026.
[3] S. Chokhandre, A. Raut, R. Chhatre, and S.
Tarekar, “Gym Management System,” International Journal of Scientific Research
and Technology, vol. 2, no. 1, pp. 74–76, 2025.
[4] D. J. C. Sihombing, “Development of Membership
Management Application for Fitness Center using Extreme Programming
Methodology,” Jurnal Ekonomi, vol. 13, no. 2, pp. 736–744, 2024.