gradle build
Dump in ibankFullDump.sql
docker run --rm -dit --name ibankApiDB -p 5433:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=ibank -e PGDATA=/var/lib/postgresql/data/pgdata postgres:14
- Clone repository
- Build jar with gradle build
- Locate file additional.properties in the same folder with jar file (You can use additional.properties.example)
- Execute jar
Additional properties can be uploaded in the image, you can specify directory to bootstrap file in Dockerfile.
Commands:
docker build ibankapi .
sudo docker run --rm -p 8080:8080 ibankapi
Deployed here: http://109.196.164.34:8080
Endpoints:
GET /api/dev/fillDb
- creates two new users and returns their ids.
GET /getBalance/{userId}
- return requested user.
POST /deposit
- put money to requested user.
{
"userId": 3,
"value": 10
}
POST /withdrew
- take money from user.
{
"userId": 3,
"value": 10
}
POST /getOperationList
- get operations of requested user.
{
"userId": 3, //required
"startDate": "2022-11-08", //optional
"endDate": "2022-11-21" //optional
}
POST /transferMoney
- transferes money between two users.
{
"userId": 2,
"userToId": 1,
"value": 90000
}
- All Api functionality
- Operations recording to operations_tab
- Transfer money operation
- Used Transactional annotation for transaction management
- Unit and integration tests
- Deployed on VDS