A full-stack stock trading and portfolio management platform inspired by Zerodha, built using the MERN stack.
The project includes a public landing website, secure authentication, and an interactive trading dashboard with portfolio analytics.
- Features
- Tech Stack
- Prerequisites
- Installation & Setup
- Configuration
- Running the Application
- Project Structure
- API Routes
- Usage Guide
- Testing
- Security Features
- Contributing
- License
- Demo
- User signup & login using JWT
- Password hashing with bcrypt
- HTTP-only cookies
- Protected routes for dashboard access
- Zerodha-inspired UI
- Responsive pages:
- Home
- Products
- Pricing
- About
- Support
- Signup / Login
- Component-based React architecture
- Portfolio overview
- Holdings, Orders, Positions
- Buy / Sell simulation
- Watchlist
- Interactive charts using Chart.js
- Context API for state management
- RESTful APIs using Express
- MongoDB schemas for users and trading data
- JWT authentication middleware
- Modular MVC structure
- Node.js (v18+ recommended)
- MongoDB (Local or Atlas)
- npm
- React (Vite)
- React Router DOM
- Axios
- Chart.js & react-chartjs-2
- CSS
- React (Vite)
- Context API
- Chart.js
- Node.js
- Express.js
- MongoDB & Mongoose
- JWT
- bcrypt
- dotenv
NewProject_1/
βββ backend/
β βββ controllers/
β βββ middlewares/
β βββ model/
β βββ routes/
β βββ schemas/
β βββ utils/
β βββ index.js
β
βββ frontend/
β βββ src/
β β βββ landing_page/
β β βββ test/
β β βββ App.jsx
β βββ vite.config.js
β
βββ dashboard/
β βββ src/
β β βββ components/
β β βββ data/
β βββ vite.config.js
β
βββ README.md
git clone https://github.com/your-username/Stock-Trading-Platform.git
cd Stock-Trading-Platform- Backend
cd backend
npm install- Frontend (Landing Website)
cd frontend
npm install- Dashboard
cd dashboard
npm installCreate a .env file inside the backend directory:
PORT=3002
MONGO_URI=your_mongodb_connection_string
TOKEN_KEY=your_jwt_secretMake sure MongoDB is running locally or use MongoDB Atlas.
Start Backend
cd backend
npm start- Start Frontend (Landing Website)
cd frontend
npm run dev- Start Dashboard
cd dashboard
npm run dev- POST /auth/signup
- POST /auth/login
- GET /holdings
- GET /orders
- GET /positions
-
User lands on the Landing Website
-
User signs up or logs in
-
JWT token is issued and stored in cookies
-
User is redirected to the Dashboard
-
Protected routes verify authentication
-
Dashboard fetches user-specific data
-
Unit testing setup using Vitest
-
React Testing Library configured
-
Sample component tests included (Hero.test.jsx)
-
Password hashing with bcrypt
-
JWT-based authentication
-
HTTP-only cookies
-
Authentication middleware
-
Protected routes
-
Input validation on backend
- Contributions are welcome!
-
Fork the repository
-
Create a feature branch
git checkout -b feature/your-feature- Commit changes
git commit -m "Add your feature"- Push to branch
git push origin feature/your-feature- Open a Pull Request
This project is licensed under the ISC License - see the LICENSE file for details.
If you encounter any issues or have questions, please:
- Open an issue on GitHub
- Contact the project maintainer
- Check the existing issues for solutions
- Inspired by Zerodha
- React & Express documentation
- Chart.js
- MongoDB
- Open-source community
Deployment coming soon.
Happy Coding! π
β If you find this project helpful, please consider giving it a star!