https://github.com/jotabrc/demo-bank-api
Demo Project of RESTful API simulating an Bank
https://github.com/jotabrc/demo-bank-api
demo-app java jwt-authentication lombok maven postgresql railway spring spring-boot spring-security spring-web
Last synced: 2 months ago
JSON representation
Demo Project of RESTful API simulating an Bank
- Host: GitHub
- URL: https://github.com/jotabrc/demo-bank-api
- Owner: jotabrc
- Created: 2025-03-18T22:53:37.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-19T23:52:36.000Z (over 1 year ago)
- Last Synced: 2025-04-03T00:28:15.742Z (about 1 year ago)
- Topics: demo-app, java, jwt-authentication, lombok, maven, postgresql, railway, spring, spring-boot, spring-security, spring-web
- Language: Java
- Homepage:
- Size: 47.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# demo Bank RESTful API
- Spring Boot;
- Spring Web;
- Spring Security;
- JWT for security;
- Spring Data JPA;
- OpenAPI (Swagger) for endpoints documentation;
- H2 database in development;
- PostgresSQL in production;
- Lombok for clean code;
- Logback (Sl4j) for logging;
- Deployment with Railway;
## Usage
Access: `/swagger-ui/index.html` for endpoint JSON templates and more information on endpoints.
- `POST` `/login` for authentication, retuns JWT toekn `Bearer`.
- `POST` `/register` user creation, retuns user with created accounts `SAVINGS` and `CHECKING` with balance 0.0 and `CHECKING` with `maxLimit` and `availableLimit` of `1000.00`.
- `WITHDRAWAL` is only available for the account owner.
- `DEPOSIT` can be made to any valid account.
- `POST` `/accounts` user must provider token for authentication obtained in the /login endpoint, and a account to DEPOSIT or WITHDRAWAL.
- `GET` `/users/{username}` retrieve user information.
## Diagram
```mermaid
erDiagram
USER {
long id
string username
string password
string salt
integer version
}
USER ||--o{ ACCOUNT : "accounts"
ACCOUNT {
long id
string accountNumber
BigDecimal balance
AccountType accountType
BigDecimal availableLimit
BigDecimal maxLimit
}
```