Skip to content

Jaser1010/gym-management-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Gym Logo

Gym Management System

Full-Stack Web Application Β· ASP.NET Core MVC Β· Layered Architecture


.NET 8 C# ASP.NET Core MVC EF Core SQL Server Bootstrap

GitHub repo size GitHub last commit GitHub stars License: MIT


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.


πŸš€ Quick Start Β· πŸ› Report Bug Β· πŸ’‘ Request Feature



πŸ“‘ Table of Contents

Click to expand


⚑ Highlights

πŸ‘₯ 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 UnitOfWork coordinates all repositories. GenericRepository<T> provides type-safe CRUD out of the box, with specialized repos for sessions, bookings, and memberships.


πŸ› Architecture Overview

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 Responsibilities

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.

πŸ“ Solution Structure

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

πŸ› οΈ Tech Stack

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

🎯 Features in Detail

πŸ‘₯ Members

  • 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

πŸ‹οΈ Trainers

  • Full CRUD with photo upload
  • Specialty selection: Fitness, Yoga, CrossFit, Bodybuilding
  • Certified trainer profiles with contact details

πŸ“… Sessions

  • Create sessions with title, description, location, date/time, duration, and capacity
  • Assign a trainer and category to each session
  • Dropdown selections powered by CategorySelectViewModel and TrainerSelectViewModel
  • Session lifecycle tracking (Upcoming / Ongoing / Completed)

πŸ“‹ Bookings

  • Book members into specific sessions
  • View enrolled member lists for ongoing and upcoming sessions
  • Capacity-aware booking with member-session many-to-many relationship

πŸ’³ Memberships & Plans

  • 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

πŸ“Š Analytics Dashboard

  • At-a-glance dashboard with totals: Members, Trainers, Sessions, Plans
  • Powered by the AnalyticsService aggregation logic

πŸš€ Quick Start

Prerequisites

Requirement Minimum Version Download
.NET SDK 8.0 dotnet.microsoft.com
SQL Server Any recent SQL Server Downloads
Visual Studio 2022+ visualstudio.com

Step-by-Step Setup

# 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.


βš™οΈ Configuration

// appsettings.Development.json
{
  "ConnectionStrings": {
    "DefaultConnection": "Server=.;Database=GymManagementDb;Trusted_Connection=True;TrustServerCertificate=True;"
  }
}

πŸ”¬ Design Patterns

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

πŸ—ΊοΈ Roadmap

βœ… Completed

  • 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)

πŸ”œ Coming Soon

  • πŸ’° 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

🀝 Contributing

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-feature

πŸ“„ License

Distributed under the MIT License.


πŸ‘€ Author

Jaser Kasim
Software Engineer

GitHub LinkedIn

If you found this project helpful, consider giving it a ⭐

Built with ❀️ using C# and ASP.NET Core MVC

About

Gym management web app built with ASP.NET Core MVC. Provides role-based access, CRUD for members, trainers & plans; supports session scheduling & billing; uses layered architecture with SQL Server and EF Core.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors