- A flight search app
- Application receives the requested via
/v1/api/flights/search
url with all optionaloriginAirportId
,destinationAirportId
,departureDate
,returnDate
request parameters - There is a validation for date parameters.
- If the date parameters is not valid, api returns
400 - Http Bad Request
response
- If the date parameters is not valid, api returns
- There is a
Criteria Specification
when 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
cached
and 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
RateLimiter
implemented 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 -d
To build and run the application with Maven
, please follow the directions below;
$ cd flight
$ mvn clean install
$ mvn spring-boot:run
You can reach the swagger-ui via http://{HOST}:8080/swagger-ui.html