A production-ready, Binance-like centralized cryptocurrency exchange built with modern microservices architecture.
- ✅ Spot Trading - LIMIT and MARKET orders
- ✅ Price-Time Priority Matching - Fair order execution
- ✅ Real-time Orderbook - WebSocket live updates
- ✅ Multiple Trading Pairs - BTC/USDT, ETH/USDT, BNB/USDT
- ✅ Maker/Taker Fees - Configurable fee structure
- ✅ JWT Authentication - Secure login with refresh tokens
- ✅ KYC System - User verification workflow
- ✅ Role-Based Access - USER and ADMIN roles
- ✅ Referral System - User referral tracking
- ✅ Multi-Asset Wallets - BTC, ETH, USDT, BNB, USDC
- ✅ Deposit/Withdrawal - Blockchain transaction tracking
- ✅ Dual-Entry Ledger - Available and locked balances
- ✅ Complete Audit Trail - All balance changes logged
- ✅ OHLCV Candles - 1m, 5m, 15m, 1h, 4h, 1d intervals
- ✅ Trade History - Complete trade records
- ✅ 24h Ticker - Volume, high, low, change statistics
- ✅ Market Management - Create/edit trading pairs
- ✅ User Management - Freeze/unfreeze accounts
- ✅ Withdrawal Approval - Manual withdrawal review
- ✅ Revenue Tracking - Fee collection analytics
- ✅ Audit Logs - All admin actions logged
┌─────────────────┐
│ Web Frontend │ :3000
│ Admin Frontend │ :3001
└────────┬────────┘
│
┌────▼─────┐
│ API │ :4000
│ Gateway │
└────┬─────┘
│
┌────┴──────────────────────────────────┐
│ │
┌───▼────┐ ┌────────┐ ┌─────────┐ ┌─────▼────┐
│ Auth │ │Balance │ │Matching │ │Market │
│Service │ │Service │ │Engine │ │Data │
│:4001 │ │:4002 │ │:4003 │ │:4004 │
└────────┘ └────────┘ └─────────┘ └──────────┘
┌────────┐ ┌────────┐
│Wallet │ │Admin │
│Service │ │Service │
│:4005 │ │:4006 │
└────────┘ └────────┘
┌────────────┐ ┌───────┐
│ PostgreSQL │ │ Redis │
│ :5432 │ │ :6379 │
└────────────┘ └───────┘
Backend:
- Node.js + TypeScript
- Express.js
- PostgreSQL 15
- Redis 7
- WebSocket (Socket.io)
Frontend:
- React 18
- Next.js
- Tailwind CSS
- TradingView Charts
DevOps:
- Docker & Docker Compose
- GitHub Actions (CI/CD ready)
- Docker & Docker Compose
- Node.js 18+ (for local development)
- Git
# Clone the repository
git clone https://github.com/anurag698/bitprox-exchange.git
cd bitprox-exchange
# Start all services with Docker
docker-compose up -d
# Check service status
docker-compose ps- Trading UI: http://localhost:3000
- Admin Dashboard: http://localhost:3001
- API Gateway: http://localhost:4000
- PostgreSQL: localhost:5432
- Redis: localhost:6379
Admin Account:
- Email:
admin@bitprox.exchange - Password:
Admin@123
bitprox-exchange/
├── apps/
│ ├── api-gateway/ # Routes all traffic
│ ├── auth-service/ # Authentication & JWT
│ ├── balance-service/ # Balance management
│ ├── matching-engine/ # Order matching logic
│ ├── market-data-service/ # Candles & tickers
│ ├── wallet-service/ # Deposits & withdrawals
│ ├── admin-service/ # Admin operations
│ ├── web-frontend/ # User trading UI
│ └── admin-frontend/ # Admin dashboard
├── packages/
│ ├── common/ # Shared types & utilities
│ └── config/ # Environment configs
├── database/
│ └── init.sql # Database schema
├── docker-compose.yml # Service orchestration
└── README.md
# Install dependencies for all services
npm install
# Start PostgreSQL and Redis
docker-compose up postgres redis -d
# Run auth service
cd apps/auth-service
npm run dev
# Run other services in separate terminals...Create .env files in each service directory. See .env.example for templates.
NODE_ENV=development
PORT=4001
DATABASE_URL=postgresql://bitprox:password@localhost:5432/bitprox_exchange
REDIS_URL=redis://localhost:6379
JWT_SECRET=your-secret-key
JWT_REFRESH_SECRET=your-refresh-secretThe database includes:
- Users & Sessions - Authentication and session management
- Assets & Markets - Tradable assets and trading pairs
- Balances & Ledger - User balances with complete audit trail
- Orders & Trades - Order management and trade execution
- Deposits & Withdrawals - Wallet operations
- Candles - OHLCV data for charts
- Revenue & Audit Logs - Admin tracking
See database/init.sql for the complete schema.
- ✅ Password Hashing - bcrypt with salt rounds
- ✅ JWT Authentication - Access + refresh token pattern
- ✅ Role-Based Access Control - USER/ADMIN permissions
- ✅ Session Management - Track and revoke sessions
- ✅ Audit Logging - All admin actions logged
- ✅ Input Validation - Zod schema validation
- ✅ SQL Injection Protection - Parameterized queries
POST /api/auth/signup
POST /api/auth/login
POST /api/auth/refresh
GET /api/auth/meGET /api/markets
GET /api/markets/:symbol/orderbook
POST /api/orders
GET /api/orders/open
GET /api/orders/history
DELETE /api/orders/:idGET /api/balances
POST /api/wallet/deposit
POST /api/wallet/withdraw
GET /api/wallet/historyGET /api/markets/:symbol/candles
GET /api/markets/:symbol/trades
GET /api/markets/:symbol/ticker# Run unit tests
npm test
# Run integration tests
npm run test:integration
# Test coverage
npm run test:coverage- Change all default passwords
- Update JWT secrets
- Configure environment variables
- Set up SSL/TLS certificates
- Configure firewall rules
- Enable production logging
- Set up monitoring (Prometheus/Grafana)
- Configure backup strategy
- Review security settings
# Build production images
docker-compose -f docker-compose.prod.yml build
# Start in production mode
docker-compose -f docker-compose.prod.yml up -dContributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by Binance, OKX, and other leading crypto exchanges
- Built with modern best practices for scalability and security
- Community feedback and contributions
For questions and support:
- GitHub Issues: Report a bug
- Email: admin@bitprox.exchange
Built with ❤️ by the BitProX Team