This guide explains how to set up and run the Ordo platform locally for development.
- Node.js 20+ installed
- npm or yarn installed
- Git installed
- Docker and Docker Compose (optional, for containerized development)
- Solana CLI tools (optional, for local validator)
git clone https://github.com/ordo-platform/ordo.git
cd ordonpm install# Copy environment template
cp .env.example .env
# Edit with your configuration
nano .envFor local development, you can use:
- Local Solana validator (see below)
- Helius devnet RPC
- Local Supabase instance or cloud Supabase
# Start with hot reload
npm run dev
# Or with debugger
npm run dev:debugRun directly on your machine with hot reload:
# Install dependencies
npm install
# Start development server
npm run devFeatures:
- Hot reload on file changes
- Fast iteration
- Direct debugging
- No Docker overhead
Run in Docker containers with hot reload:
# Start all services
npm run dev:docker
# Or build and start
npm run dev:docker:build
# Stop services
npm run dev:docker:downFeatures:
- Isolated environment
- Includes PostgreSQL, Redis, Solana validator
- Consistent across machines
- Easy cleanup
Run app natively, services in Docker:
# Start only services
docker-compose -f docker-compose.dev.yml up postgres-dev redis-dev solana-validator-dev
# In another terminal, run app
npm run devFeatures:
- Best of both worlds
- Fast app iteration
- Isolated services
- Flexible configuration
docker-compose -f docker-compose.dev.yml up solana-validator-dev# Install Solana CLI
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
# Start validator
npm run dev:validator
# Or manually
solana-test-validator --reset --quietAccess:
- RPC: http://localhost:8899
- Faucet: http://localhost:8900
- WebSocket: ws://localhost:9900
docker-compose -f docker-compose.dev.yml up postgres-dev# Install PostgreSQL
# macOS
brew install postgresql@15
# Ubuntu
sudo apt install postgresql-15
# Start PostgreSQL
brew services start postgresql@15
# Create database
createdb ordo_devAccess:
- Host: localhost
- Port: 5432
- User: ordo_dev
- Password: ordo_dev_password
- Database: ordo_dev
docker-compose -f docker-compose.dev.yml up redis-dev# Install Redis
# macOS
brew install redis
# Ubuntu
sudo apt install redis-server
# Start Redis
brew services start redisAccess:
- Host: localhost
- Port: 6379
docker-compose -f docker-compose.dev.yml --profile supabase-local up supabase-dev# Install Supabase CLI
npm install -g supabase
# Initialize Supabase
supabase init
# Start Supabase
supabase startAccess:
- API: http://localhost:54321
- Studio: http://localhost:54323
- Database: postgresql://postgres:postgres@localhost:54322/postgres
git checkout -b feature/my-featureEdit files in src/ directory. The dev server will automatically reload.
# Run all tests
npm test
# Run tests in watch mode
npm run test:watch
# Run with coverage
npm run test:coverage# Lint code
npm run lint
# Format code
npm run format# Build TypeScript
npm run build
# Clean build artifacts
npm run cleangit add .
git commit -m "feat: add my feature"
git push origin feature/my-featureCreate .vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Ordo",
"runtimeExecutable": "npm",
"runtimeArgs": ["run", "dev:debug"],
"port": 9229,
"skipFiles": ["<node_internals>/**"],
"console": "integratedTerminal"
}
]
}# Start with debugger
npm run dev:debug
# Open Chrome
chrome://inspect
# Click "inspect" on your Node.js process# Start with debugger exposed
docker-compose -f docker-compose.dev.yml up
# Debugger available at localhost:9229# Run all tests
npm test
# Run specific test file
npm test src/identity/keypair.test.ts
# Run tests matching pattern
npm test -- --grep "keypair"# Run property tests
npm test -- --grep "Property"
# Run with more iterations
FAST_CHECK_NUM_RUNS=1000 npm test# Start services
docker-compose -f docker-compose.dev.yml up -d
# Run integration tests
npm test -- --grep "integration"
# Stop services
docker-compose -f docker-compose.dev.yml down# Solana (Local Validator)
SOLANA_RPC_URL=http://localhost:8899
SOLANA_NETWORK=localnet
# OpenRouter (Required)
OPENROUTER_API_KEY=your_key_here
# Supabase (Local or Cloud)
SUPABASE_URL=http://localhost:54321
SUPABASE_ANON_KEY=your_key_here
# Development Settings
NODE_ENV=development
LOG_LEVEL=debug
DEBUG=true# Solana Devnet
SOLANA_RPC_URL=https://api.devnet.solana.com
SOLANA_NETWORK=devnet
HELIUS_API_KEY=your_helius_devnet_key
# Request devnet SOL from faucet
# solana airdrop 2 <your-address> --url devnetThe development server uses tsx watch for hot reload:
npm run devChanges to TypeScript files will automatically:
- Recompile TypeScript
- Restart the application
- Preserve state where possible
# Using Supabase CLI
supabase migration new my_migration
# Edit migration file
nano supabase/migrations/YYYYMMDDHHMMSS_my_migration.sql# Local
supabase db push
# Production
supabase db push --linked# Local
supabase db reset
# Docker
docker-compose -f docker-compose.dev.yml down -v
docker-compose -f docker-compose.dev.yml up -d# Find process using port
lsof -i :3000
# Kill process
kill -9 <PID>
# Or use different port
PORT=3001 npm run dev# Clean install
rm -rf node_modules package-lock.json
npm install# Clean build
npm run clean
npm run build# Reset validator
solana-test-validator --reset
# Check validator status
solana cluster-version --url http://localhost:8899# Check PostgreSQL status
docker-compose -f docker-compose.dev.yml ps postgres-dev
# View logs
docker-compose -f docker-compose.dev.yml logs postgres-dev
# Restart database
docker-compose -f docker-compose.dev.yml restart postgres-devUse tsx for faster TypeScript execution:
npm run dev # Uses tsx watchTypeScript is configured for incremental builds:
{
"compilerOptions": {
"incremental": true
}
}Run tests in parallel:
npm test -- --reporter=verbose --threadsInstall pre-commit hooks:
# Install husky
npm install -D husky
# Set up hooks
npx husky install
# Add pre-commit hook
npx husky add .husky/pre-commit "npm run lint && npm test"- ESLint
- Prettier
- TypeScript
- Docker
- GitLens
Create .vscode/settings.json:
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"typescript.tsdk": "node_modules/typescript/lib"
}- Read Architecture Guide
- Review API Reference
- Check Testing Guide
- Explore Examples
- Join Discord Community
- GitHub Issues: https://github.com/ordo-platform/ordo/issues
- Discord: https://discord.gg/ordo
- Documentation: https://docs.ordo.dev