Trade Desk is a modern AI-enhanced trading terminal designed for traders, analysts, and fintech enthusiasts.
It combines:
- π Advanced financial charting
- π€ AI-assisted trading insights
- β‘ Real-time market simulation
- πΌ Portfolio & order management
- π WebSocket-powered live updates
- π§ Persistent intelligent workspaces
The platform delivers a sleek institutional-grade experience inspired by modern trading terminals.
- Interactive market charts
- Technical indicators
- Responsive trading workspace
- Real-time updates
- Gemini AI integration
- OpenRouter AI support
- Context-aware market conversations
- Persistent chat history
- Create and manage portfolios
- Simulated trading system
- Pending orders
- Market order execution
- Watchlists
- Alerts system
- Trading panels
- Simulated market news
- WebSocket communication
- Live workspace synchronization
- Persistent chart settings
- Modern fintech-inspired interface
- Responsive layouts
- Lazy-loaded modules
- Smooth animations
flowchart TD
A[π€ Trader/User] --> B[βοΈ React + Vite Client]
B --> C[π Trading Dashboard]
B --> D[π€ AI Assistant]
B --> E[π Market Watchlists]
B --> F[πΌ Portfolio Manager]
C --> G[π‘ WebSocket Layer]
D --> H[π§ Gemini/OpenRouter APIs]
G --> I[π₯οΈ Node.js + Express Server]
I --> J[π Authentication Engine]
I --> K[π Trading APIs]
I --> L[π¦ Portfolio Services]
K --> M[(Prisma ORM)]
L --> M
M --> N[(SQLite / PostgreSQL)]
B --> O[(Zustand Persistent Stores)]
O --> P[Chart Preferences]
O --> Q[AI Chat History]
O --> R[Workspace State]
sequenceDiagram
participant User
participant Client
participant Server
participant Database
participant AI
User->>Client: Login / Trading Action
Client->>Server: API Request
Server->>Database: Fetch / Update Data
Database-->>Server: Response
Server-->>Client: Market / Portfolio Data
User->>Client: Ask AI Assistant
Client->>AI: AI Request
AI-->>Client: Trading Insight
Server-->>Client: WebSocket Updates
| Technology | Purpose |
|---|---|
| React 19 | Frontend UI |
| TypeScript | Type Safety |
| Vite | Build Tool |
| Node.js | Backend Runtime |
| Express.js | API Layer |
| Prisma ORM | Database ORM |
| SQLite / PostgreSQL | Database |
| Zustand | State Management |
| WebSockets | Real-Time Updates |
| Gemini AI | AI Assistant |
| Tailwind / CSS | Styling |
TerminalAlpha/
β
βββ client/
β βββ public/
β β
β βββ src/
β β βββ components/
β β βββ pages/
β β βββ layouts/
β β βββ hooks/
β β βββ services/
β β βββ stores/
β β βββ utils/
β β βββ routes/
β β βββ styles/
β β
β βββ package.json
β βββ vite.config.ts
β
βββ server/
β βββ prisma/
β βββ src/
β β βββ routes/
β β βββ controllers/
β β βββ middleware/
β β βββ services/
β β βββ websocket/
β β βββ utils/
β β
β βββ package.json
β βββ tsconfig.json
β
βββ README.md
βββ package.jsonflowchart TB
subgraph USER_LAYER["π€ User Layer"]
U1[π» Desktop Browser]
U2[π± Mobile Browser]
U3[π Trading Workspace]
end
subgraph FRONTEND["βοΈ Frontend Layer (Vercel / Netlify)"]
F1[React + Vite Client]
F2[Trading Dashboard]
F3[AI Assistant UI]
F4[Chart Engine]
F5[Zustand Persistent Stores]
end
subgraph REALTIME["β‘ Real-Time Communication"]
W1[WebSocket Gateway]
end
subgraph BACKEND["π₯οΈ Backend Layer (Railway / Render)"]
B1[Node.js + Express API]
B2[Authentication Service]
B3[Trading Engine]
B4[Portfolio Manager]
B5[Market Simulation Service]
B6[Alert & Watchlist Service]
end
subgraph DATABASE["ποΈ Database Layer"]
D1[(PostgreSQL)]
D2[(Redis Cache - Optional)]
end
subgraph AI["π€ AI Layer"]
A1[Gemini API]
A2[OpenRouter Models]
end
subgraph STORAGE["βοΈ Persistence & State"]
S1[LocalStorage]
S2[Session Persistence]
end
subgraph DEVOPS["π DevOps & Monitoring"]
M1[GitHub Actions]
M2[Health Checks]
M3[Logging & Monitoring]
end
%% USER FLOW
U1 --> F1
U2 --> F1
U3 --> F2
%% FRONTEND
F1 --> F2
F1 --> F3
F1 --> F4
F1 --> F5
%% API COMMUNICATION
F1 -->|HTTPS REST API| B1
F1 -->|WebSocket| W1
%% REALTIME
W1 --> B1
%% BACKEND SERVICES
B1 --> B2
B1 --> B3
B1 --> B4
B1 --> B5
B1 --> B6
%% DATABASE
B2 --> D1
B3 --> D1
B4 --> D1
B5 --> D1
B6 --> D1
%% REDIS CACHE
B1 --> D2
%% AI
F3 --> A1
F3 --> A2
%% STORAGE
F5 --> S1
F5 --> S2
%% DEVOPS
M1 --> FRONTEND
M1 --> BACKEND
M2 --> B1
M3 --> B1
sequenceDiagram
participant User
participant Frontend
participant API
participant WebSocket
participant Database
participant AI
User->>Frontend: Open Trading Terminal
Frontend->>API: Authenticate User
API->>Database: Validate Credentials
Database-->>API: User Data
API-->>Frontend: JWT Token
Frontend->>API: Request Portfolio
API->>Database: Fetch Portfolio
Database-->>API: Portfolio Data
API-->>Frontend: Portfolio Response
Frontend->>WebSocket: Connect Real-Time Channel
WebSocket-->>Frontend: Market Updates
User->>Frontend: Execute Trade
Frontend->>API: Submit Order
API->>Database: Save Order
API-->>Frontend: Order Confirmation
User->>Frontend: Ask AI Assistant
Frontend->>AI: AI Trading Request
AI-->>Frontend: Trading Insight
| Layer | Recommended Platform |
|---|---|
| Frontend | Vercel / Netlify |
| Backend API | Railway / Render |
| Database | Neon PostgreSQL / Supabase |
| WebSockets | Railway Persistent Services |
| AI Providers | Gemini |
| CI/CD | GitHub Actions |
| Monitoring | UptimeRobot + Railway Metrics |
flowchart LR
A[π€ User Login] --> B[π JWT Authentication]
B --> C[π‘οΈ Protected API Routes]
C --> D[π¦ Express Middleware]
D --> E[(PostgreSQL)]
C --> F[β‘ Rate Limiting]
C --> G[π CORS Protection]
C --> H[π Environment Variables]
flowchart LR
A[π¨βπ» Developer Push] --> B[GitHub Repository]
B --> C[GitHub Actions]
C --> D[Run Tests]
C --> E[Build Client]
C --> F[Build Server]
E --> G[Vercel Deployment]
F --> H[Railway Deployment]
G --> I[π Live Frontend]
H --> J[π₯οΈ Live API]
VITE_API_URL="https://your-api.example.com/api"
VITE_WS_URL="wss://your-api.example.com"
VITE_GEMINI_API_KEY="your-gemini-api-key-here"DATABASE_URL="file:./dev.db"
JWT_SECRET="use-a-long-random-production-secret"
JWT_EXPIRES_IN="7d"
PORT=3001
NODE_ENV="production"
CORS_ORIGIN="https://your-client.example.com"server/
β
βββ prisma/
β βββ schema.prisma
β
βββ src/
β
βββ .env
β
βββ package.json
β
βββ dev.dbInside the server folder create:
.envAdd:
DATABASE_URL="file:./dev.db"
JWT_SECRET="supersecretkey123"npx prisma generatenpx prisma db pushnpm installnpm run devπ Paper Trading Server is running on port 3001
π CORS Origin allowed: http://localhost:5173npx prisma generate
npx prisma db push
npm install
npm run devInstall bcrypt packages:
npm install bcryptjs
npm install -D @types/bcryptjsInside client/.env:
VITE_API_URL="http://localhost:3001/api"Open:
http://localhost:3001If you see:
Cannot GET /the backend is running correctly.
git clone https://github.com/LoganthP/TradeDesk.gitcd client
npm installcd ../server
npm installcd client
npm run devcd server
npm run devcd client
npm run buildcd server
npm run build
npm run start- Gemini API
- Trading conversations
- Market explanations
- Strategy discussions
- Persistent AI history
- β‘ Route-level lazy loading
- β‘ Vite manual chunk splitting
- β‘ Zustand persistence
- β‘ Optimized production builds
- β‘ WebSocket live updates
- TypeScript strict mode enabled
- Production builds passing
- Secure environment handling
- Persistent state architecture
- Lazy-loaded routing
- Optimized bundle splitting
- Replace simulated data with real providers
- Improve ESLint compliance
- Add provider-specific deployment configs
- Institutional-grade QA testing
cd client
npm run build
cd ../server
npm run build- Authentication flow
- Dashboard rendering
- Trading operations
- Portfolio reset
- AI assistant responses
- Responsive layouts
- WebSocket updates
- π‘ Real market data integration
- π¦ Brokerage connectivity
- π Institutional analytics
- π€ Advanced AI trading agents
- βοΈ Cloud workspace sync
- π± Mobile application
- π Real push notifications
Contributions are welcome!
Fork β Clone β Create Branch β Commit β Push β Pull RequestThis project is licensed under the MIT License.