A simple service to search IP using AWS region.
- Gradle 8 +
- JDK 17 +
- Search IP Prefixes based on the AWS Region
- Caching using caffeine for decrease the latency for use. Link to CachedRestTemplate
- Circuitbreaker using resilience4j to detect failures and encapsulates the logic of preventing a failure.
- RaterLimiter using resilience4j to prevent huge traffic coming to the controller.
- Spring Actuator for health and metrics.
- UI for easy searching.
- Multiple data adapter for json, csv output
- Unit test coverage
- Persistence of master data in H2 in-memory
Note:
- JS is being loaded from cdn and may not work if behind proxy filter.
- Region prefix is persisted in in-memory db so that validation can happen dynamically.
- Run
docker run --rm -p 8080:8080 ghcr.io/techierishi/aws-ip-search:latest
- Open browser and access the application by entering
http://localhost:8080/api/v1/ip-range?region=<region-prefix>
- To change the output format to json
&dt=json
- Optionally, you can access
http://localhost:8080/
to access th UI (Screenshot below) - Access
http://localhost:8080/actuator/health
to for health checks.
- Clone the repository.
git clone https://github.com/techierishi/aws-ip-search.git
cd aws-ip-search/
- Build the project.
./gradlew bootJar
- Run the Spring Boot application.
./gradlew bootRun
- Build the docker image.
docker build --build-arg JAR_FILE=aws-ip-search-0.0.1-SNAPSHOT.jar -t ghcr.io/techierishi/aws-ip-search:latest .
- Run the application in docker container.
docker run --rm -p 8080:8080 ghcr.io/techierishi/aws-ip-search:latest
- Project has two workflows in Github Actions
- Gradle build and unit test case. This run on each push to master
- Docker image creation and publish. This runs on successful Gradle build
- Authentication/Authorization
- Separation of caching
- Faster search algorithm
- Use
Transfer-Encoding: chunked
for response. Reactive abstraction on java side - Add Open API specification
- Possible code cleanups
Thank you :)