The Pankaj Bhatia trading system is a web-based automated trading platform for Indian indices (Nifty, Bank Nifty, and related instruments). It connects to Zerodha Kite Connect for order placement and live market data, and provides a browser dashboard for admins and scoped users to configure strategies, monitor positions, and place orders. Admins configure indices, run recurring buy strategies, schedule trailing sells (options), place manual orders, and monitor live positions — all from a single dashboard.

Purpose

Repository layout

The workspace contains two separate git repositories side by side:
Each folder (NodeJS and ReactJS) is its own git repository with a separate remote.

Architecture

Plain-language flow:
  1. User logs in → JWT stored in frontend → all API calls include Authorization: Bearer ….
  2. Admin connects Zerodha (manual login or 6 AM auto-login) → access token saved in MongoDB.
  3. Backend starts Kite WebSocket → live ticks flow in → Socket.io pushes updates to connected browsers.
  4. Recurring buy / scheduled sell loops run during market hours based on index settings.
  5. All live orders go through handlePlaceOrder in zerodha.controller.ts.

Tech stack

Backend (nifty_fifty_bank_nifty_NodeJS)

Frontend (nifty_fifty_bank_nifty_ReactJS)

Explore the documentation

Quickstart

Set up MongoDB, run the backend and frontend locally, connect Zerodha, and configure your first index.

Dashboard Overview

Live index tabs, orders, positions, financials, and header controls for admins and users.

Backend Overview

API routes, database models, real-time events, and scheduled jobs.

Production Deployment

Deploy the platform on Ubuntu with PM2, Apache, and environment configuration.
For strategy details (recurring buy, trailing sell, settings fields), see the Trading Workflows section. For Zerodha token refresh and streaming, see Zerodha Operations.