Skip to content

richardags/Sunway-Hotel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hotel Management Application

Hotel Management Application is a full-stack web application for managing hotel information.

Features

HotelAPI (Backend)

  • Provides RESTful API with the following endpoints:
    • GET /api/hotels: Retrieve a list of hotels.
    • GET /api/hotels/{id}: Retrieve details of a specific hotel.
  • Handles errors gracefully with appropriate HTTP status codes.

hotelspa (Frontend)

  • Displays a list of hotels with details such as:
    • Name, location, rating, image, dates of travel, board basis, and room details.
  • Allows users to view more details about a specific hotel.
  • Fully responsive design.

Prerequisites

Before running the project, ensure you have the following installed:

Installation

Clone the Repository

git clone https://github.com/richardags/Sunway-Hotel.git cd Sunway-Hotel

Backend Setup

  1. Navigate to the HotelAPI folder:
    cd HotelAPI
  1. Run the API:
    dotnet run
  1. The API will be available at http://localhost:5000.

Frontend Setup

  1. Navigate to the hotelspa folder:
    cd hotelspa
  1. Start the application:
    dotnet run
  1. The frontend will be available at http://localhost:5050.

API Endpoints

GET /api/hotels

Fetches a list of hotels.

Example response:

[   {     "id": 1,     "name": "Seaside Paradise",     "location": "Maldives",     "rating": 4.9,     "imageUrl": "https://example.com/images/seaside-paradise.jpg",     "datesOfTravel": ["2024-01-01", "2024-01-07"],     "boardBasis": "All Inclusive",     "rooms": [       { "roomType": "Deluxe Suite", "amount": 5 },       { "roomType": "Family Room", "amount": 3 }     ]   } ]

GET /api/hotels/{id}

Fetches details of a specific hotel.

Example response:

{   "id": 1,   "name": "Seaside Paradise",   "location": "Maldives",   "rating": 4.9,   "imageUrl": "https://example.com/images/seaside-paradise.jpg",   "datesOfTravel": ["2024-01-01", "2024-01-07"],   "boardBasis": "All Inclusive",   "rooms": [     { "roomType": "Deluxe Suite", "amount": 5 },     { "roomType": "Family Room", "amount": 3 }   ] }

Error response:

{   "message": "Hotel not found",   "statusCode": 404 }

Running the Application

  1. Start the backend API using Visual Studio or dotnet run.
  2. Start the React frontend using dotnet run.
  3. Open your browser and navigate to http://localhost:5050.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published