Prerequisites
Before you begin, ensure you have:- Node.js 18+ and npm
- Yarn (recommended for the frontend) or npm
- MongoDB running locally or a remote connection string
- Zerodha Kite Connect API key and secret (for live trading)
- Two terminal windows — one for backend, one for frontend
Local development
1
Start MongoDB
Ensure MongoDB is running and note your connection string. You will set this as
MONGO_URI in the backend .env file.2
Install and run the backend
From the The API starts on port 5000 by default (
nifty_fifty_bank_nifty_NodeJS folder:PORT env). Nodemon watches for file changes during development.3
Install and run the frontend
In a separate terminal, from the Vite serves the React dashboard. Open the URL shown in the terminal (typically
nifty_fifty_bank_nifty_ReactJS folder:http://localhost:5173).4
Configure environment variables
Backend (
.env in nifty_fifty_bank_nifty_NodeJS):Frontend (
.env in nifty_fifty_bank_nifty_ReactJS):5
Log in to the dashboard
Open the frontend URL in your browser and sign in with an admin account.
- If no admin exists yet, use the create-admin script to seed one.
- MFA is supported if enabled on the user account.
- On success, the JWT is stored in the frontend and attached to all API requests.
6
Connect Zerodha
After logging in as admin, click Login to Zerodha in the dashboard header.This opens
${VITE_APP_BASEURL}zerodha/login in a new tab and completes the Kite OAuth flow. On success, the access token is saved in MongoDB and the backend starts the Kite WebSocket for live ticks.In production, a daily 6 AM IST cron job refreshes the Zerodha token automatically. See Zerodha daily refresh for details.
7
Configure index settings
Navigate to Settings (
/settings) as admin:- Add or edit an index configuration (symbol, segment, recurring buy flags, trailing sell parameters).
- Save the settings — they are stored in MongoDB as
IndexSettingdocuments. - Return to the Dashboard (
/dashboard) and select the index tab. - Start recurring buy for the desired segment (cash, futures, or options).
Verify everything works
Next steps
- Roles and access — understand admin vs user permissions
- Backend overview — API routes, models, and scheduled jobs
- Production deployment — deploy with PM2 on Ubuntu