This is my solution from the challenge from Ontop 💪
A Rest API to serve the functionality of transfers from Ontop Account to customer Account. The API is developed over Spring Boot using Hexagonal Architecture.
As show in this diagram this app have one input the Rest API Client generating one adapter for.
For the business logic use case are generated and the domain to define the business logic and domain objects.
For integration with the output ports is using repositories to connect to H2 database and service to connect to the external services.
✅ Feature 1:
Create customer Account.
✅ Feature 2:
Withdraw
✅ Feature 3:
Transaction list
☑️ Feature 1:
Create more than one Account for userId
☑️ Feature 2:
Top up
☑️ Feature 3:
Improvement of the list api
☑️ Feature 3:
Add docker support
- Language: Java 17
- Framework : Spring Boot 3
- Architecture : Hexagonal architecture
- Web framework : Webflux
- Data framework : Spring Data R2DBC
- Database : H2
- Api Docs : Spring Doc
- Clone the repo
- Install java 17 (SDK Man or from another install manager)
- inside the repo on the console run the ./mvnw test for run the unit test of the project (macos / linux) / mvnw.cmd test (windows)
- Inside the repo on the console run ./mvnw spring-boot:run to start the app / mvnw.cmd spring-boot:run (windows). The project runs on the default port 8080.
- Use the postman collection to test Postman collection inside this collection there are the 3 generated endpoints one with the localhost URL and another with a cloud vendor url.
- To test first you must create the Account with the account endpoint (there is a examples in postman) and after that use the witdraw endpoint to generate the operations (there are examples in postman). Additional there is a list endpoint to review the saved data by user.
- Also can enter to the swagger-ui Swagger UI
Samuel Gonzales |
---|