Skip to main content

Quick Start

You can run the backend in two modes: Dockerized (recommended) or Local Development.


Prerequisites

  • Node.js v18.13.0 or higher
  • Docker & Docker Compose v2.0+
  • PostgreSQL v14+ (if running locally)

cd stablecoin-studio/apps/backend
cp .env.example .env
# Edit .env with your Hedera credentials (see Configuration below)
docker-compose up -d --build
  • API: http://localhost:3001
  • Swagger: http://localhost:3001/api
  • Database: Port 5432

Option 2: Local Development

npm install
docker-compose up -d postgres # DB only
npm run typeorm:migration:run # Sync schema
npm run start:dev # Watch mode

Configuration (.env)

General Settings

VariableDescriptionDefault
PORTAPI listening port3001
NODE_ENVEnvironment contextdevelopment
GLOBAL_REQUEST_LIMITRate limiting (req/min)100

Database Connection

VariableDescriptionExample
DATABASE_HOSTHostnamelocalhost or postgres
DATABASE_PORTPort5432
DATABASE_USERDB Userpostgres
DATABASE_PASSWORDDB Passwordsecret
DATABASE_NAMEDB Namestablecoin_studio

Hedera Network

VariableDescriptionRequired
HEDERA_NETWORKtestnet, previewnet, or mainnetYes
OPERATOR_IDAccount ID paying for backend txsYes
OPERATOR_KEYPrivate Key (ECDSA/ED25519)Yes
MIRROR_NODE_URLCustom Mirror Node endpointNo

Running Tests

npm run test        # Unit tests
npm run test:e2e # Integration tests (requires DB)
npm run test:cov # Coverage report