This project is a Hotel Search Application built using React and TypeScript. It allows users to search for hotels based on city, check-in and check-out dates, number of adults and children, and room type. The application fetches hotel data from an external API using Axios and displays the results in a responsive and user-friendly way.
project-root
├── src
│ ├── components
│ │ ├── CitySearch.tsx # City search component
│ │ ├── HotelResults.tsx # Hotel results display component
│ │ └── HotelSearchApp.tsx # Main hotel search application
│ ├
│ │
│ └── App.tsx # Main entry point
├── public
│ └── index.html
├── package.json
└── README.md
git clone https://github.com/username/hotel-search-app.git
cd hotel-search-app
npm install
npm start
The application uses the Makcorps API to fetch hotel data. The API key is configured in the fetchHotels
function located in src/api/hotelService.ts
.
If the API request limit is exceeded (status code 429), the application will retry the request up to three times with a delay between each attempt.
If you encounter the error:
Error fetching hotels: Request failed with status code 429
This means the API rate limit has been exceeded. The application will automatically retry, but if the problem persists, consider:
This project is licensed under the MIT License.
Special thanks to Makcorps for providing the hotel data API.