Skip to content
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
/ skylunch Public archive

Api to find restaurants near airports.

License

Notifications You must be signed in to change notification settings

siph/skylunch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tests workflow image workflow coverage

Skylunch

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.

How it works

Technologies

Skylunch is built using the following technologies:

Data Storage and Access

diagram

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.

Note About Blocking Calls in Redis OM Java

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.

Try It Out

Graphql

The application exposes the /graphiql endpoint which can be used to test the application and explore the schema. Queries are then made via /graphql.

Http

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.

Deployment

The infrastructure and deployment are covered in their own Readme.

About

Api to find restaurants near airports.

Resources

License

Stars

Watchers

Forks