A banking CRUD API built using the Spring Boot framework and PostgreSQL.
- ADD customer objects to DB
- ADD or DELETE account objects to DB
- Cron job to get ending daily balances for all accounts
- Tracks DEPOSIT or WITHDRAW transactions
- API endpoints secured using Spring Security
Before deploying the API, you will need to create a sensitive.properties file.
spring.datasource.url=jdbc:postgresql://<DB Endpoint>:<DB Port>/<DB Table Name>
spring.datasource.username=<DB Username>
spring.datasource.password=<DB Password>
env.jwks.data = <Cognito jwks.json link>
env.proxy.address = http://localhost:3000
env.frontend.address = http://localhost:5173
This project can be ran locally or in a Docker container. Clone the repository, create sensitive.properties file, and run the following commands.
Checkout this blog article for steps to containerize this API --> HERE
Ensure that you have openJDK 21 installed. These next steps are done on a MAC device. Windows commands could differ.
./mvnw sprint-boot:run
This API works in conjuction with a JWT access token retrieved from a oauth2 user pool. The token has to match the issuer which is defined in the sensitive.properties file.
GET /home
Checks to see if API is reachable.
GET /hello
Checks to see if user token is valid. Will return the UUID from token.
POST /api/customer/add
Parameter | Type |
---|---|
username |
string |
uuid |
string |
fname |
string |
lname |
string |
Adds customer to DB
GET /api/customer
Returns customer object based off UUID in access token.
POST /api/account/add
Parameter | Type |
---|---|
type |
CHECKING or SAVINGS |
amount |
string |
Opens new account and adds initial deposit.
POST /api/account/delete
Parameter | Type |
---|---|
account_number |
number |
Closes account as long as the balance is 0.
POST /api/account
Parameter | Type |
---|---|
account_number |
number |
Returns a single account.
GET /api/account/getall
Returns all accounts that belong to customer.
POST /api/account/deposit
Parameter | Type |
---|---|
account_number |
number |
amount |
string |
Adds money to account balance.
POST /api/account/withdraw
Parameter | Type |
---|---|
account_number |
number |
amount |
string |
Removes money from account balance.
POST /api/account/transactions?size=12&page=0&sort=desc&sortBy=dateTime
Parameter | Type |
---|---|
account_number |
number |
Returns last 12 transactions for account sorted by dateTime and in descending order.
POST /api/transactions/getall
Parameter | Type |
---|---|
account_number |
number |
amount |
string |
Returns all transactions for a account.
POST /api/account/history
Parameter | Type |
---|---|
account_number |
number |
Returns all ending daily balances for a account.
Contributions are always welcome!
If you would like to contribute, reach out via X @FiinnDev