Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rapter1990/currencyexchange
Currency Exchange API for Spring Boot
https://github.com/rapter1990/currencyexchange
actuator actuators cache currency-exchange docker docker-compose exception-handling h2-database intergration-test java junit open-api ratelimiter resilience4j resttemplate spring-boot spring-cache stream swagger
Last synced: 9 days ago
JSON representation
Currency Exchange API for Spring Boot
- Host: GitHub
- URL: https://github.com/rapter1990/currencyexchange
- Owner: Rapter1990
- Created: 2023-05-13T16:04:29.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-06-03T23:58:44.000Z (over 1 year ago)
- Last Synced: 2024-11-07T08:04:58.840Z (9 days ago)
- Topics: actuator, actuators, cache, currency-exchange, docker, docker-compose, exception-handling, h2-database, intergration-test, java, junit, open-api, ratelimiter, resilience4j, resttemplate, spring-boot, spring-cache, stream, swagger
- Language: Java
- Homepage:
- Size: 1.97 MB
- Stars: 10
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Spring Boot Currency Change API Example
### 📖 Information
- The purpose of the example is to handle with http get requests regarding currency exchange
- Here is the explanation of the currency exchange example
- Get rates from the database if the rate info is already inserted into database
- Get rates from apilayer.com and insert its value into database and return the rate info
- Get exchange rates by exchange request info covering base currency, target currency and lastly amount
- Get conversion by rate id
- Get all conversions between two dates named start date and end date
- Get rates from the database if the rate info is already inserted into database
### Explore Rest APIs
Method
Url
Description
Valid Request Params
Valid Path Variable
GET
/v1/rate
Get Rates
Info
GET
/v1/exchange
Get Exchange Rates By Exchange Request Info
Info
GET
getconversion
Get Conversion By Id
Info
GET
getconversionlist
Get Conversion List
Info
### Valid Request Params
### Valid Path Variable
##### Get Conversion
```
http://localhost:8080/v1/conversion/17d98364-e435-40d7-a941-af535fc95065
```
### Technologies
---
- Java 17
- Spring Boot 3.0
- Open API Documentation
- Restful API
- Spring Cache
- Actuator
- Resilience4j
- Lombok
- Maven
- Junit5
- Mockito
- Integration Tests
- Docker
- Docker Compose
### Prerequisites
---
- Get API KEY from apilayer.com
- Maven or Docker
---
### Get API KEY from apilayer.com
1 ) Open and register apilayer.com
2 ) Register Exchange Rates Data API and Get API key
### Create .env and Define API key
---
EXCHANGE_API_API_KEY={YOUR_API_KEY}
---
### 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;
```sh
$ cd currencyexchange
$ docker-compose up -d
```
---
### Maven Run
To build and run the application with `Maven`, please follow the directions shown below;
```sh
$ cd currencyexchange
$ mvn clean install
$ mvn spring-boot:run
```
### Swagger
You can reach the swagger-ui through the link shown below
```
http://localhost:8080/swagger-ui/index.html
```
### Actuator
You can reach the actuator through the link shown below
```
http://localhost:8080/actuator
```
### Screenshots
Click here to show the screenshots of project
Figure 1
Figure 2
Figure 3
Figure 4
Figure 5