Skip to main content

Prerequisites

Before you begin, ensure you have the following installed:
  • Docker (v20.10+) and Docker Compose (v2.0+)
  • Git for cloning the repository
  • Node.js 18+ or Bun (optional, for local development)
  • At least 4GB of available RAM for all services
The platform uses Docker to orchestrate multiple services including PostgreSQL, TimeScaleDB, Redis, and MongoDB. All services are configured with health checks and automatic restarts.

Installation

1

Clone the Repository

Clone the Exness Trading Platform repository from GitHub:
git clone https://github.com/lakshay-goyal/Exness.git
cd Exness
2

Configure Environment Variables

Copy the example environment file and configure your settings:
cp .env.example .env
Edit the .env file with your configuration:
.env
# Redis Configuration
REDIS_URL=redis://localhost:6379

# Binance WebSocket API
BINANCE_WS_URL=wss://ws.backpack.exchange/

# TimeScaleDB Configuration
TIMESCALE_DB_USER=myuser
TIMESCALE_DB_PASSWORD=mypassword
TIMESCALE_DB_HOST=localhost
TIMESCALE_DB_PORT=5433
TIMESCALE_DB_NAME=mydb

# JWT Authentication
JWT_SECRET=mysecret

# Application URLs
PORT=8000
FRONTEND_URL=http://localhost:3001
BACKEND_URL=http://localhost:8000
WEBSOCKET_PORT=7070

# PostgreSQL Database
DATABASE_URL=postgresql://postgresql:postgresql@localhost:5434/exness

# MongoDB for Snapshots
MONGODB_URL=mongodb://admin:admin123@localhost:27017/exness_snapshots?authSource=admin

# Email Configuration (optional for production)
USER_EMAIL=[email protected]
USER_PASSWORD=your-app-password

NODE_ENV=production
Make sure to change the JWT_SECRET to a secure random string in production. Never commit your .env file to version control.
3

Start the Platform with Docker Compose

Launch all services using Docker Compose:
docker-compose up -d
This command will:
  • Pull and build all required Docker images
  • Start PostgreSQL, TimeScaleDB, Redis, and MongoDB databases
  • Run database migrations with Prisma
  • Launch all microservices (Backend, Engine, WebSocket Server, Price Poller, DBstorage, Batch Upload)
  • Start the web frontend and documentation site
The first startup may take 5-10 minutes as Docker downloads images and builds the services. Subsequent starts will be much faster.
4

Verify Services Are Running

Check that all services are healthy:
docker-compose ps
You should see all services with Up status:
NAME                        STATUS
exness-backend              Up
exness-engine               Up
exness-websocket-server     Up
exness-price-poller         Up
exness-dbstorage            Up
exness-batch-upload         Up
exness-web                  Up
exness-postgres             Up (healthy)
exness-timescaledb          Up (healthy)
exness-redis                Up (healthy)
exness-mongodb              Up (healthy)

Access the Platform

Once all services are running, you can access:

Trading Web Interface

Main trading platform UI at http://localhost:3001

API Backend

REST API endpoints at http://localhost:8000

Documentation

This documentation site at http://localhost:3000

Prisma Studio

Database management UI at http://localhost:5555

First User Authentication

Follow these steps to authenticate your first user:
1

Send Login Request

Make a POST request to the login endpoint:
curl -X POST http://localhost:8000/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{"email": "[email protected]"}'
Or use the web interface at http://localhost:3001 to enter your email.
2

Get Verification Link

In development mode, the verification link is logged to the console instead of being emailed. Check the backend logs:
docker logs exness-backend
Look for a line like:
🔗 Verification link: http://localhost:8000/api/v1/auth/verify?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
3

Verify and Create User

Visit the verification link in your browser. This will:
// Backend verification flow (auth.routes.ts:53-106)
1. Verify JWT token signature
2. Extract userId and email from token
3. Send createUser message to Engine via Redis Streams
4. Engine creates user in-memory with initial balance
5. DBstorage persists user to PostgreSQL
6. Redirect to dashboard with auth token
The system creates a new user with:
  • Initial balance: $100,000 USDC (demo account)
  • Unique user ID (UUID v4)
  • Email address for identification
4

Access the Dashboard

After verification, you’ll be redirected to:
http://localhost:3001/dashboard?token=<your-jwt-token>
The web app stores the token and uses it for subsequent API requests:
// Example: Authenticated API request
const response = await fetch('http://localhost:8000/api/v1/balance', {
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  }
});

Understanding the Data Flow

Here’s what happens when you authenticate:
// 1. User sends email to /api/v1/auth/login
authRouter.post("/login", async (req: Request, res: Response) => {
  const { email } = req.body;
  const userId = uuidv4();
  
  // Create JWT token with userId and email
  const token = jwt.sign({ userId, email }, jwtSecret);
  
  // In development, log verification link
  console.log(`🔗 Verification link: ${config.BACKEND_URL}/api/v1/auth/verify?token=${token}`);
  
  res.json({ message: "Verification link sent", email });
});

Development Workflow

For local development without Docker:
# Install dependencies
bun install

# Start databases (PostgreSQL, Redis, TimeScaleDB)
docker-compose up postgres redis timescaledb -d

# Run database migrations
cd packages/db
bun run db:deploy

# Start specific service
bun run dev --filter=backend
bun run dev --filter=web
bun run dev --filter=engine

# Or start all services
bun run dev
The platform uses Turborepo for efficient monorepo management. Changes to shared packages (@repo/config, @repo/db, etc.) automatically trigger rebuilds in dependent services.

Common Issues

Another application is using one of the required ports. Check and stop services on:
  • 3000 (docs)
  • 3001 (web)
  • 5433 (TimeScaleDB)
  • 5434 (PostgreSQL)
  • 6379 (Redis)
  • 7070 (WebSocket)
  • 8000 (Backend API)
  • 27017 (MongoDB)
# Find process using a port
lsof -i :8000
# Kill the process
kill -9 <PID>
Ensure PostgreSQL is fully started before migrations run:
# Check PostgreSQL health
docker-compose ps postgres

# Manually run migrations
docker-compose run db-migrate
The Price Poller connects to Binance WebSocket API. Check:
  1. Internet connectivity
  2. Price Poller logs: docker logs exness-price-poller
  3. WebSocket URL in .env is correct
# Restart Price Poller
docker-compose restart price-poller
The Engine service may not be processing Redis Streams. Check:
# Check Engine logs
docker logs exness-engine

# Verify Redis connection
docker exec exness-redis redis-cli ping

# Check Redis streams
docker exec exness-redis redis-cli XINFO STREAM engine-stream

Next Steps

Explore the Architecture

Understand how the microservices communicate

API Reference

Learn about available API endpoints

Service Documentation

Deep dive into each microservice

Deployment Guide

Deploy to production environments

Build docs developers (and LLMs) love