This project has 3 modules: 1-AMS(account management system) 2- Naming server 3-Gateway
The Bank Account Management System is an application for maintaining a customer's account information in a bank. This module manages all request users for crud on customer, customers addresses, bank, bank account, brank translation and area. In this module, users can open bank accounts for customers, block accounts , unblock blocked accounts and close accounts. Ams stack consists of : Java 8, Spring boot, Spring data, hibernate, liquibase, Mysql, h2, Model mapper, feign, swagger.
Swagger is accessible in development profile mode with this url: http://localhost:8080/swagger-ui.html
1-Deposit :
Api : /api/to/{to}/amount/{amount}/currencyType/{type}
Service deposit requires 2 input path variables. “to” is the destination account number
and currency type should fill with USD or Eur.
2-Withdraw :
Api : /api/from/{from}/amount/{amount}/currencyType/{type}
This service has 2 path variables, first one is “from” that is account number and second
one is currency type (USD, Eur)
3-Transfer :
Api : /api/from/{from}/to/{to}/amount/{amount}/currencyType/{type}
When we want to transfer money, we can use this service. “From” is the origin account
number, “to” is destination account number and currency type should fill with USD or
Eur.
4-Transaction logs
Api : /api/logs
This service has 6 query parameters:
startDate, endDate , accountNumber, pageNumber, pageCount, orderType.
Account number is optional, if an account number doesn't have value, this searches on
all logs, but if account number has value, this service searches on bank transaction logs
of that account number.
This service is generated by the Eureka naming server. It’s port is 8761. All instances of all the microservices register themselves in the naming server. Whenever a microservice wants to talk to another microservices, ask the naming server about the available instances. Uri of Naming-Server dashboard is http://localhost:8761/ .
The API Gateway encapsulates the internal system architecture and provides an API that is tailored to each client. Gateway uses Netflix zuul api gateway and it’s port is 8762. In stage mode profile , we can access the swagger of this module with below uri. This swagger shows the rest apis of ams module. Url : localhost:8762/swagger-ui.html
Database of Stage profile is mysql and it will be available on the port: 3306. For generating our schema on AMS with all requirements, I used liquibase. Column name standard: All columns start with one character showing their content type. C : character , N : number , E : Enumeration , D : Date Bank account is so important for us, we use audit hibernate for saving any change on its records to the bank_account_aud table. Other tables have auditing fields (created_date , modified_date)
This project dockerized with spotify. Spotify is a plugin and it is configured in pom.xml of each module. When we package the project, this plugin executes each module docker file and finally generates its images. Run Project images: Docker-compose file is in the directory docker and you can run the below command in the docker directory of the project for making containers and running all modules images. Docker-compose up
With the below command, it is able to scale with the requirement count of AMS applications. This command runs 3 instances from AMS for scaling. Docker-compose up --scale ams=3 An important feature of such architectures is auto-scaling. The number of instances of a microservice varies based on the system load. Initially, you could have 5 instances of Microservice 5, which go up later to 20 or 100. In this project load balancing is controlled via Zuul api gateway through Ribbon.