This is a flight searching application built with React and TypeScript for the frontend, running on Vite. The backend is built using the Java Spring Framework, which interacts with the Amadeus REST API for flight data. This guide includes steps to run the entire application using Docker.
- Frontend: Built using React with TypeScript, running on port
5173. - Backend: Built using Java Spring Framework, running on port
8080.
- Docker (v19.03 or later)
- Docker Compose (v1.27 or later)
- API key and API secret from Amadeus REST API (for backend)
-
Clone the repository:
git clone <repository-url> cd <repository-name>
-
Make sure Docker and Docker Compose are installed on your machine.
-
Locate the folder containing the docker-compose.yml file.
-
Build and run the application using Docker Compose:
docker-compose up --build
This will start both the frontend and backend services in containers.
-
The frontend will be available at http://localhost:5173, and the backend will be available at http://localhost:8080.
-
Navigate to the backend project directory (
./backend/flight_search_backend). -
Locate the folder named properties in the backend project.
-
Inside the properties folder, you will find a file where the API key and API secret are stored. Replace the placeholder values with your own Amadeus API key and API secret.
amadeus.api.key=<your-amadeus-api-key> amadeus.api.secret=<your-amadeus-api-secret>
-
Docker Compose will automatically build and start the backend when running
docker-compose up --build.
-
Navigate to the frontend project directory (
./frontend/flight_search). -
The Docker Compose file will build the frontend using the provided Dockerfile and start the React development server. No further setup is needed for the frontend.
Once both the frontend and backend containers are running:
- You can navigate to http://localhost:5173 to interact with the frontend.
- The frontend will make requests to the backend, which will then interact with the Amadeus API to fetch flight data.
The backend uses the Amadeus REST API to fetch flight data. Make sure to replace the API key and secret in the properties folder as described in the setup steps.