Skip to content

Local Setup

This guide will help you set up a local development environment for TradeX.

  • Bun >= 1.3
  • Node.js >= 18
  • Docker and Docker Compose (for infrastructure)
  • MongoDB (or use Docker)
  • PostgreSQL (or use Docker)
  • Redis (or use Docker)
  • Kafka (or use Docker)
Terminal window
git clone https://github.com/your-org/tradex.git
cd tradex
Terminal window
bun install
Terminal window
docker-compose -f infra/docker-compose.dev.yml up -d

This starts:

  • MongoDB
  • PostgreSQL
  • Redis
  • Kafka
  • Zookeeper

Copy example environment files:

Terminal window
cp apps/marketdata-service/.env.example apps/marketdata-service/.env
cp apps/order-service/.env.example apps/order-service/.env
# ... repeat for other services

Start services in development mode:

Terminal window
# From root directory
bun run dev
# Or individually
cd apps/marketdata-service && bun run dev
cd apps/order-service && bun run dev

Once running, services are available at:

Terminal window
# Connect to MongoDB
mongosh mongodb://localhost:27017
# Create database
use tradex
Terminal window
# Connect to PostgreSQL
psql -h localhost -U postgres
# Create database
CREATE DATABASE tradex;