Skip to main content

Setup and Build

Setup and Build - Backend

Prerequisites

  • Node.js 20.x
  • npm 9.x+

Setup

cd backend-veri-wallet
npm install
# required for key decryption/encryption
export KEYPAIR_PASSPHRASE="strong-passphrase"

Build

npm run build

Build artifacts land in backend-veri-wallet/dist.

Run

  • Development (watch): npm run start:dev
  • Debug (watch + inspector): npm run start:debug
  • Production: npm run start:prod (after npm run build)

The service persists credentials and keys under backend-veri-wallet/data/ (created automatically). Keys are AES-GCM encrypted; set KEYPAIR_PASSPHRASE before start.

Test

npm test            # runs Jest unit tests
npm test -- --runInBand # helpful on low-resource runners

Docker

  • Build image (from backend-veri-wallet):
    npm run docker:build
  • Run container (exposes 3000, mounts ./data for persistence):
    npm run docker:run
    # or directly:
    # docker run --rm -p 3000:3000 -e KEYPAIR_PASSPHRASE="change-me" -v ${PWD}/data:/app/data backend-veri-wallet
  • Notes: KEYPAIR_PASSPHRASE is required to decrypt/encrypt the signing keypair. Keep the passphrase consistent if you want to reuse the same encrypted keypair stored in ./data/keypair.json.