Local Setup
Local Setup
Section titled “Local Setup”This guide will help you set up a local development environment for TradeX.
Prerequisites
Section titled “Prerequisites”- 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)
Quick Start
Section titled “Quick Start”1. Clone the Repository
Section titled “1. Clone the Repository”git clone https://github.com/your-org/tradex.gitcd tradex2. Install Dependencies
Section titled “2. Install Dependencies”bun install3. Start Infrastructure
Section titled “3. Start Infrastructure”docker-compose -f infra/docker-compose.dev.yml up -dThis starts:
- MongoDB
- PostgreSQL
- Redis
- Kafka
- Zookeeper
4. Configure Environment Variables
Section titled “4. Configure Environment Variables”Copy example environment files:
cp apps/marketdata-service/.env.example apps/marketdata-service/.envcp apps/order-service/.env.example apps/order-service/.env# ... repeat for other services5. Run Services
Section titled “5. Run Services”Start services in development mode:
# From root directorybun run dev
# Or individuallycd apps/marketdata-service && bun run devcd apps/order-service && bun run devService URLs
Section titled “Service URLs”Once running, services are available at:
- Market Data Service: http://localhost:3002
- Order Service: http://localhost:3003
- Auth Service: http://localhost:3004
- User Service: http://localhost:3005
- Wallet Service: http://localhost:3006
- Metadata Service: http://localhost:3007
- Frontend: http://localhost:3000
- Docs Service: http://localhost:4321
Database Setup
Section titled “Database Setup”MongoDB
Section titled “MongoDB”# Connect to MongoDBmongosh mongodb://localhost:27017
# Create databaseuse tradexPostgreSQL
Section titled “PostgreSQL”# Connect to PostgreSQLpsql -h localhost -U postgres
# Create databaseCREATE DATABASE tradex;Next Steps
Section titled “Next Steps”- Read the Production Deployment guide
- Explore the Architecture
- Check out the API Documentation