This project implements an API that retrieves exchange rate data from various providers and stores it in a local database. It provides two methods for retrieving exchange rate data:
/currency/average- Retrieves a list of exchange rates for all sources, including the average market rate./currency/average_by_date- Retrieves a list of average exchange rates for all sources for a specified period.
This project supports the following API providers:
For each of these providers, a common interface has been implemented, with separate implementations for each provider.
The API periodically synchronizes data with the API providers using a cron job. This ensures that the local database always has the most up-to-date exchange rate data.
This project was developed using the following technologies:
- Java/Kotlin
- Tomcat
- Spring Boot
- Hibernate
- PostgreSQL
- Git
- Swagger
- Gradle
To run the project, you will need to perform the following steps:
- Clone the project repository:
git clone https://github.com/Dastya/currency_management_API.git - Set up a PostgreSQL database and create the necessary tables
- Update the database configuration in
src/main/resources/application.propertiesto point to your database. - Build the project using Gradle:
./gradlew build - Start the API using the command
java -jar build/libs/currency_exchange_daemon.jar - Navigate to
http://localhost:8080/swagger-ui.htmlto access the API documentation using Swagger.
The API is documented using Swagger. To view the documentation, navigate to http://localhost:8080/swagger-ui.html after starting the API.