You can also use managed services like Supabase for PostgreSQL and Upstash for Redis instead of Docker.
Installation
Set up OFFER-HUB Orchestrator locally with Node.js, PostgreSQL, and Redis.
This guide walks you through setting up the OFFER-HUB Orchestrator for local development. You can also use the SDK without running your own instance - see Using the SDK below.
Prerequisites
Before you begin, make sure you have:
- Node.js v20 or later (nodejs.org)
- npm v10 or later
- Docker and Docker Compose (for PostgreSQL and Redis)
- A Trustless Work API key (for escrow)
Option 1: Full Local Setup
Step 1 - Clone the Repository
git clone https://github.com/OFFER-HUB/OFFER-HUB-Orchestrator.git && cd OFFER-HUB-OrchestratorStep 2 - Install Dependencies
npm installStep 3 - Start Infrastructure
Start PostgreSQL and Redis using Docker Compose:
docker compose up -dThis starts:
- PostgreSQL on port
5432 - Redis on port
6379
Step 4 - Configure Environment
Copy the example environment file:
cp .env.example .envEdit .env with your values. The minimum required variables for local development:
Generate your WALLET_ENCRYPTION_KEY with: openssl rand -hex 32
Store this key securely - losing it makes wallet private keys unrecoverable.
Step 5 - Run Database Migrations
Generate the Prisma client and apply migrations:
npm run prisma:generate && npm run prisma:migrateStep 6 - Bootstrap Platform User
Create the internal platform user required for escrow operations:
npm run bootstrapStep 7 - Start the API
npm run devThe API starts on http://localhost:4000.
Step 8 - Verify Installation
Test that everything is working:
curl http://localhost:4000/api/v1/healthYou should see:
Option 2: Using the SDK Only
If you want to integrate with an existing OFFER-HUB Orchestrator instance (hosted by you or a partner), you only need the SDK:
npm install @offerhub/sdkThen configure it in your code:
See the SDK Guide for complete documentation.
Option 3: Using npm create (Coming Soon)
The installer script npm create offer-hub-orchestrator@latest is coming soon and will automate this entire setup process.
Creating Your First API Key
Once the server is running, create an API key using your master key:
Response:
Save the key value immediately - it's only shown once. Use this key for all subsequent API calls.
Troubleshooting
Database Connection Failed
Make sure Docker is running and the containers are up:
docker compose psIf containers aren't running, start them:
docker compose up -dPrisma Migration Errors
If you see migration errors, try resetting the database:
npm run prisma:migrate resetThis deletes all data. Only use in development.
Port Already in Use
If port 4000 is already in use, change the PORT in your .env file or stop the conflicting service.
Next Steps
- Configuration - Learn about all environment variables
- Quick Start - Create your first user and order
- API Reference - Explore all endpoints
- SDK Guide - Integrate using TypeScript