The curriculum will touch on the following subjects:
- Java
- Spring Boot
- Microservices
- Unit tests
- Rest APIs
- Among others
NullBank was born as a project for Gama Academy's Java Web Development course sponsored by IBM.
The object is to highlight the theoretical knowledge acquired in classes turning it into something substantial and practical.
Along with this project, it will be necessary to accomplish some activities to attest the acquired knowledge. The activities must strictly follow the statement.
NullBank is the bank made by and for developers. It's possible to manage all your financial life with it.
It's possible to open current and saving accounts, do transfers, and much more!
The features required for approval are:
- Registering clients
- Listing clients
- Cash transfer between accounts
- Transaction history
Below are all the available endpoints.
Endpoint to create an agency
Endoint:
POST /agencies
Request:
{
"agencyName": "Central Agency",
"agencyNumber": "0001"
}
Response:
{
"agencyName": "Central Agency",
"agencyNumber": "0001"
}
Endoint for creating a client.
Endpoint:
POST /clients
Request:
{
"name": "Client 01",
"address": "Address 01",
"cpf": "606.344.610-95",
"salary": "500.0"
}
Response:
{
"id": 2,
"name": "Client 01"
}
Endpoint for opening an account after creating a client.
Endpoint:
POST /accounts
Request:
{
"cpf": "606.344.610-95",
"agencyNumber": "0001",
"accountType": "CURRENT_ACCOUNT"
}
Response:
{
"agencyNumber": "0001",
"agencyName": "Central Agency",
"accountHolderName": "Client 01",
"accountHolderId": 1,
"accountNumber": "0000256938",
"currentBalance": 0
}
Endpoint for depositing to an account.
Endpoint:
POST /accounts/{ACCOUNT_NUMBER}/deposit
Request:
{
"amount": 1000
}
Response:
{
"agencyNumber": "0001",
"agencyName": "Central Agency",
"accountHolderName": "Client 01",
"accountHolderId": 1,
"accountNumber": "0000256938",
"currentBalance": 1000.00
}
Endpoint for transfering cash between accounts.
Endpoints:
POST /accounts/{ORIGIN_ACCOUNT_NUMBER}/transfer-to/{DESTINATION_ACCOUNT_NUMBER}
Request:
{
"amount": 1000
}
Response:
{
"originAccountNumber": "0001664535",
"destinationAccountNumber": "0001076192",
"transferredAmount": 1000,
"currentBalance": 0.00
}
Endpoint for getting the transaction history.
Endpoint:
GET /accounts/{{ACCOUNT_NUMBER}}/history
Response:
{
"accountNumber": "0001664535",
"history": [
{
"amount": 1000.00,
"description": "Deposit to account 0001664535"
},
{
"amount": 1000.00,
"description": "Transfer to account 0001076192"
}
]
}
Endpoint for listing clients.
Endpoint:
GET /clients
Response:
{
"data": [
{
"id": 1,
"name": "Client 01"
}
]
}
Endpoint for finding account by account number.
Endpoint:
GET /accounts/{ACCOUNT_NUMBER}
Response:
{
"agencyNumber": "0001",
"agencyName": "Central Agency",
"accountHolderName": "Client 01",
"accountHolderId": 1,
"accountNumber": "0001664535",
"currentBalance": 0.00
}
Endpoint for withdrawal.
Endpoint:
POST /accounts/{ACCOUNT_NUMBER}/withdraw
Request:
{
"amount": 1000
}
Response:
{
"agencyNumber": "0001",
"agencyName": "Central Agency",
"accountHolderName": "Client 01",
"accountHolderId": 1,
"accountNumber": "0001664535",
"currentBalance": -1000.00
}
Endpoint for listing the available accounts.
Endpoint:
GET /accounts
Response:
{
"data": [
{
"agencyNumber": "0001",
"agencyName": "Central Agency",
"accountHolderName": "Client 01",
"accountHolderId": 1,
"accountNumber": "0001076192",
"currentBalance": 2000.00
},
{
"agencyNumber": "0001",
"agencyName": "Central Agency",
"accountHolderName": "Client 01",
"accountHolderId": 1,
"accountNumber": "0001664535",
"currentBalance": -1000.00
}
]
}
SonarQube is a tool for Code Static Analysis. For configuration, it's necessary to create a file called settings.xml in ~/.m2 folder.
File: ~/.m2/settings.xml
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
<pluginGroups>
<pluginGroup>org.sonarsource.scanner.maven</pluginGroup>
</pluginGroups>
<profiles>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>
</settings>
- For running this tool, you need to run the following Docker command:
docker run --name sonarqube -p 9000:9000 sonarqube:lts-community
- Open the web browser and go to http://localhost:9000. The following image will open:
-
Type in admin for user and password.
-
In the top right side, click in the green button with an A.
- Select My account and click on Security Tab.
- Then, generate a token.
- Type the following command:
mvn clean install sonar:sonar -D sonar.projectKey=nullbank -D sonar.host.url=http://localhost:9000 -D sonar.login=<your token>
- In the top left side, go to Projects -> Your Project.
Our current coverage is: