TradeLab is an enterprise-grade, real-time paper trading and strategy terminal. It provides an intuitive, high-performance workspace designed to simulate multi-asset trading (Indian Indices, Forex, and Crypto) with zero capital risk.
- WebSocket Live Market Feeds: Ticking at 250ms intervals, providing real-time pricing across NIFTY 50, BANK NIFTY, SENSEX, USD/INR, Bitcoin, Solana, and Ethereum.
- Interactive HTML5 Canvas Charting: Premium charting canvas supporting technical indicators (EMA, SMA, Bollinger Bands, RSI) and vector drawings (Trendlines, Rectangles, Circles).
- Order Matching Engine: Asynchronous order manager supporting Market, Limit, and Stop Loss paper orders evaluated against price crossovers on every WebSocket tick.
- Performance Metrics & Analytics: Visual SVG drawdown history curves, asset exposure mix donut charts, win rates, profit factors, Sharpe, and Sortino ratios.
- Algorithmic Backtesting: Backend simulations executing EMA Crossover and RSI Mean Reversion backtests over historical candles in under 200ms.
- Step-by-Step Replay Mode: Replay controls (Play, Pause, Speed, Step) linked to the charting canvas to review historical market price action.
- Seamless Sandbox Logins: Pre-seeded demo sandbox login and Google OAuth2 sandbox validation to start paper trading instantly with one click.
| Layer | Technologies |
|---|---|
| Frontend | React, Next.js (Turbopack), Tailwind CSS, Lucide icons, Zustand (State Management) |
| Backend | Java 17+, Spring Boot, Spring Security (JWT), Spring Data JPA, WebSockets |
| Database & Cache | H2 Database (In-Memory), Redis Cache (In-Memory Fallback) |
| Build Tools | Maven wrapper (mvnw), npm |
- Java 17 or higher
- Node.js 18.x or higher
- npm or yarn
git clone https://github.com/kudipudibhargav/TradeLab.git
cd TradeLab- Navigate to the backend directory:
cd backend - Build and run the server using the Maven wrapper:
The server will boot up and listen on
./mvnw spring-boot:run
http://localhost:8080. An in-memory H2 database is initialized and seeded with a default demo account (demo@tradelab.com/password) on startup.
- Open a new terminal window and navigate to the frontend directory:
cd frontend - Install dependencies:
npm install
- Launch the Next.js development server:
The frontend will boot up and bind to
npm run dev
http://localhost:3000.
Open your web browser and navigate to: 👉 http://localhost:3000
- Click Sign In and choose 🚀 Instant Login (Demo Account) or Google Auth to instantly log into a seeded account with a ₹100,000 paper trading balance!
- JWT Access Tokens are stored in browser local storage and injected in Axios headers.
- Refresh tokens are stored in secure HttpOnly cookies.
- WebSocket handshake routes (
/ws/**) and public chart queries (/api/charts/**) bypass filters to support public visitor rendering.
This project is licensed under the MIT License - see the LICENSE file for details.
