How jeetgajeraa/cryptolab works
Crypt-Lab is a crypto-trading application with a browser UI, an Express backend, and a Python bot-strategy runner. Users sign up or log in, view live market prices, manage orders and positions, and configure trading bots. The backend also tracks fills and trades and supports wallet, profile, and performance views. The source index and excerpts show key backend and frontend connections; several runtime services and UI pages are listed but unsampled, so their internal links are omitted where not established.
Main entry points: App.tsx Route application · app.ts HTTP application · order.controller.ts Order controller · positionService.ts Position service
Components 22
Web application
- Route application
frontend/src/App.tsx - Account pages
frontend/src/pages/LoginPage.tsx - Market pages
frontend/src/pages/ChartPage.tsx - Account views
frontend/src/pages/ProfilePage.tsx - Bot controls
frontend/src/pages/BotPage.tsx - HTTP client
frontend/src/api/axios.tsx - Socket prices
frontend/src/hooks/useSocketPrices.ts
Backend API
- HTTP application
backend/src/app.ts - Account controller
backend/src/controllers/user.controller.ts - Order controller
backend/src/controllers/order.controller.ts - Bot controller
backend/src/controllers/bot.controller.ts - Trade controller
backend/src/controllers/trade.controller.ts
Trading runtime
- Position service
backend/src/services/positionService.ts - Order simulator
backend/src/services/orderSimulator.ts - Fill processor
backend/src/services/fillProcessor.ts - Exchange stream
backend/src/services/binanceWebSocket.ts - Redis cache
backend/src/services/redisClient.ts - Trading records
backend/src/models
Bot strategies
- Bot runner
py_services/bot_runner.py - Strategy implementations
py_services/strategies
Other components
- Trader
- Market feed
Connections 20
- Trader → Route application: uses
- Route application → Account pages: routes to
frontend/src/App.tsx - Route application → Market pages: routes to
frontend/src/App.tsx - Route application → Account views: routes to
frontend/src/App.tsx - Route application → Bot controls: routes to
frontend/src/App.tsx - Route application → HTTP client: checks profile
frontend/src/App.tsx - Market pages → Socket prices: uses prices
frontend/src/pages/ChartPage.tsx - Socket prices → Market feed: subscribes
frontend/src/hooks/useSocketPrices.ts - HTTP application → Account controller: routes requests
backend/src/app.ts - HTTP application → Order controller: routes requests
backend/src/app.ts - HTTP application → Bot controller: routes requests
backend/src/app.ts - Order controller → Position service: checks balance
backend/src/controllers/order.controller.ts - Order controller → Trading records: reads and writes
backend/src/controllers/order.controller.ts - Position service → Trading records: updates fills
backend/src/services/positionService.ts - Position service → Redis cache: reads prices
backend/src/services/positionService.ts - Trade controller → Trading records: reads trade data
backend/src/controllers/trade.controller.ts - Exchange stream → Redis cache: caches prices
- Order simulator → Fill processor: processes orders
- Bot runner → Strategy implementations: loads strategies
py_services/bot_runner.py - Bot controller → Bot runner: dispatches bots