foreignexchangeexample

Case Study - Foreign Exchange Example (Spring Boot, Java 21, Docker, Maven, JUnit Test, Integration Test, In-Memory Database (H2 Database), Github Actions, Spring Open Api, Mapstruct, Spring Cache, Resillience4j (Rate Limiter))

Stars
3
Committers
1

Case Study - Foreign Exchange Example

📖 Information

Explore Rest APIs

Endpoints Summary

Technologies


  • Java 21
  • Spring Boot 3.0
  • Restful API
  • Mapstruct
  • Open Api (Swagger)
  • Maven
  • Junit5
  • Mockito
  • Integration Tests
  • Docker
  • Docker Compose
  • CI/CD (Github Actions)
  • Postman
  • H2 Database (In-Memory)
  • Spring Boot Actuator
  • Spring Cache
  • Resilience4j (Rate Limiter)

Postman

Import postman collection under postman_collection folder

Prerequisites

Define Variable in .env file for http://api.currencylayer.com/

EXCHANGE_API_API_KEY={EXCHANGE_API_API_KEY}

Open Api (Swagger)

http://localhost:1331/swagger-ui/index.html

  • Maven or Docker

Docker Run

The application can be built and run by the Docker engine. The Dockerfile has multistage build, so you do not need to build and run separately.

Please follow directions shown below in order to build and run the application with Docker Compose file;

$ cd foreignexchangeexample
$ docker-compose up -d

If you change anything in the project and run it on Docker, you can also use this command shown below

$ cd foreignexchangeexample
$ docker-compose up --build

Maven Run

To build and run the application with Maven, please follow the directions shown below;

$ cd foreignexchangeexample
$ mvn clean install
$ mvn spring-boot:run

Docker Image Location

https://hub.docker.com/repository/docker/noyandocker/foreignexchangeexample/general

Screenshots

Contributors

Related Projects