Skip to content

keshavagr025/Zerodha

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zerodha Clone

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.

Features

  • 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

Tech Stack

Backend

  • Node.js with Express.js
  • MongoDB with Mongoose ODM
  • JWT for authentication
  • bcrypt for password hashing
  • Yahoo Finance API for stock data

Frontend (Landing Page)

  • React with React Router
  • Font Awesome for icons
  • Axios for API calls

Dashboard

  • React with React Router
  • Material-UI for components
  • Chart.js for data visualization
  • Axios for API calls

Installation and Setup

Prerequisites

  • Node.js (v14 or higher)
  • MongoDB (local or cloud instance)
  • Git

Clone the Repository

git clone https://github.com/yourusername/zerodha-clone.git
cd zerodha-clone

Backend Setup

  1. Navigate to the backend directory:

    cd backend
  2. Install dependencies:

    npm install
  3. Create a .env file in the backend directory with the following variables:

    MONGO_URI=mongodb://localhost:27017/zerodha-clone
    JWT_SECRET=your_jwt_secret_key
    PORT=5000
    
  4. Start the backend server:

    npm start

    The server will run on http://localhost:5000

Frontend (Landing Page) Setup

  1. Navigate to the frontend directory:

    cd ../frontend
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm start

    The app will run on http://localhost:3000

Dashboard Setup

  1. Navigate to the dashboard directory:

    cd ../dashboard
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm start

    The dashboard will run on http://localhost:3001

Usage

  1. Landing Page: Visit http://localhost:3000 to explore the website, learn about products, and sign up for an account.

  2. Authentication: Use the signup/login functionality to create an account and authenticate.

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

API Endpoints

Authentication

  • POST /api/auth/signup - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/logout - User logout

Holdings

  • GET /api/holdings - Get user holdings
  • POST /api/holdings - Add new holding

Orders

  • GET /api/orders - Get user orders
  • POST /api/orders - Place new order

Positions

  • GET /api/positions - Get user positions

Project Structure

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

Contributing

Contributions are welcome! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

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

Disclaimer

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.