Skip to content

Banking REST API built using Spring Boot, Spring Security, Spring Web, PostgreSQL, and JPA

License

Notifications You must be signed in to change notification settings

TevinDeale/rocket-bank-spring-boot-banking-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rocket Bank Spring Boot API

A banking CRUD API built using the Spring Boot framework and PostgreSQL.

Tech Stack

My Skills

Features

  • 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

Requirements

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

Deployment

This project can be ran locally or in a Docker container. Clone the repository, create sensitive.properties file, and run the following commands.

Docker

Checkout this blog article for steps to containerize this API --> HERE

Locally

Ensure that you have openJDK 21 installed. These next steps are done on a MAC device. Windows commands could differ.

  ./mvnw sprint-boot:run

API Reference

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.

Home Controller

  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.


Customer Controller

  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.


Account Controller

  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.


Transaction Controller

  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.


Ending Daily Balance Controller

  POST /api/account/history
Parameter Type
account_number number

Returns all ending daily balances for a account.


Contributing

Contributions are always welcome!

If you would like to contribute, reach out via X @FiinnDev

About

Banking REST API built using Spring Boot, Spring Security, Spring Web, PostgreSQL, and JPA

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published