rinha2-back-end-python

Getting Started

Prerequisites

  • Docker with Docker Compose

Clone and Run

git clone https://github.com/jonathanperis/rinha2-back-end-python.git
cd rinha2-back-end-python
docker compose up nginx -d --build

Access

The API is available at http://localhost:9999

Endpoints

EndpointMethodDescription
/clientes/{id}/transacoesPOSTSubmit debit or credit transaction
/clientes/{id}/extratoGETGet account balance statement
/healthzGETHealth check

Example Requests

Create Transaction

curl -X POST http://localhost:9999/clientes/1/transacoes \
  -H "Content-Type: application/json" \
  -d '{"valor": 1000, "tipo": "c", "descricao": "deposito"}'

Get Statement

curl http://localhost:9999/clientes/1/extrato

Health Check

curl http://localhost:9999/healthz

Run Stress Tests

docker compose up k6 --build --force-recreate