A comprehensive gym management platform with member registration, trainer management, session scheduling, membership plans, booking workflows, health records, analytics dashboard, and file attachment support β built on a strict three-layer architecture separating UI, business logic, and data access.
Click to expand
|
π₯ Member Management Complete CRUD operations for gym members with profile photos (file upload), personal info, gender, and linked health records with BMI, blood pressure, and medical notes. |
ποΈ Trainer Management Full trainer profiles with specialties (Fitness, Yoga, CrossFit, Bodybuilding), certifications, photo uploads, and linked session assignments. |
|
π Session Scheduling Create, edit, and manage gym sessions β each linked to a trainer, category, time slot, capacity, and location. Tracks session status (Upcoming, Ongoing, Completed). |
π Booking System Book members into sessions with capacity tracking. View member lists for upcoming and ongoing sessions. Manage member-session relationships via a many-to-many join. |
|
π³ Membership & Plans Create subscription plans with pricing, duration, and descriptions. Assign members to plans with start/end dates. Track membership histories per member. |
π Analytics Dashboard Overview page with total counts for members, trainers, sessions, and plans β giving managers a quick operational snapshot. |
|
ποΈ Layered Architecture (PL / BLL / DAL) Three dedicated projects with strict separation β swap your data layer, modify business rules, or redesign the UI independently. |
π¦ Unit of Work + Generic Repository
|
The project follows a classic 3-Tier Layered Architecture:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β PRESENTATION LAYER (PL) β
β GymManagementPL β
β MVC Controllers Β· Razor Views Β· Static Assets Β· CSS β
β Bootstrap 5 Β· jQuery Validation Β· wwwroot β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β BUSINESS LOGIC LAYER (BLL) β
β GymManagementBLL β
β Services Β· ViewModels Β· AutoMapper Profiles β
β Business Rules Β· Validation Β· Data Transformation β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββ
β DATA ACCESS LAYER (DAL) β
β GymManagementDAL β
β EF Core DbContext Β· Entities Β· Repositories Β· UnitOfWork β
β Fluent API Configs Β· Migrations Β· Data Seeding β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Layer | Project | Description |
|---|---|---|
| PL | GymManagementPL |
7 MVC controllers, Razor views (CRUD + Detail pages), _Layout.cshtml with navigation, Bootstrap 5 + custom CSS, static file serving, Program.cs entry point with DI configuration, auto-migration & seeding. |
| BLL | GymManagementBLL |
7 services (MemberService, TrainerService, PlanService, SessionService, MembershipService, BookingService, AnalyticsService), AttachmentService for file uploads, AutoMapper MappingProfiles, and comprehensive ViewModels for each domain. |
| DAL | GymManagementDAL |
GymDbContext with Fluent API, 11+ entities (Member, Trainer, Session, Plan, MemberShip, MemberSession, Category, HealthRecord, GymUser, BaseEntity), GenericRepository<T>, specialized repositories, UnitOfWork, 9 EF Configurations, data seeding, 6 migrations. |
GymManagementSystem/
β
βββ GymManagementDAL/ # Data Access Layer
β βββ Entities/ # Domain models
β β βββ BaseEntity.cs
β β βββ GymUser.cs
β β βββ ApplicationUser.cs
β β βββ Member.cs
β β βββ Trainer.cs
β β βββ Plan.cs
β β βββ Session.cs
β β βββ MemberShip.cs
β β βββ MemberSession.cs
β β βββ HealthRecord.cs
β β βββ Category.cs
β β βββ Enums/
β βββ Data/
β β βββ Contexts/ # GymDbContext
β β βββ Configurations/ # Fluent API entity configs
β β βββ DataSeed/ # GymDbContextSeeding, IdentityDbContextSeeding
β β βββ Migrations/
β βββ Repositories/
β βββ Interfaces/ # IGenericRepository, IUnitOfWork, ...
β βββ Classes/ # GenericRepository, UnitOfWork, ...
β
βββ GymManagementBLL/ # Business Logic Layer
β βββ Services/
β β βββ Interfaces/ # IMemberService, ITrainerService, ...
β β βββ Classes/ # MemberService, TrainerService, ...
β β βββ AttachmentService/ # File upload handling
β βββ ViewModels/ # Per-feature ViewModels (CRUD + Select)
β β βββ MemberViewModels/
β β βββ TrainerViewModels/
β β βββ SessionViewModels/
β β βββ PlanViewModels/
β β βββ MembershipViewModels/
β β βββ BookingViewModels/
β β βββ AnalyticsViewModels/
β β βββ AccountViewModels/
β βββ MappingProfiles.cs # AutoMapper profiles for all entities
β
βββ GymManagementPL/ # Presentation Layer
βββ Controllers/
β βββ AccountController.cs
β βββ HomeController.cs
β βββ MemberController.cs
β βββ TrainerController.cs
β βββ PlanController.cs
β βββ SessionController.cs
β βββ MembershipController.cs
β βββ BookingController.cs
βββ Views/ # Razor views per controller
βββ Program.cs
βββ appsettings.json
| Category | Technology | Purpose |
|---|---|---|
| Runtime | .NET 8.0+ | Long-term support runtime |
| Framework | ASP.NET Core MVC | Server-rendered views with Razor |
| Language | C# 12 | Primary language (50.5%) |
| ORM | Entity Framework Core | Database access, migrations & Fluent API |
| Database | SQL Server | Relational data store |
| Mapping | AutoMapper | Entity β ViewModel mapping |
| Frontend | Bootstrap 5 + Custom CSS | Responsive UI (44.9% HTML, 4.5% CSS) |
| Validation | jQuery Validation + Data Annotations | Client + server-side validation |
| Patterns | Repository, Unit of Work, DI, ViewModel, Service Layer | Enterprise design patterns |
| Architecture | 3-Tier Layered (PL / BLL / DAL) | Separation of concerns |
- Create members with name, email, phone, gender, date of birth, and profile photo upload
- Edit and delete member profiles
- View detailed member cards with all personal information
- Health Records β Dedicated health tracking per member (BMI, blood pressure, height, weight, notes)
- Health record create, view, and edit flows
- Full CRUD with photo upload
- Specialty selection: Fitness, Yoga, CrossFit, Bodybuilding
- Certified trainer profiles with contact details
- Create sessions with title, description, location, date/time, duration, and capacity
- Assign a trainer and category to each session
- Dropdown selections powered by
CategorySelectViewModelandTrainerSelectViewModel - Session lifecycle tracking (Upcoming / Ongoing / Completed)
- Book members into specific sessions
- View enrolled member lists for ongoing and upcoming sessions
- Capacity-aware booking with member-session many-to-many relationship
- Define plans with name, price, duration, max freeze days, and description
- Assign members to plans with start/end dates
- View all memberships for a specific member
- Track active vs. expired memberships
- At-a-glance dashboard with totals: Members, Trainers, Sessions, Plans
- Powered by the
AnalyticsServiceaggregation logic
| Requirement | Minimum Version | Download |
|---|---|---|
| .NET SDK | 8.0 | dotnet.microsoft.com |
| SQL Server | Any recent | SQL Server Downloads |
| Visual Studio | 2022+ | visualstudio.com |
# 1. Clone the repository
git clone https://github.com/Jaser1010/gym-management-system.git
cd gym-management-system
# 2. (Optional) Switch to the most advanced branch
git checkout Ass_5
# 3. Update connection string in appsettings.Development.json if needed
# 4. Restore packages
dotnet restore
# 5. Run (auto-migrates DB + seeds categories & plans on startup)
dotnet run --project GymManagementPLπ‘ Tip: The database is automatically migrated and seeded with categories and plans from JSON files on first startup.
| Pattern | Where used |
|---|---|
| Repository | IGenericRepository<T> + entity-specific repositories |
| Unit of Work | IUnitOfWork coordinates all repositories |
| Service Layer | BLL services encapsulate all business logic |
| AutoMapper | ViewModel β Entity mapping in MappingProfiles.cs |
| Data Seeding | GymDbContextSeeding + IdentityDbContextSeeding |
| Dependency Injection | All services/repos registered in Program.cs |
- Member CRUD with profile photos and health records
- Trainer CRUD with specialties and photos
- Session scheduling with trainer/category assignment
- Booking system with capacity tracking
- Membership plans with pricing and duration
- Analytics dashboard
- Generic Repository + Unit of Work
- AutoMapper integration
- File attachment service
- JSON-based data seeding
- Auto DB migration
- Bootstrap 5 responsive UI (12K+ lines of custom CSS)
- Authentication & Authorization β ASP.NET Identity with role-based access (Admin, Trainer, Member)
- π° Billing & Invoicing β Payment tracking and invoice generation
- π§ Email Notifications β Membership renewal and session reminders
- π± Responsive Improvements β Mobile-first redesign
- π§ͺ Testing Suite β Unit and integration tests
- π³ Docker Support β Containerized deployment
Contributions are welcome! Fork the repo, create a feature branch, and submit a Pull Request.
git checkout -b feature/amazing-feature
git commit -m "feat: add amazing feature"
git push origin feature/amazing-featureDistributed under the MIT License.
|
Jaser Kasim
Software Engineer |
If you found this project helpful, consider giving it a β
Built with β€οΈ using C# and ASP.NET Core MVC