A desktop GUI built with Tkinter that manages members, trainers, plans, transactions, and attendance for a gym. It uses MySQL (via mysql-connector-python
) with a small set of stored procedures and triggers to keep data consistent.
- Members: add/update/delete/list; email/phone uniqueness
- Trainers: add/update/delete/list; capacity (10) & one-trainer-per-member constraint
- Plans: add/update/delete/list; assign active plan (only 1 active)
- Transactions: record payments; auto-link to active plan (trigger)
- Attendance: clock-in/out; close stale opens via proc
- Input validation via decorators
- OOP with abstract base classes & inheritance
- Python 3.10+
- MySQL Server 8.x
pip install -r requirements.txt
-
Create the schema and routines:
mysql -u root -p -e "CREATE DATABASE IF NOT EXISTS gym_manager CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci;" mysql -u root -p gym_manager < sql/schema.sql mysql -u root -p gym_manager < sql/routines.sql mysql -u root -p gym_manager < sql/sample_data.sql
-
Update DB credentials in
config.py
. -
Run the app:
python app.py
- If procedures aren't installed, the app falls back to safe default behavior in Python (e.g., assigning plans).
- Ensure MySQL bin is in your PATH if Windows shows
'mysql' is not recognized...
.- Example: add
C:\Program Files\MySQL\MySQL Server 8.0\bin
to PATH.
- Example: add