Skip to content

Guia de Introdução / Getting Started Guide

🇧🇷 Pré-requisitos

  • Node.js >= 20.0.0
  • pnpm >= 9.1.0
  • Docker + Docker Compose (para infraestrutura)
  • Make (para comandos automatizados)

🇬🇧 Prerequisites

  • Node.js >= 20.0.0
  • pnpm >= 9.1.0
  • Docker + Docker Compose (for infrastructure)
  • Make (for automated commands)

Setup / Configuração

1. Clone

bash
git clone https://github.com/mateussiqueira/banking-stack.git
cd banking-stack

2. Install dependencies / Instalar dependências

bash
pnpm install

3. Configure environment / Configurar ambiente

bash
cp .env.example .env
# Edit .env if needed (defaults work for local dev)

4. Run setup script / Executar script de setup

bash
make setup
# or manually: bash scripts/setup.sh

5. Start infrastructure / Iniciar infraestrutura

bash
make infra-up

This starts MongoDB 7 (Replica Set), Redis 7, PostgreSQL 16, and MinIO.

6. Start development / Iniciar desenvolvimento

bash
make dev

This starts all services in dev mode with hot-reload.


Running Individual Services / Executando Serviços Individuais

You can run specific services instead of all:

bash
# Ledger (GraphQL)
pnpm --filter @banking/ledger dev

# SPI Simulator
pnpm --filter @banking/spi-simulator dev

# Landing Page (Next.js)
pnpm --filter @banking/landing-page dev

# KYC System (Vite)
pnpm --filter @banking/kyc-system dev

Available Commands / Comandos Disponíveis

CommandDescriptionDescrição
pnpm devStart all servicesIniciar todos os serviços
pnpm buildBuild all packagesCompilar todos os pacotes
pnpm testRun all testsExecutar todos os testes
pnpm lintRun all lintersExecutar linters
pnpm typecheckTypeScript checkVerificação de tipos
pnpm formatFormat codeFormatar código
pnpm cleanClean buildsLimpar builds

Infrastructure / Infraestrutura

CommandDescriptionDescrição
make infra-upStart servicesIniciar serviços
make infra-downStop servicesParar serviços
make infra-logsView logsVer logs
make infra-psList servicesListar serviços
make db-resetReset databasesResetar bancos

Database Shells / Terminais de Banco

bash
make db-shell-mongo     # MongoDB shell
make db-shell-postgres  # PostgreSQL shell
make db-shell-redis     # Redis CLI

Documentation / Documentação

CommandDescriptionDescrição
make docsStart VitePressIniciar servidor de docs
make docs-buildBuild docsCompilar documentação
make docs-previewPreview buildVisualizar build

Environment Variables / Variáveis de Ambiente

See .env.example for all available variables. Defaults are pre-configured for local development.

Key variables:

  • MONGODB_URI — MongoDB connection string
  • REDIS_URI — Redis connection string
  • POSTGRES_URI — PostgreSQL connection string
  • MINIO_ENDPOINT — MinIO S3 endpoint
  • LEDGER_PORT, SPI_SIMULATOR_PORT, etc. — Service ports

Troubleshooting / Solução de Problemas

MongoDB Replica Set

If MongoDB transactions fail, ensure the replica set is initialized:

bash
docker compose exec mongodb mongosh --eval "rs.status()"

Port Conflicts

Check if default ports are available:

  • 27017 (MongoDB)
  • 6379 (Redis)
  • 5432 (PostgreSQL)
  • 9000 (MinIO API)
  • 9001 (MinIO Console)

pnpm Issues

bash
# Clean install
make reinstall

# Or manually
rm -rf node_modules packages/*/*/node_modules
pnpm install