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(afternpm 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
./datafor 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_PASSPHRASEis 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.