Skip to content

System Architecture / Arquitetura do Sistema

Overview

Banking Challenges is a monorepo managed by Turborepo with pnpm workspaces. Each challenge is an independent package, but all share one vision: simulating real Brazilian financial systems with the most appropriate technology for each problem.

Switch: TypeScript vs Go

Full Stack

LayerTechnologyChallenges
BackendTypeScript (Koa, Fastify, Express)01, 05, 06, 07, 08, 09
FrontendNext.js 14, Vite + React10, 11
DatabaseMongoDB, PostgreSQL, RedisAll
InfraDocker, Kubernetes, Proxmox12
CI/CDGitHub Actions, GitLab CI13
DocsVitePressAll

Challenge Mapping

#ChallengeMain StackDatabase
01Ledger GraphQLKoa + GraphQLMongoDB
02SPI SimulatorGo (Gin) + ISO 20022In-memory
03DICT SimulatorGo (Gin) + RESTIn-memory
04ISO 8583TCP Server + GoPostgreSQL
05Workflow EngineFastify + DAGRedis
06Open FinanceFastify + FAPIPostgreSQL
07NFS-eFastify + SOAPPostgreSQL
08Report SystemFastify + StreamingPostgreSQL
09Leaky BucketFastify + LuaRedis
10Landing PageNext.js 14-
11KYC SystemVite + ReactPostgreSQL
12Proxmox + IaCTerraform + Ansible-
13CI/CDGitHub Actions-
14RFC / ADRMarkdown-
15PISPOpen Finance + FAPIPostgreSQL
16AnticipationPricing EnginePostgreSQL

Security

LayerTechnology
TransportTLS 1.3, mTLS
AuthJWT, OAuth 2.0, FAPI
CryptoAES-256, RSA, 3DES
Rate LimitingLeaky Bucket (Redis + Lua)
AuditImmutable logs, 5+ years

How to test

bash
# Start everything
docker compose up -d

# Test Ledger
curl -X POST http://localhost:3001/graphql \
  -H "Content-Type: application/json" \
  -d '{"query":"{ accounts { id name balance } }"}'

# Test SPI (Go)
cd packages/backend/spi-simulator-go
go run .

# Test ISO 8583
echo "0100..." | nc localhost 3004

Lessons learned

  1. Monorepo with Turborepo — Independence between challenges, shared code
  2. Go for critical services — SPI, DICT, ISO 8583 need performance
  3. TypeScript for APIs — GraphQL, REST, webhooks are more productive in TS
  4. Docker Compose — Complete local infra (MongoDB, PostgreSQL, Redis, MinIO)
  5. Financial standards — ISO 20022, ISO 8583, ABRASF are not optional
  6. Security in layers — TLS, JWT, mTLS, rate limiting, audit
  7. Living docs — VitePress with i18n PT/EN
  8. CI/CD mandatory — Every change goes through tests and approval