Skip to content

jfranzoi/fishermen-leaderboard

Repository files navigation

Fishermen Leaderboard

Sample web-application to solve the "fishermen leaderboard" coding problem.

To run it, execute:

docker-compose up

Then, open your browser and browse to http://localhost/.

Requirements

fishermen-leaderboard is composed of 3 components, built and started as docker containers:

  • ui, which is a NextJS front-end application, binding on port 3000
  • api, which is a Java 11 web application, based on Spring Boot and built with maven, binding on port 8080
  • proxy, which is an Nginx instance, acting as a reverse proxy to other components (/api for api, fallback to ui on all other locations), binding on port 80

Links between containers are through host ports in order to be fully supported on Docker Desktop (eg: on MacOS).

Notes

See TODO to follow development steps.

As we have two APIs to be consumed and correlated (fishermen and recollections), this would not be possible in real-time. So, the main goal of api component is preparing ready-to-use content, for ui component. This is achieved by in-memory pre loading content, and a scheduled "refresh" on a given interval (1h by default). See:

APIs integration is using an API-KEY, which is not exposed to clients. Both API-KEY and base URL can be configured in application.properties as application.ogyre.api-key and application.ogyre.base-uri.

ui component is basically a NextJS starter application, reusing its default template. Decoupling from data fetching and presentation is achieved by leveraging on useFishermen.tsx custom hook. Please note: no configuration is available at the moment for its base URL, as it's hard-coded in the hook code (and being set to work on its docker-based setup).

Two reusable ui components are availbale in components folder, to present FishermanCard on homepage, and RecollectionDetails on detail page.

Deployment

In order to test the end-to-end build and deployment setup, few additional resources have been prepared:

Feel free to provide any feedback!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages