HotelsWebAPI is a RESTful web API built using .NET, which provides a set of endpoints for managing hotels, rooms, bookings, amenities, facilities, cities, and user accounts.
- JWT token-based authentication using access and refresh tokens
- Generics repository pattern for database operations
- Data access layer for interacting with the database
- Model layer for defining entities and data contracts
- Utility layer for common functionality
- Four-layer architecture for code separation
- Booking validity check for ensuring valid bookings
- Support for CORS
- Swagger UI for easy API testing
- Clone the repository to your local machine.
- Open the solution in Visual Studio.
- Build and run the project.
POST /api/account/login- authenticate user and return JWT tokensPOST /api/account/refresh-token- refresh expired access tokenPOST /api/account/revoke-token- revoke refresh token
GET /api/amenities- get all amenitiesGET /api/amenities/{id}- get a specific amenityPOST /api/amenities- create a new amenityPUT /api/amenities/{id}- update an existing amenityDELETE /api/amenities/{id}- delete an amenity
GET /api/bookings- get all bookingsGET /api/bookings/{id}- get a specific bookingPOST /api/bookings- create a new bookingPUT /api/bookings/{id}- update an existing bookingDELETE /api/bookings/{id}- delete a booking
GET /api/cities- get all citiesGET /api/cities/{id}- get a specific cityPOST /api/cities- create a new cityPUT /api/cities/{id}- update an existing cityDELETE /api/cities/{id}- delete a city
GET /api/facilities- get all facilitiesGET /api/facilities/{id}- get a specific facilityPOST /api/facilities- create a new facilityPUT /api/facilities/{id}- update an existing facilityDELETE /api/facilities/{id}- delete a facility
GET /api/hotels- get all hotelsGET /api/hotels/{id}- get a specific hotelPOST /api/hotels- create a new hotelPUT /api/hotels/{id}- update an existing hotelDELETE /api/hotels/{id}- delete a hotel
GET /api/rooms- get all roomsGET /api/rooms/{id}- get a specific roomPOST /api/rooms- create a new roomPUT /api/rooms/{id}- update an existing roomDELETE /api/rooms/{id}- delete a room