This is a full-stack flight search application that allows users to search for flight offers between various locations using the Amadeus API. The project consists of a React frontend and a Spring Boot backend, both containerized using Docker. The backend handles flight search requests, processes responses, and caches dictionary data (such as city and airport information) to optimize performance.
- Search flights between any two locations using the Amadeus API.
- React frontend for user interaction and display of flight offers.
- Spring Boot backend for handling API requests and responses.
- Cache IATA code information (cities, airports) to reduce API calls.
- Bearer token authentication to connect with the Amadeus API.
- Frontend: React, TypeScript, Vite, Tailwind CSS
- Backend: Spring Boot, Java, Gradle
- API: Amadeus API
- Containerization: Docker, Docker Compose
- Caching: Spring Cache
Make sure you have the following installed on your system:
- Node.js (v22.3.0)
- Java JDK (v22)
- Docker & Docker Compose
-
Clone the repository and navigate to the backend directory:
cd flight-search-backend
-
Set up the Amadeus API credentials:
- Create a file named
application.properties
undersrc/main/resources
. - Add your Amadeus API key and secret:
amadeus.api.key=your_amadeus_api_key amadeus.api.secret=your_amadeus_api_secret
- Create a file named
-
Build and run the backend:
-
Navigate to the frontend directory:
cd ../flight-search-frontend
-
Install dependencies:
npm install
-
Run the application:
npm run dev
-
Ensure Docker is installed and running on your machine.
-
Navigate to the project root directory and run the following command to build and start the containers:
docker-compose up --build
-
The backend will be accessible at
http://localhost:8080
, and the frontend will be accesible athttp://localhost:3000
.
- Caching Issue: Sometimes, if the cache is not properly invalidated, outdated city and airport information might be used.
- Performance: In case of a large number of flights, the backend might experience delays due to multiple API calls.
- Docker: Sometimes, when running with Docker, certification errores may occur on HTTPS requests to external APIs.