How tetratensor/mt4-mt5-trade-copier-backend works
This is a Node.js backend for managing MetaTrader copy-trading accounts, subscriptions, and platform administration. The principal workflow is authenticated account and cluster setup, followed by MT4/MT5 master-trade polling and copier execution, with dashboard analytics and real-time updates. Payments and affiliate management form a separate subscription lifecycle. The trading coordinator is present, but its startup call is commented out in server.js; the payment scheduler call is also commented out. The README documents additional risk and notification capabilities beyond the sampled implementation excerpts.
Main entry points: index.master.trading.js Trading coordinator · db.js Platform data · cryptomus.controller.js Subscriptions and payouts · user.controller.js Identity and settings
Components 24
Accounts and dashboard
- User routes
routers/user.router.js - Dashboard routes
routers/dashboard.router.js - Admin routes
routers/admin.router.js - Identity and settings
controllers/user.controller.js - Clusters and analytics
controllers/dashboard.controller.js - Admin and affiliates
controllers/admin.controller.js
Copy trading
- Trading coordinator
trading/masters/index.master.trading.js - Token refresh
trading/tokens/index.token.update.js - MT4 master logic
trading/masters/metatrader4.master.trading.js - MT5 master logic
trading/masters/metatrader5.master.trading.js - MT4 copier tracking
trading/copiers/metatrader4.copier.trading.js - MT5 copier tracking
trading/copiers/metatrader5.copier.trading.js
Payments and affiliates
- Payment routes
routers/cryptomus.router.js - Subscriptions and payouts
controllers/cryptomus.controller.js - Subscription checker
payment/payment.check.js
Runtime integrations
- HTTP server
server.js - Platform data
config/db/db.js - Realtime events
socket/socket.js
Other components
- Platform user
- Administrator
- MT4 bridge
- MT5 bridge
- Cryptomus gateway
- EmailJS
Connections 25
- Platform user → User routes: sends requests
- Platform user → Dashboard routes: manages accounts
- Administrator → Admin routes: manages platform
- User routes → Identity and settings: dispatches
- Dashboard routes → Clusters and analytics: dispatches
- Admin routes → Admin and affiliates: dispatches
- Identity and settings → Platform data: reads and writes
- Clusters and analytics → Platform data: reads and writes
- Admin and affiliates → Platform data: reads and writes
- Identity and settings → EmailJS: sends email
- HTTP server → Realtime events: initializes
- Trading coordinator → Token refresh: refreshes tokens
- Trading coordinator → MT4 master logic: schedules trading
- Trading coordinator → MT5 master logic: schedules trading
- Trading coordinator → MT4 copier tracking: schedules tracking
- Trading coordinator → MT5 copier tracking: schedules tracking
- MT4 master logic → MT4 bridge: uses bridge
- MT5 master logic → MT5 bridge: uses bridge
- Token refresh → MT4 bridge: refreshes access
- Token refresh → MT5 bridge: refreshes access
- Payment routes → Subscriptions and payouts: dispatches
- Subscriptions and payouts → Platform data: reads and writes
- Subscriptions and payouts → Cryptomus gateway: requests payments
- Cryptomus gateway → Subscriptions and payouts: sends webhooks
- Subscription checker → Platform data: checks subscriptions