{"id":14986475,"url":"https://github.com/rapter1990/foreignexchangeexample","last_synced_at":"2025-04-11T20:32:47.366Z","repository":{"id":252636246,"uuid":"840384333","full_name":"Rapter1990/foreignexchangeexample","owner":"Rapter1990","description":"Case Study - Openpayd 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))","archived":false,"fork":false,"pushed_at":"2024-08-11T11:45:24.000Z","size":3341,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-07T08:03:27.947Z","etag":null,"topics":["docker","docker-compose","dockerfile","github-actions","h2-database","in-memory-database","integration-test","java21","junit","mapstruct","maven","mockito","monolith","openapi","rate-limiter","resilience4j","resttemplate","spring-boot","spring-cache"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Rapter1990.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-09T15:26:31.000Z","updated_at":"2024-10-17T12:51:17.000Z","dependencies_parsed_at":"2024-08-11T12:39:34.793Z","dependency_job_id":null,"html_url":"https://github.com/Rapter1990/foreignexchangeexample","commit_stats":null,"previous_names":["rapter1990/foreignexchangeexample"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rapter1990%2Fforeignexchangeexample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rapter1990%2Fforeignexchangeexample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rapter1990%2Fforeignexchangeexample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Rapter1990%2Fforeignexchangeexample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Rapter1990","download_url":"https://codeload.github.com/Rapter1990/foreignexchangeexample/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223479565,"owners_count":17151931,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","docker-compose","dockerfile","github-actions","h2-database","in-memory-database","integration-test","java21","junit","mapstruct","maven","mockito","monolith","openapi","rate-limiter","resilience4j","resttemplate","spring-boot","spring-cache"],"created_at":"2024-09-24T14:12:55.726Z","updated_at":"2024-11-07T08:03:39.906Z","avatar_url":"https://github.com/Rapter1990.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Case Study - Foreign Exchange Example\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"screenshots/foreign_exchange_main_image.png\" alt=\"Main Information\" width=\"800\" height=\"450\"\u003e\n\u003c/p\u003e\n\n### 📖 Information\n\n\u003cul style=\"list-style-type:disc\"\u003e\n  \u003cli\u003eThis project demonstrates a \u003cb\u003eSpring Boot\u003c/b\u003e application for managing foreign exchange operations. It allows users to convert currencies, retrieve current exchange rates, and view conversion history.\u003c/li\u003e\n  \u003cli\u003eThe application integrates with an external service provider for fetching exchange rates and performing currency conversion calculations.\u003c/li\u003e\n  \u003cli\u003eThe application includes three main endpoints:\n    \u003cul\u003e\n      \u003cli\u003eExchange Rate Endpoint: Fetches the current exchange rate between two currencies.\u003c/li\u003e\n      \u003cli\u003eCurrency Conversion Endpoint: Converts a given amount from one currency to another and returns a unique transaction identifier.\u003c/li\u003e\n      \u003cli\u003eConversion History Endpoint: Retrieves the history of currency conversions based on transaction identifiers or dates.\u003c/li\u003e\n    \u003c/ul\u003e\n  \u003c/li\u003e\n\u003c/ul\u003e\n\n\n### Explore Rest APIs\n\nEndpoints Summary\n\n\u003ctable style=\"width:100%\"\u003e\n  \u003ctr\u003e\n      \u003cth\u003eMethod\u003c/th\u003e\n      \u003cth\u003eUrl\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n      \u003cth\u003eRequest Body\u003c/th\u003e\n      \u003cth\u003ePath Variable\u003c/th\u003e\n      \u003cth\u003eResponse\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n      \u003ctd\u003ePOST\u003c/td\u003e\n      \u003ctd\u003e/api/v1/exchange-rate\u003c/td\u003e\n      \u003ctd\u003eFetches the current exchange rate between two currencies.\u003c/td\u003e\n      \u003ctd\u003eExchangeRateRequest\u003c/td\u003e\n      \u003ctd\u003eNone\u003c/td\u003e\n      \u003ctd\u003eExchangeRateResponse\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n      \u003ctd\u003ePOST\u003c/td\u003e\n      \u003ctd\u003e/api/v1/convert\u003c/td\u003e\n      \u003ctd\u003eConverts currency based on the provided ConvertRequest.\u003c/td\u003e\n      \u003ctd\u003eConvertRequest\u003c/td\u003e\n      \u003ctd\u003eNone\u003c/td\u003e\n      \u003ctd\u003eConvertResponse\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n      \u003ctd\u003ePOST\u003c/td\u003e\n      \u003ctd\u003e/api/v1/history\u003c/td\u003e\n      \u003ctd\u003eRetrieves the conversion history based on the provided ConversionHistoryFilterRequest.\u003c/td\u003e\n      \u003ctd\u003eConversionHistoryFilterRequest\u003c/td\u003e\n      \u003ctd\u003eNone\u003c/td\u003e\n      \u003ctd\u003eCustomPage\u0026lt;ConvertHistoryResponse\u0026gt;\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\n### Technologies\n\n---\n- Java 21\n- Spring Boot 3.0\n- Restful API\n- Mapstruct\n- Open Api (Swagger)\n- Maven\n- Junit5\n- Mockito\n- Integration Tests\n- Docker\n- Docker Compose\n- CI/CD (Github Actions)\n- Postman\n- H2 Database (In-Memory)\n- Spring Boot Actuator\n- Spring Cache\n- Resilience4j (Rate Limiter)\n\n### Postman\n\n```\nImport postman collection under postman_collection folder\n```\n\n\n### Prerequisites\n\n#### Define Variable in .env file for http://api.currencylayer.com/\n\n```\nEXCHANGE_API_API_KEY={EXCHANGE_API_API_KEY}\n```\n\n### Open Api (Swagger)\n\n```\nhttp://localhost:1331/swagger-ui/index.html\n```\n\n---\n- Maven or Docker\n---\n\n\n### Docker Run\nThe 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.\n\nPlease follow directions shown below in order to build and run the application with Docker Compose file;\n\n```sh\n$ cd foreignexchangeexample\n$ docker-compose up -d\n```\n\nIf you change anything in the project and run it on Docker, you can also use this command shown below\n\n```sh\n$ cd foreignexchangeexample\n$ docker-compose up --build\n```\n\n---\n### Maven Run\nTo build and run the application with `Maven`, please follow the directions shown below;\n\n```sh\n$ cd foreignexchangeexample\n$ mvn clean install\n$ mvn spring-boot:run\n```\n\n---\n### Docker Image Location\n\n```\nhttps://hub.docker.com/repository/docker/noyandocker/foreignexchangeexample/general\n```\n\n### Screenshots\n\n\u003cdetails\u003e\n\u003csummary\u003eClick here to show the screenshots of project\u003c/summary\u003e\n    \u003cp\u003e Figure 1 \u003c/p\u003e\n    \u003cimg src =\"screenshots/screenshot_1.PNG\"\u003e\n    \u003cp\u003e Figure 2 \u003c/p\u003e\n    \u003cimg src =\"screenshots/screenshot_2.PNG\"\u003e\n    \u003cp\u003e Figure 3 \u003c/p\u003e\n    \u003cimg src =\"screenshots/screenshot_3.PNG\"\u003e\n    \u003cp\u003e Figure 4 \u003c/p\u003e\n    \u003cimg src =\"screenshots/screenshot_4.PNG\"\u003e\n    \u003cp\u003e Figure 5 \u003c/p\u003e\n    \u003cimg src =\"screenshots/screenshot_5.PNG\"\u003e\n    \u003cp\u003e Figure 6 \u003c/p\u003e\n    \u003cimg src =\"screenshots/screenshot_6.PNG\"\u003e\n    \u003cp\u003e Figure 7 \u003c/p\u003e\n    \u003cimg src =\"screenshots/screenshot_7.PNG\"\u003e\n    \u003cp\u003e Figure 8 \u003c/p\u003e\n    \u003cimg src =\"screenshots/screenshot_8.PNG\"\u003e\n\u003c/details\u003e\n\n\n### Contributors\n\n- [Sercan Noyan Germiyanoğlu](https://github.com/Rapter1990)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapter1990%2Fforeignexchangeexample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frapter1990%2Fforeignexchangeexample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frapter1990%2Fforeignexchangeexample/lists"}