How abhy9393/zerodha-clone works
This repository combines a brokerage information site with a trading dashboard and an Express API. The intended user journey is to explore the public site, sign in, then view trading data and submit an order; the sampled dashboard entry reads a token from the URL or local storage. The backend implements authentication, protected holdings and positions reads, and buy/sell order updates. Dashboard-to-API wiring and most UI component behavior are not shown in the sampled source, so those links are omitted.
Main entry points: src/App.js Public site router · index.js Express API · Home.js Trading workspace · src/App.js Dashboard entry
Components 27
Public website
- Public site router
Zerodha/frontend/src/App.js - Home and company
Zerodha/frontend/src/landing_page/home/HomePage.js - Products
Zerodha/frontend/src/landing_page/products/ProductsPage.js - Pricing
Zerodha/frontend/src/landing_page/pricing/PricingPage.js - Support
Zerodha/frontend/src/landing_page/support/SupportPage.js - Signup
Zerodha/frontend/src/landing_page/signup/Signup.js - Login
Zerodha/frontend/src/landing_page/signup/Login.js - Navigation and footer
Zerodha/frontend/src/landing_page/Navbar.js
Trading dashboard
- Dashboard entry
Zerodha/dashboard/src/App.js - Trading workspace
Zerodha/dashboard/src/components/Home.js - Watchlist
Zerodha/dashboard/src/components/WatchList.js - Holdings
Zerodha/dashboard/src/components/Holdings.js - Positions
Zerodha/dashboard/src/components/Positions.js - Orders
Zerodha/dashboard/src/components/Orders.js - Funds
Zerodha/dashboard/src/components/Funds.js - Buy / sell window
Zerodha/dashboard/src/components/BuyActionWindow.js - Trade window context
Zerodha/dashboard/src/components/GeneralContext.js
API and authentication
- Express API
Zerodha/backend/index.js - Signup and login
Zerodha/backend/routes/authRoutes.js - Dashboard access
Zerodha/backend/routes/dashboardRoutes.js - JWT verification
Zerodha/backend/middleware/authMiddleware.js
Persistent data
- User records
Zerodha/backend/model/UserModel.js - Holdings records
Zerodha/backend/model/HoldingsModel.js - Positions records
Zerodha/backend/model/PositionsModel.js - Order records
Zerodha/backend/model/OrdersModel.js
Other components
- Visitor / trader
- MongoDB
Connections 29
- Visitor / trader → Public site router: browses
- Public site router → Home and company: routes
- Public site router → Products: routes
- Public site router → Pricing: routes
- Public site router → Support: routes
- Public site router → Signup: routes
- Public site router → Login: routes
- Public site router → Navigation and footer: renders
- Visitor / trader → Dashboard entry: opens
- Dashboard entry → Trading workspace: renders
- Trading workspace → Watchlist
- Trading workspace → Holdings
- Trading workspace → Positions
- Trading workspace → Orders
- Trading workspace → Funds
- Trade window context → Buy / sell window: opens
- Express API → Signup and login: mounts
- Express API → Dashboard access: mounts
- Express API → JWT verification: protects data routes
- Signup and login → User records: finds and saves
- Dashboard access → JWT verification: invokes
- Express API → Holdings records: reads and updates
- Express API → Positions records: reads
- Express API → Order records: creates orders
- Express API → MongoDB: connects
- User records → MongoDB: persists
- Holdings records → MongoDB: persists
- Positions records → MongoDB: persists
- Order records → MongoDB: persists