Skip to content

Repository files navigation

🏨 Hotel Management System

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.

✨ Features

Core Functionality

  • 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

Technical Features

  • 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

🚀 Getting Started

Prerequisites

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/hotel-management-system.git
    cd hotel-management-system
  2. Restore NuGet packages and build the solution:

    dotnet restore
    dotnet build
  3. Apply database migrations:

    cd Hotel.Infrastructure
    dotnet ef database update

🖥️ Running the Console Application

The console application provides a fast, keyboard-driven interface for hotel management.

  1. Navigate to the Console App directory:

    cd Hotel.ConsoleApp
  2. Run the application:

    dotnet run
  3. Use the interactive menu to manage rooms, guests, and bookings.

🌐 Running the Blazor UI

The Blazor Server UI provides a modern web interface for hotel management.

  1. Navigate to the Blazor UI directory:

    cd Hotel.BlazorUI
  2. Run the application:

    dotnet run
  3. Open a web browser and navigate to:

    https://localhost:5001
    

    or

    http://localhost:5000
    

🏗️ Solution Structure

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

� Database

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.

Database Schema

  • 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

Migrations

To create a new migration:

cd Hotel.Infrastructure
dotnet ef migrations add MigrationName

To apply pending migrations:

dotnet ef database update

🧪 Testing

Run the test suite with:

cd Hotel.Core.Tests
dotnet test

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

🙏 Acknowledgments

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages