Hotel Management Application is a full-stack web application for managing hotel information.
- 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.
- 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.
Before running the project, ensure you have the following installed:
git clone https://github.com/richardags/Sunway-Hotel.git cd Sunway-Hotel
- Navigate to the
HotelAPI
folder:
cd HotelAPI
- Run the API:
dotnet run
- The API will be available at
http://localhost:5000
.
- Navigate to the
hotelspa
folder:
cd hotelspa
- Start the application:
dotnet run
- The frontend will be available at
http://localhost:5050
.
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 } ] } ]
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 }
- Start the backend API using Visual Studio or
dotnet run
. - Start the React frontend using
dotnet run
. - Open your browser and navigate to
http://localhost:5050
.
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.