Skip to content

Getting Started

Prerequisites

  • Node.js >= 20.0.0
  • pnpm >= 9.1.0
  • Docker + Docker Compose (for infrastructure)
  • Make (for automated commands)
  • Go 1.23+ (optional, for Go services)

Quick Start

1. Clone

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

2. Install dependencies

bash
pnpm install

3. Configure environment

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

4. Run setup script

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

5. Start infrastructure

bash
make infra-up

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

6. Start development

bash
make dev

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


Running Individual Services

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

CommandDescription
pnpm devStart all services
pnpm buildBuild all packages
pnpm testRun all tests
pnpm lintRun all linters
pnpm typecheckTypeScript check
pnpm formatFormat code
pnpm cleanClean builds

Infrastructure

CommandDescription
make infra-upStart services
make infra-downStop services
make infra-logsView logs
make infra-psList services
make db-resetReset databases

Database Shells

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

Documentation

CommandDescription
make docsStart VitePress
make docs-buildBuild docs
make docs-previewPreview build

Services

ServicePortHealth Endpoint
SPI Simulator3002/spi/health
DICT Simulator3003/dict/health
ISO 85833004/health
Workflow Engine3005/health
Open Finance3006/health
NFS-e3007/health
Report System3008/health
Leaky Bucket3009/health
Ledger3010/graphql
Landing Page3000-
KYC System5173-

Environment Variables

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

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