Getting Started
This guide will help you set up the NorChain monorepo and get all services running.
Prerequisites
- Node.js >= 18.0.0
- npm >= 9.0.0
- PostgreSQL >= 14 (or Supabase account)
- Redis (optional, for caching)
Installation
1. Clone Repository
git clone https://github.com/nor-chain/norchain-monorepo
cd norchain-monorepo2. Install Dependencies
npm installThis installs dependencies for all workspace packages.
Environment Setup
Explorer API
Create apps/explorer-api/.env:
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/norchain
# OR Supabase
SUPABASE_URL=https://your-project.supabase.co
SUPABASE_KEY=your-anon-key
# Server
PORT=3000
NODE_ENV=development
# JWT
JWT_SECRET=your-secret-key-change-in-production
JWT_EXPIRES_IN=7d
# Redis (optional)
REDIS_HOST=localhost
REDIS_PORT=6379
# Blockchain RPC
RPC_URL=https://rpc.norchain.org
CHAIN_ID=65001
# CORS
CORS_ORIGIN=http://localhost:3002,http://localhost:3010,http://localhost:3001Explorer App
Create apps/explorer/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:3000/api/v1
NEXT_PUBLIC_RPC_URL=https://rpc.norchain.org
NEXT_PUBLIC_CHAIN_ID=65001Landing Page
Create apps/landing/.env.local:
NEXT_PUBLIC_API_URL=http://localhost:3000/api/v1NEX Exchange
Create apps/nex-exchange/.env.local:
NEXT_PUBLIC_EXPLORER_API_URL=http://localhost:3000
NEXT_PUBLIC_RPC_URL=https://rpc.norchain.org
NEXT_PUBLIC_CHAIN_ID=65001Running Services
Start All Services
npm run devThis starts all services in parallel.
Start Individual Services
# Explorer API
npm run explorer:dev
# Explorer App
cd apps/explorer && npm run dev
# Landing Page
cd apps/landing && npm run dev
# NEX Exchange
npm run nex:dev
# Docs
cd apps/docs && npm run devService Ports
| Service | Port | URL |
|---|---|---|
| Explorer API | 3000 | http://localhost:3000 |
| Explorer App | 3002 | http://localhost:3002 |
| Landing Page | 3010 | http://localhost:3010 |
| NEX Exchange | 3001 | http://localhost:3001 |
| Documentation | 3011 | http://localhost:3011 |
Verify Installation
-
Check Explorer API
curl http://localhost:3000/api/v1/health -
Check Swagger Docs Open http://localhost:3000/api-docs
-
Check Explorer App Open http://localhost:3002
-
Check Landing Page Open http://localhost:3010
Next Steps
- Read the Architecture guide
- Explore API Documentation
- Check Development Guide