How adilonam/itrade works
Trade Nova is a multi-tenant trading and investment platform with role-based navigation and shared authentication. Users enter through the dashboard, choose a trading room or investment workflow, and use API routes to retrieve or change account, market, and position data; scheduled jobs also refresh and close positions. The README documents stock, trading, investment, administration, and super-admin configuration capabilities. The tree also shows a distinct Polymarket-style prediction-market product. Several subsystem links use README documentation or indexed module references; unsampled route internals are not assumed.
Main entry points: dashboard-layout-client.tsx Role-based dashboard · positions/route.ts Position workflows · prisma.ts PostgreSQL database · close-positions/route.ts Position scheduling
Components 21
App shell and identity
- Role-based dashboard
src/components/layout/dashboard-layout-client.tsx - Tenant navigation
src/constants/data.ts - Shared authentication
src/lib/auth.ts
Trading and market data
- Trading rooms
src/components/trading-room/trading-room-shell.tsx - Market endpoints
src/app/api/markets/route.ts - Live price context
src/contexts/markets-websocket-context.tsx - WebSocket manager
src/lib/twelve-data-websocket-manager.ts - Market data service
src/lib/twelvedata.ts - Position workflows
src/app/api/user/positions/route.ts - Position scheduling
src/app/api/schedule/close-positions/route.ts - Trading calculations
src/lib/calculator-server.ts
Invest and account
- Investment experience
src/components/investments/investment-details.tsx - Investment endpoints
src/app/api/investments/route.ts - Balance management
src/lib/balance.ts - PostgreSQL database
src/lib/prisma.ts
Administration
- Admin operations
src/app/api/admin - Platform configuration
src/app/api/super-admin
Prediction markets
- Prediction market app
src/components/polymarket/markets/markets-page.tsx - Prediction market APIs
src/app/api/polymarket
Other components
- Platform user
- Twelve Data service
Connections 25
- Platform user → Role-based dashboard: opens
- Role-based dashboard → Tenant navigation: selects routes
- Role-based dashboard → Shared authentication: uses shared auth
- Role-based dashboard → Trading rooms: renders
src/components/layout/dashboard-layout-client.tsx - Trading rooms → Market endpoints: requests markets
- Role-based dashboard → Live price context: provides live prices
src/components/layout/dashboard-layout-client.tsx - Live price context → WebSocket manager: connects and subscribes
src/contexts/markets-websocket-context.tsx - WebSocket manager → Twelve Data service: opens WebSocket
src/lib/twelve-data-websocket-manager.ts - Market endpoints → Market data service: loads quotes
src/app/api/markets/route.ts - Market data service → Twelve Data service: fetches market data
src/lib/twelvedata.ts - Platform user → Position workflows: places trades
- Position workflows → Shared authentication: checks session
src/app/api/user/positions/route.ts - Position workflows → Trading calculations: validates and values
src/app/api/user/positions/route.ts - Position workflows → Balance management: resolves funding
src/app/api/user/positions/route.ts - Position workflows → PostgreSQL database: reads and writes
src/app/api/user/positions/route.ts - Position scheduling → Trading calculations: calculates position PnL
src/app/api/schedule/close-positions/route.ts - Position scheduling → PostgreSQL database: loads and closes positions
src/app/api/schedule/close-positions/route.ts - Platform user → Investment experience: browses investments
- Investment experience → Investment endpoints: loads investment data
- Investment endpoints → PostgreSQL database: persists investments
- Platform user → Admin operations: administers platform
- Admin operations → PostgreSQL database: manages records
src/app/api/admin/positions/route.ts - Platform configuration → PostgreSQL database: configures settings
- Platform user → Prediction market app: browses markets
- Prediction market app → Prediction market APIs: uses market APIs