A modern, full-featured hotel management system built with .NET 8, featuring both a Console Application and a Blazor Server interface. This system provides comprehensive tools for managing hotel operations including room bookings, guest management, and room inventory.
- Room Management: Add, view, update, and delete hotel rooms with detailed information
- Guest Management: Store and manage comprehensive guest profiles and contact information
- Booking System: Handle room reservations, check-ins, check-outs, and cancellations
- Room Search: Advanced filtering and search capabilities for available rooms
- Reporting: Generate reports on bookings, occupancy rates, and revenue
- Multi-tier Architecture: Clean separation of concerns with distinct layers
- Entity Framework Core: Robust data access with code-first approach
- Dependency Injection: Built-in IoC container for better testability and maintainability
- Responsive Design: Modern Blazor UI that works on desktop and tablet devices
- SQLite Database: File-based, zero-configuration database
- RESTful API: Clean API endpoints for all operations
- .NET 8.0 SDK
- Visual Studio 2022 (17.0 or later) or VS Code with C# Dev Kit
- Git
-
Clone the repository:
git clone https://github.com/yourusername/hotel-management-system.git cd hotel-management-system -
Restore NuGet packages and build the solution:
dotnet restore dotnet build
-
Apply database migrations:
cd Hotel.Infrastructure dotnet ef database update
The console application provides a fast, keyboard-driven interface for hotel management.
-
Navigate to the Console App directory:
cd Hotel.ConsoleApp -
Run the application:
dotnet run
-
Use the interactive menu to manage rooms, guests, and bookings.
The Blazor Server UI provides a modern web interface for hotel management.
-
Navigate to the Blazor UI directory:
cd Hotel.BlazorUI -
Run the application:
dotnet run
-
Open a web browser and navigate to:
https://localhost:5001or
http://localhost:5000
hotel-management-system/
├── Hotel.Core/ # Core domain models and business logic
│ ├── Data/ # Data access layer
│ │ └── HotelDbContext.cs # Database context
│ ├── Interfaces/ # Service interfaces
│ └── Models/ # Domain models
│ ├── Booking.cs
│ ├── Guest.cs
│ ├── Room.cs
│ └── RoomType.cs
│
├── Hotel.Infrastructure/ # Infrastructure concerns
│ ├── Data/ # Data access implementation
│ └── Services/ # Service implementations
│
├── Hotel.ConsoleApp/ # Console application
│ ├── Services/ # Console-specific services
│ └── Program.cs # Application entry point
│
└── Hotel.BlazorUI/ # Blazor Server UI
├── Pages/ # Razor components
│ ├── Bookings/ # Booking management
│ ├── Guests/ # Guest management
│ ├── Rooms/ # Room management
│ └── Shared/ # Shared components
├── Services/ # Client-side services
└── Program.cs # Application startup
The application uses SQLite with a local database file (hotel.db) that is automatically created on first run. The database is seeded with sample data when first created.
- Rooms: Stores room information including number, type, status, and pricing
- Guests: Stores guest personal and contact information
- Bookings: Manages room reservations and check-in/check-out details
To create a new migration:
cd Hotel.Infrastructure
dotnet ef migrations add MigrationNameTo apply pending migrations:
dotnet ef database updateRun the test suite with:
cd Hotel.Core.Tests
dotnet test- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.