claudiodeveloper-github /
banco-digital-api
API REST bancária desenvolvida com Spring Boot, Java 21, JPA/Hibernate e MySQL para gerenciamento de contas e transações financeiras.
Loading repository data…
murilopysklewitz / repository
API REST bancária com Clean Architecture (DDD), autenticação JWT com rotação de refresh tokens e eventos via RabbitMQ. Testes de integração com Testcontainers, documentação Swagger e deploy em AWS EC2. Java Spring Boot PostgreSQL RabbitMQ Docker AWS
A RESTful banking API built with Spring Boot, implementing clean architecture (DDD), JWT authentication, and asynchronous event publishing via RabbitMQ.
src/main/java/com/SecureBankingApi/
├── application/
│ ├── config/ # Use case bean configuration
│ ├── exceptions/ # Business exceptions
│ ├── services/ # JwtService, RefreshTokenService
│ └── usecases/ # Application use cases (one per action)
├── domain/
│ ├── account/ # Account aggregate (Account, Money, AccountNumber)
│ ├── refreshToken/ # RefreshToken aggregate
│ ├── transaction/ # Transaction aggregate + event ports
│ └── user/ # User aggregate + domain ports
└── infrastructure/
├── api/ # REST controllers, DTOs, exception handler
├── config/ # OpenAPI/Swagger configuration
├── messaging/ # RabbitMQ publisher implementation
├── persistence/ # JPA entities, mappers, repository adapters
└── security/ # JWT filter, BCrypt hasher, SecurityConfig
The project follows Domain-Driven Design with a strict separation between domain, application, and infrastructure layers. Domain interfaces are implemented by infrastructure adapters (Ports & Adapters pattern).
USER, ADMIN, READ_ONLY rolesTransactionCompletedEvent to RabbitMQ after each transfer/actuator/health, /actuator/info, /actuator/metrics)/swagger-ui.html| Layer | Technology |
|---|---|
| Language | Java 21 |
| Framework | Spring Boot 3 |
| Security | Spring Security + JJWT |
| Persistence | Spring Data JPA + PostgreSQL |
| Migrations | Flyway |
| Messaging | RabbitMQ (Spring AMQP) |
| Build | Maven |
| Containerization | Docker / Docker Compose |
| API Docs | SpringDoc OpenAPI (Swagger) |
The application uses Spring profiles. Set --spring.profiles.active=docker to activate the production profile.
.env)DB_URL=jdbc:postgresql://host:5432/dbname
DB_USERNAME=your_db_user
DB_PASSWORD=your_db_password
RABBITMQ_USERNAME=admin
RABBITMQ_PASSWORD=admin
JWT_SECRET=your-256-bit-secret-key-at-least-32-characters
JWT_ACCESS_TOKEN_EXPIRATION=900000 # 15 minutes in ms
JWT_REFRESH_TOKEN_EXPIRATION=604800000 # 7 days in ms
Place the .env file at SecureBankingApi/.env (referenced in docker-compose.yml).
# From the root of the project
docker-compose up --build
This starts:
5672 (AMQP) and 15672 (Management UI)3000 (mapped from internal 8080)Access the API at http://localhost:3000 and Swagger at http://localhost:3000/swagger-ui.html.
Migrations run automatically on startup.
| Version | Description |
|---|---|
| V1 | Create users table |
| V2 | Create accounts table |
| V3 | Create refresh_tokens table |
| V4 | Create transactions table |
| V5 | Add source_account_id / destination_account_id FK columns to transactions |
| V6 | Make transaction party columns nullable (to support deposits and withdrawals) |
/api/auth| Method | Path | Description | Auth |
|---|---|---|---|
POST | /register | Register a new user | Public |
POST | /login | Login and receive tokens | Public |
POST | /refresh | Refresh access token | Public |
POST | /revoke | Revoke refresh token (logout) | Public |
/api/accounts| Method | Path | Description | Auth |
|---|---|---|---|
POST | /create | Create a new account | USER |
GET | / | List authenticated user's accounts | USER |
GET | /{id} | Get account details | USER / ADMIN |
GET | /{id}/balance | Get account balance | USER / ADMIN |
PUT | /{id}/block | Block an account | ADMIN |
PUT | /{id}/unblock | Unblock an account | ADMIN |
DELETE | /{id} | Close an account | USER / ADMIN |
/api/transaction| Method | Path | Description | Auth |
|---|---|---|---|
POST | /transfer | Transfer between accounts | USER |
POST | /deposit | Deposit into account | USER |
POST | /withdraw | Withdraw from account | USER |
POST | /reverse/{transactionId} | Reverse a completed transaction | ADMIN |
GET | /account/{accountId} | Paginated transaction history | USER / ADMIN |
GET | /{transactionId} | Get transaction details | USER / ADMIN |
POST /api/auth/register → user created + CHECKING account opened
POST /api/auth/login → { accessToken, refreshToken, expiresIn }
↓
Attach: Authorization: Bearer <accessToken>
↓
POST /api/auth/refresh → { newAccessToken, expiresIn }
POST /api/auth/revoke → 204 No Content (token invalidated)
After a successful transfer, a TransactionCompletedEvent is published to:
transaction.exchange (Topic)transaction.completedtransaction.queueThe event payload contains source/destination emails, transaction ID, amount, type, and completion timestamp. This event is consumed by the Notification Service.
mvn test
The test suite includes:
WebTestClient + Testcontainers (PostgreSQL + RabbitMQ)ADMIN users can block/unblock accounts and reverse transactionsSelected from shared topics, language and repository description—not editorial ratings.
claudiodeveloper-github /
API REST bancária desenvolvida com Spring Boot, Java 21, JPA/Hibernate e MySQL para gerenciamento de contas e transações financeiras.
Axel-Guzman-20 /
API REST para la realizacion de transacciones bancarias utilizando: IDE IntelliJ, Java, spring boot , Maven, Junit, Mockito,SOLID, Base de Datos SQL H2, Docker
cauaemanuel /
Este repositório contém uma API REST desenvolvida com Spring Boot para gerenciar usuários, contas bancárias e ações. Projeto feito com Java, Spring Boot, Open Feign, Bean Validation e MapStruct
jaguilar05 /
En este repositorio podrán encontrar el desarrollo de una API REST con Java, utilizando el framework de Spring boot y Spring Data JPA que esta conectado con una base de datos PostgreSQL. Se trata de una relación entre estudiantes, cuentas bancarias y libros, donde cada estudiante tiene una cuenta bancaria y puede estar relacionado con varios libros
GabrielFDuarte /
API REST bancária para o desafio da Maida;health
Oswe-gif /
Backend del microservicio de cuentas bancarias con API REST opera en conjunto con el microservicio de transacciones.