RestfulBanker is a simple Java Spring Boot application that provides a REST API for managing bank-related operations with a MySQL database. This project uses Spring Boot to create a scalable and secure backend, and leverages Spring Data JPA for Object-Relational Mapping (ORM) to simplify database interactions.
- Java
- Spring Boot
- Spring Data JPA
- Hibernate ORM
- MySQL
- RESTful API endpoints for performing CRUD operations (Create, Read, Update, Delete) via standard HTTP methods (GET, POST, PUT, DELETE).
- Integration with MySQL for persistent data storage.
- Built with Java Spring Boot and Spring Data JPA.
** The application runs on default port 8080.
-
Clone the repository:
git clone https://github.com/freezin-fire/RestfulBanker.git
-
Navigate to the project directory:
cd RestfulBanker
-
Configure your MySQL database connection in
/src/main/resources/application.properties
-
Build and run the application using Maven:
mvn spring-boot:run
-
Get all accounts:
- Method: GET
- URL:
http://localhost:8080/api/accounts
-
Get details of a specific account by ID:
- Method: GET
- URL:
http://localhost:8080/api/accounts/{id_number}
-
Create a new account:
-
Method: POST
-
URL:
http://localhost:8080/api/accounts
-
Body (JSON):
{ "accountHolderName": "<account_holder_name>", "balance": <balance_value> }
-
-
Deposit amount to a specific account:
-
Method: PUT
-
URL:
http://localhost:8080/api/accounts/{id_number}/deposit
-
Body (JSON):
{ "amount": <deposit_amount> }
-
-
Withdraw amount from a specific account:
-
Method: PUT
-
URL:
http://localhost:8080/api/accounts/{id_number}/withdraw
-
Body (JSON):
{ "amount": <withdraw_amount> }
-
-
Delete an account by ID:
- Method: DELETE
- URL:
http://localhost:8080/api/accounts/{id_number}
This project is licensed under the MIT License.