Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fitness Center Management and Appointment System

A fitness center management and appointment system developed with ASP.NET Core MVC.

Project Status

📅 Commit 1 (Day 1-3): ✅ Completed

  • ASP.NET Core MVC project created
  • Entity Framework Core models defined (Gym, Service, Trainer, Availability, MemberProfile, Appointment)
  • DbContext relationships configured
  • SQL Server LocalDB database set up and migration applied

📅 Commit 2 (Day 4-6): ✅ Completed

  • Identity roles configured (Admin, Member)
  • Seed data hosted service created
  • Default admin user seeded (g231210375@sakarya.edu.tr / sau)
  • Role-based authorization setup ready

📅 Commit 3-5: ✅ Completed

  • Admin Panel with modern sidebar navigation
  • Gym CRUD operations
  • Service CRUD operations
  • Trainer CRUD operations
  • User Management with role assignment
  • Dashboard with statistics

📅 Commit 6: ✅ Completed

  • AI Recommendation System (OpenAI integration)
  • Member Area for AI recommendations
  • UI/UX improvements
  • Navigation fixes

📅 Commit 7 (Current): ✅ Completed

  • REST API endpoints with LINQ filtering (TrainersApiController, AppointmentsApiController)
  • Admin Panel appointment management (approve/reject/delete)
  • Swagger/OpenAPI integration
  • Complete appointment booking system with conflict detection

Features

  • ✅ Database models and relationships
  • ✅ Identity and role-based authorization (Admin, Member)
  • ✅ Gym and service management (fitness, yoga, pilates, etc.)
  • ✅ Trainer management, expertise areas, and availability schedules
  • ✅ Admin Panel with full CRUD operations
  • ✅ AI-powered exercise and diet recommendations (OpenAI integration)
  • ✅ Appointment booking, conflict detection, and approval mechanism
  • ✅ REST API and LINQ filtering (available trainers, member appointments, etc.)

Technologies

  • .NET 9, ASP.NET Core MVC
  • Entity Framework Core, SQL Server LocalDB
  • Bootstrap 5, jQuery, Validation
  • OpenAI API (for AI recommendations)
  • Swagger/OpenAPI (for API documentation)

Developer

  • Kağan Aydoğan — g231210375 — Sakarya University, Computer Engineering, 3rd Year
  • Course: Web Programming (Evening Education Group A)
  • Email: kagan.aydogan@ogr.sakarya.edu.tr

Getting Started

Prerequisites

  • .NET 9 SDK
  • SQL Server LocalDB
  • Visual Studio 2022 or VS Code (recommended)

Installation

  1. Clone the repository:
git clone https://github.com/kaganay/Wbprojectg231210375.git
cd Wbprojectg231210375
  1. Restore packages and build:
dotnet restore
dotnet build
  1. Update database (if needed):
dotnet ef database update -p ./FitnessCenter.Web -s ./FitnessCenter.Web
  1. Run the application:
cd FitnessCenter.Web
dotnet run

The application will be available at:

  • HTTP: http://localhost:5157
  • HTTPS: https://localhost:7206
  • Swagger UI: https://localhost:7206/api-docs (Development only)

Project Structure

FitnessCenter.Web/
├── Controllers/        # MVC Controllers
│   └── Api/          # REST API Controllers (TrainersApiController, AppointmentsApiController)
├── Models/            # Domain models (Gym, Service, Trainer, etc.)
├── Views/             # Razor views
├── Data/              # DbContext and migrations
├── Areas/             # Admin and Member areas
│   ├── Admin/        # Admin panel (Dashboard, Gyms, Services, Trainers, Users, Appointments)
│   └── Member/       # Member area (AI Recommendations, Appointments)
└── wwwroot/           # Static files (CSS, JS, images)

Default Admin Credentials

The admin user is automatically created on first application startup via SeedDataHostedService.

AI Recommendations

The system includes an AI-powered recommendation feature that provides personalized exercise and diet plans based on user metrics (height, weight, body type, goals).

To use AI recommendations:

  1. Register as a Member user
  2. Navigate to "AI Öneri" in the menu
  3. Fill in your body metrics and goals
  4. Get personalized recommendations powered by OpenAI

Note: OpenAI API key must be configured in appsettings.Development.json:

{
  "OpenAI": {
    "ApiKey": "your-api-key-here"
  }
}

REST API Endpoints

The application provides REST API endpoints for trainers and appointments management:

Trainers API (/api/trainers)

  • GET /api/trainers - List all trainers (with optional filters: gymId, expertise)
  • GET /api/trainers/available?date=YYYY-MM-DD&startTime=HH:mm&endTime=HH:mm - Get available trainers for a specific date/time
  • GET /api/trainers/{id} - Get trainer details

Appointments API (/api/appointments)

  • GET /api/appointments - Get user's appointments (with optional filters: status, startDate, endDate)
  • GET /api/appointments/{id} - Get appointment details
  • GET /api/appointments/all - Get all appointments (Admin only, with filters: status, trainerId, startDate, endDate)

Example API calls:

# Get all trainers
GET /api/trainers

# Get available trainers on 2024-12-01 between 10:00-11:00
GET /api/trainers/available?date=2024-12-01&startTime=10:00&endTime=11:00

# Get pending appointments
GET /api/appointments?status=Pending

All API endpoints use LINQ queries for filtering and are documented in Swagger UI.

Admin Panel - Appointment Management

Admins can manage appointments through the Admin Panel:

  • View all appointments with filtering (status, trainer, date range)
  • Approve or reject pending appointments
  • View appointment details
  • Delete appointments

Access the appointment management at: /Admin/Appointments

Development Plan

This project is developed incrementally with commits every 3 days over a 1-month period.

See PROJECT_PLAN.md for detailed development schedule.

License

Educational project - Sakarya University

About

A Fitness Center Management and Appointment System project developed with ASP.NET Core MVC. Includes user roles, appointment management, a LINQ-based REST API, and AI-powered exercise recommendation features.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages