- A flight search app
- Application receives the requested via
/v1/api/flights/searchurl with all optionaloriginAirportId,destinationAirportId,departureDate,returnDaterequest parameters - There is a validation for date parameters.
- If the date parameters is not valid, api returns
400 - Http Bad Requestresponse
- If the date parameters is not valid, api returns
- There is a
Criteria Specificationwhen search with all optional search parameters.- If all parameters is empty, gets all Flights from db.
- Otherwise a Criteria will be builded for given parameters.
- Existing airports are
cachedand brought from the cache when needed. - There is scheduled jobs at midnight:
- A request is made to another API to retrieve the new day's flight information and save it to the db.
- All cache evicted.
- A
RateLimiterimplemented withresilience4j
On the swagger page you can find the relevant api endpoint.
You can reach the openapi page by http://localhost:8080/swagger-ui/index.html url.
You can define API_URL in the application.yml file
- Java 17
- Spring Boot 3.1
- Open API Documentation
- Spring Data JPA
- H2 In Memory Database
- Restful API
- Maven
- Junit5
- Mockito
- Resilience4j
- Docker
- Docker Compose
- Maven or Docker
The application can be built and run by the Docker engine. The Dockerfile has multistage build, so you do not need to build and run separately.
Please follow the below directions in order to build and run the application with Docker Compose;
$ cd flight
$ docker-compose up -dTo build and run the application with Maven, please follow the directions below;
$ cd flight
$ mvn clean install
$ mvn spring-boot:runYou can reach the swagger-ui via http://{HOST}:8080/swagger-ui.html