A full-stack web application that replicates the core functionalities of Zerodha, India's leading online stock trading platform. This project includes a landing page, user authentication, trading dashboard, and backend API for managing users, holdings, orders, and positions.
- User Authentication: Secure login and signup with JWT tokens
- Trading Dashboard: Real-time portfolio management with holdings, positions, and orders
- Stock Price Fetching: Integration with Yahoo Finance API for Indian stock prices
- Responsive Design: Modern UI built with React and Material-UI
- Landing Page: Informative website with product details, pricing, and support
- Backend API: RESTful API with MongoDB for data persistence
- Node.js with Express.js
- MongoDB with Mongoose ODM
- JWT for authentication
- bcrypt for password hashing
- Yahoo Finance API for stock data
- React with React Router
- Font Awesome for icons
- Axios for API calls
- React with React Router
- Material-UI for components
- Chart.js for data visualization
- Axios for API calls
- Node.js (v14 or higher)
- MongoDB (local or cloud instance)
- Git
git clone https://github.com/yourusername/zerodha-clone.git
cd zerodha-clone-
Navigate to the backend directory:
cd backend -
Install dependencies:
npm install
-
Create a
.envfile in the backend directory with the following variables:MONGO_URI=mongodb://localhost:27017/zerodha-clone JWT_SECRET=your_jwt_secret_key PORT=5000 -
Start the backend server:
npm start
The server will run on http://localhost:5000
-
Navigate to the frontend directory:
cd ../frontend -
Install dependencies:
npm install
-
Start the development server:
npm start
The app will run on http://localhost:3000
-
Navigate to the dashboard directory:
cd ../dashboard -
Install dependencies:
npm install
-
Start the development server:
npm start
The dashboard will run on http://localhost:3001
-
Landing Page: Visit http://localhost:3000 to explore the website, learn about products, and sign up for an account.
-
Authentication: Use the signup/login functionality to create an account and authenticate.
-
Dashboard: After logging in, access the trading dashboard at http://localhost:3001 to:
- View your holdings and positions
- Place buy/sell orders
- Monitor your portfolio with charts
- Check order history
POST /api/auth/signup- User registrationPOST /api/auth/login- User loginPOST /api/auth/logout- User logout
GET /api/holdings- Get user holdingsPOST /api/holdings- Add new holding
GET /api/orders- Get user ordersPOST /api/orders- Place new order
GET /api/positions- Get user positions
zerodha-clone/
├── backend/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ ├── schemas/
│ ├── utils/
│ ├── index.js
│ └── package.json
├── frontend/
│ ├── public/
│ ├── src/
│ └── package.json
├── dashboard/
│ ├── public/
│ ├── src/
│ └── package.json
├── .gitignore
├── package.json
└── README.md
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
This is an educational project and not affiliated with Zerodha or any real financial institution. It should not be used for actual trading or financial decisions.