This repository contains the implementation for the Fabrick coding interview tasks. The project is structured as a Maven Multi-Module application containing two microservices.
asteroids-service(Task 1): REST API to analyze asteroid paths across the Solar System using NASA NeoWs API.weather-service(Task 2): REST API to find weather stations and airports using the Aviation Weather Center API.
- Java 21
- Spring Boot 3 (WebFlux / Reactive Stack)
- Maven (Multi-module build)
- Caffeine Cache (Local caching layer)
- JUnit 5 & Mockito (Unit Testing)
- Java JDK 21
- Maven
From the root directory, run:
mvn clean installcd asteroids-service
mvn spring-boot:runGET http://localhost:8080/api/fabrick/v1.0/asteroids/3542519/paths?fromDate=2010-01-01&toDate=2014-01-01cd weather-service
mvn spring-boot:runBoth services expose an OpenAPI documentation interface (Swagger UI) for interactive testing and reviewing endpoint specifications.
| Service | Port | Swagger UI URL |
|---|---|---|
| Asteroids Service (Task 1) | 8080 | http://localhost:8080/swagger-ui.html |
| Weather Service (Task 2) | 8081 | http://localhost:8081/swagger-ui.html |
Note: The Swagger UI endpoints are set up using the springdoc-openapi-starter-webflux-ui library.
# Find stations near an airport (e.g., KDEN - Denver)
GET http://localhost:8081/api/fabrick/v1.0/airports/KDEN/stations?closestBy=0.5
# Find airports near a station
GET http://localhost:8081/api/fabrick/v1.0/stations/KDEN/airports?closestBy=0.5