The $100 hamburger is a phrase used to describe a recreational flight taken by pilots for the primary purpose of having a meal at a distant airport. The term is often used humorously to describe the high cost of general aviation, but it also represents the freedom and joy of flying for leisure.
Skylunch
is a simple, non-blocking api built using Spring Webflux
that, provided with an airport code, will return a detailed list of restaurants within a configurable radius.
The purpose of Skylunch
is to help aviators find new and interesting destinations to elevate the enjoyment of their favorite hobby.
Skylunch
is built using the following technologies:
Data is stored with Redis using Redis OM Spring.
Upon receiving a request, Skylunch
will search the Redis cache/db for a result before querying the external api. External api calls will then be cached in Redis for subsequent requests.
Geographical searches are performed using the built-in functions of Redis OM:
val restaurants = restaurantRepository.findByLocationNear(
location,
Distance(restaurantProperties.radius.toDouble(), Metrics.METERS),
)
Local results will also be checked for 'staleness' according to the configuration properties. Results that are older than the threshold age will be re-queried by external api.
As of version 0.5.1
, a fully non-blocking application is not possible using the Redis OM. This is because Redis OM uses the Jedis library instead of the non-blocking Lettuce library to access Redis. Therefore, calls to the repository will be blocking.
The application exposes the /graphiql
endpoint which can be used to test the application and explore the schema.
Queries are then made via /graphql
.
A typical http endpoint is also provided and can be used at /api/v1/search?code=<ICAO or IATA>
.
Example: /api/v1/search?code=lax
.
The infrastructure and deployment are covered in their own Readme.