Skip to content

kudipudibhargav/TradeLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TradeLab 📈

Next.js Spring Boot Tailwind CSS H2 Database License: MIT

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.


📸 Platform Overview

TradeLab Terminal Banner


⚡ Core Features

  • 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.

🛠️ Technology Stack

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

🚀 Local Installation

Prerequisites

  • Java 17 or higher
  • Node.js 18.x or higher
  • npm or yarn

Step 1: Clone the Repository

git clone https://github.com/kudipudibhargav/TradeLab.git
cd TradeLab

Step 2: Start the Spring Boot Backend

  1. Navigate to the backend directory:
    cd backend
  2. Build and run the server using the Maven wrapper:
    ./mvnw spring-boot:run
    The server will boot up and listen on http://localhost:8080. An in-memory H2 database is initialized and seeded with a default demo account (demo@tradelab.com / password) on startup.

Step 3: Start the Next.js Frontend

  1. Open a new terminal window and navigate to the frontend directory:
    cd frontend
  2. Install dependencies:
    npm install
  3. Launch the Next.js development server:
    npm run dev
    The frontend will boot up and bind to http://localhost:3000.

Step 4: Access the Terminal

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!

🔒 Security Mappings

  • 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.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Enterprise-grade real-time paper trading platform with live market simulation, portfolio analytics, watchlists, virtual trading, and performance tracking.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages