How douglasendrew/fake-bank-api works
Fake Bank API is a Hyperf financial-services API. Clients authenticate or request account, deposit and PIX operations; status and statement endpoints expose progress and results. The documented asynchronous path queues account creation, deposits and confirmed PIX transfers for Kafka consumers, which apply domain changes through repositories. The graph preserves documented account, audit/security and PIX-key capabilities. Some use cases, consumers and integrations were not excerpted, so their links rely on README claims or SOURCE INDEX references rather than inspected implementation details.
Main entry points: routes.php API Routes · KafkaEventProducer.php Event Producer · PixController.php PIX API · Account.php Account and Transaction Model
Components 25
HTTP and Security
- API Routes
config/routes.php - Account API
app/Interfaces/Http/Controllers/AccountController.php - Authentication API
app/Interfaces/Http/Controllers/AuthController.php - Deposit API
app/Interfaces/Http/Controllers/DepositController.php - PIX API
app/Interfaces/Http/Controllers/PixController.php - JWT Service
app/Infrastructure/Security/JwtService.php
Financial Workflows
- Login Use Case
app/Application/UseCases/Auth/AuthenticateUserUseCase.php - Account Use Cases
app/Application/UseCases/Account/CreateAccountUseCase.php - Statement Use Case
app/Application/UseCases/Account/GetAccountStatementUseCase.php - Deposit Use Cases
app/Application/UseCases/Deposit/DepositMoneyUseCase.php - PIX Creation
app/Application/UseCases/Pix/CreatePixTransferUseCase.php - PIX Confirmation
app/Application/UseCases/Pix/SendPixTransferUseCase.php - PIX Key Use Cases
app/Application/UseCases/Pix/RegisterPixKeyUseCase.php
Async Processing
- Event Producer
app/Infrastructure/Kafka/Producer/KafkaEventProducer.php - Account Consumer
app/Infrastructure/Kafka/Consumer/AccountCreationConsumer.php - Deposit Consumer
app/Infrastructure/Kafka/Consumer/DepositTransactionConsumer.php - PIX Consumer
app/Infrastructure/Kafka/Consumer/PixTransferConsumer.php - Account Handler
app/Application/Handlers/ProcessAccountCreationHandler.php - Deposit Handler
app/Application/Handlers/ProcessDepositHandler.php - PIX Handler
app/Application/Handlers/ProcessPixTransferHandler.php
Domain and Persistence
- Account and Transaction Model
app/Domain/Account/Entities/Account.php - Persistence Repositories
app/Infrastructure/Persistence/Repositories/AccountRepository.php - PostgreSQL
- Redis Rate Limit and Cache
Other components
- API Client
Connections 31
- API Client → API Routes: sends requests
config/routes.php - API Routes → Account API: routes account requests
config/routes.php - API Routes → Authentication API: routes login
config/routes.php - API Routes → Deposit API: routes deposits
config/routes.php - API Routes → PIX API: routes PIX
config/routes.php - Authentication API → Login Use Case: executes
app/Interfaces/Http/Controllers/AuthController.php - Login Use Case → JWT Service: issues tokens
app/Application/UseCases/Auth/AuthenticateUserUseCase.php - API Routes → JWT Service: protects routes
config/routes.php - Account API → Account Use Cases: executes
app/Interfaces/Http/Controllers/AccountController.php - Account API → Statement Use Case: executes
app/Interfaces/Http/Controllers/AccountController.php - Deposit API → Deposit Use Cases: executes
app/Interfaces/Http/Controllers/DepositController.php - PIX API → PIX Creation: creates transfer
app/Interfaces/Http/Controllers/PixController.php - PIX API → PIX Confirmation: confirms transfer
app/Interfaces/Http/Controllers/PixController.php - PIX API → PIX Key Use Cases: manages keys
app/Interfaces/Http/Controllers/PixController.php - Account Use Cases → Event Producer: publishes event
app/Application/UseCases/Account/CreateAccountUseCase.php - PIX Confirmation → Event Producer: publishes event
app/Application/UseCases/Pix/SendPixTransferUseCase.php - Deposit Use Cases → Event Producer: queues deposit
- Event Producer → Account Consumer: dispatches account event
- Event Producer → Deposit Consumer: dispatches deposit event
- Event Producer → PIX Consumer: dispatches PIX event
- Account Consumer → Account Handler: processes event
- Deposit Consumer → Deposit Handler: processes event
- PIX Consumer → PIX Handler: processes event
- Account Handler → Account and Transaction Model: creates account
app/Application/Handlers/ProcessAccountCreationHandler.php - Deposit Handler → Account and Transaction Model: updates balance
app/Application/Handlers/ProcessDepositHandler.php - PIX Handler → Account and Transaction Model: settles transfer
app/Application/Handlers/ProcessPixTransferHandler.php - Account Use Cases → Account and Transaction Model: uses account model
app/Application/UseCases/Account/CreateAccountUseCase.php - Statement Use Case → Persistence Repositories: reads activity
app/Application/UseCases/Account/GetAccountStatementUseCase.php - Persistence Repositories → PostgreSQL: persists records
app/Infrastructure/Persistence/Repositories/AccountRepository.php - PIX Handler → Persistence Repositories: saves balances and transactions
app/Application/Handlers/ProcessPixTransferHandler.php - API Routes → Redis Rate Limit and Cache: rate limits