An internal web application built with ASP.NET Core MVC and Entity Framework Core for managing users, sport areas, and reservations in a sports complex. The system centralizes information, prevents scheduling conflicts, and handles the full reservation lifecycle.
- Requirements
- Technology Stack
- Project Structure
- Database Setup
- Configuration
- Running the Application
- Features
- Business Rules
- Diagrams
- .NET 10 SDK
- MySQL 8.0 or higher
- Git
- EFC
- ASP.NET Core MVC (.NET 10)
- Entity Framework Core 9 with Pomelo MySQL provider
- MySQL as the relational database
- LINQ for data querying
List<T>andDictionary<TKey, TValue>for in-memory data management
DevelopTest/
├── Controllers/
│ ├── HomeController.cs
│ ├── UserController.cs
│ ├── SportAreaController.cs
│ └── ReservationController.cs
├── Models/
│ ├── User.cs
│ ├── SportArea.cs
│ └── Reservations.cs
├── Services/
│ ├── UserService.cs
│ ├── SportAreaService.cs
│ └── ReservationService.cs
├── Data/
│ └── MySqlDbContext.cs
├── Responses/
│ └── ServiceResponse.cs
├── appsettings.json
└── Program.cs
- Create a MySQL database:
CREATE DATABASE SportComplexDb;- The application uses EF Core migrations to create and update the schema automatically. After configuring the connection string (see next section), run:
dotnet ef migrations add InitialCreate
dotnet ef database updateIf the dotnet-ef tool is not installed, install it first:
dotnet tool install --global dotnet-efOpen appsettings.json and update the DefaultConnection string with your MySQL credentials:
{
"ConnectionStrings": {
"DefaultConnection": "server=YOUR_HOST;port=3306;database=SportComplexDb;user=YOUR_USER;password=YOUR_PASSWORD"
}
}Replace YOUR_HOST, YOUR_USER, and YOUR_PASSWORD with the appropriate values for your environment.
- Clone the repository:
git clone https://github.com/UlithG18/DevelopTest
cd DevelopTest- Restore dependencies:
dotnet restore- Apply database migrations:
dotnet ef database update- Run the application:
dotnet run- Open a browser and navigate to
https://localhost:5001orhttp://localhost:5000.
- Register new users with name, identity document, phone number, and email.
- Edit existing user information.
- Prevent duplicate users by validating uniqueness of identity document and email.
- List all registered users.
- Register sport areas with name, type (Soccer, Basketball, Pool, Tennis, Volleyball, Gym, Athletics, SkatePark), opening/closing hours, and capacity.
- Edit sport area information.
- Prevent duplicate sport areas.
- List all sport areas.
- Filter sport areas by type.
- Create reservations by linking a user, a sport area, a date, a start time, and an end time.
- Cancel a reservation, changing its status to
Canceled. - Mark a reservation as
Finished. - List reservations filtered by user.
- List reservations filtered by sport area.
The system enforces the following rules on every reservation operation:
- End time must be later than start time.
- Reservations cannot be created for past dates or times.
- A sport area cannot have two overlapping reservations in the same time range.
- A user cannot have more than one reservation in the same time range.
- All errors are handled with try-catch blocks and clear, user-friendly messages.
The following diagrams are included in the repository root:
class-diagram— Class diagram showing entities, attributes, methods, and relationships.use-case-diagram— Use case diagram showing actors (User, Administrator, SMTP Server) and system interactions.