This project is a digital banking application that uses Kafka for event streaming and PostgreSQL for data persistence. The application supports checking accounts, credit cards, and PIX transfers.
- Checking Account Management
- Create accounts
- Deposit and withdraw funds
- Check balance
- Credit Card Operations
- Issue new credit cards
- Make purchases
- Process payments
- PIX Transfers
- Register PIX keys
- Send and receive instant transfers
- Transaction History
- Track all account movements
- Filter by transaction type
- Docker and Docker Compose
- Kubernetes cluster (Docker Desktop Kubernetes, Minikube, or Kind)
- Tilt
- Go 1.21 or higher
- k6 (for load testing)
- Start all services:
docker-compose up -d
- Check the services:
- Banking API: http://localhost:8080
- Kafka UI: http://localhost:8090
- PostgreSQL: localhost:5432
- pgAdmin: http://localhost:5050
- Stop all services:
docker-compose down
The application uses PostgreSQL with the following default settings:
- Database: banco_digital
- User: admin
- Password: admin123
- Port: 5432
The project includes pgAdmin 4 for database management through a web interface.
-
Access pgAdmin at http://localhost:5050
-
Login credentials:
- Email: admin@admin.com
- Password: admin123
-
To connect to the PostgreSQL database:
- Click "Add New Server"
- In "General" tab:
- Name: Banco Digital (or any name you prefer)
- In "Connection" tab:
- Host: postgres
- Port: 5432
- Database: banco_digital
- Username: admin
- Password: admin123
Available features in pgAdmin:
- Database structure visualization
- SQL query execution
- Table management
- Backup and restore
- Performance monitoring
- Make sure your Kubernetes cluster is running:
kubectl cluster-info
- Start the application with Tilt:
tilt up
-
Access the Tilt UI at http://localhost:10350
-
To stop the application:
tilt down
- POST /accounts - Create a new account
- POST /accounts/credit-cards - Issue a new credit card
- POST /accounts/pix-keys - Register a PIX key
- POST /accounts/transactions - Make a transaction
We use k6 for load testing. The test scripts are in the tests/k6
directory.
- Install k6:
# Windows (Chocolatey)
choco install k6
# macOS
brew install k6
- Run the load tests:
k6 run tests/k6/load-test.js
The load test simulates:
- Account creation
- Credit card issuance
- PIX key registration
- Deposits
- Credit card purchases
- PIX transfers
We use Postman to test the API endpoints.
postman login --with-api-key $POSTMAN_API_KEY
postman collection run 6394192-bd1fe6cf-24a1-4514-b211-c52c62ba9c9e
.
├── cmd/
│ └── main.go # Application entry point
├── internal/
│ ├── domain/
│ │ └── models/ # Domain models
│ ├── application/
│ │ └── services/ # Business logic
│ ├── infrastructure/
│ │ └── database/ # Database configuration
│ └── interfaces/
│ └── http/
│ └── handlers/ # HTTP handlers
├── k8s/ # Kubernetes manifests
├── tests/
│ └── k6/ # Load test scripts
├── docker-compose.yml # Docker Compose configuration
├── Dockerfile # Docker build configuration
├── Tiltfile # Tilt configuration
└── README.md # This file
The API documentation is available at http://localhost:8080/swagger/index.html when the application is running.
- Kafka UI: http://localhost:8090 (when running with Docker Compose)
- pgAdmin: http://localhost:5050 (when running with Docker Compose)
- Tilt UI: http://localhost:10350 (when running with Tilt)