Web Trading Platform Link
A real-time web trading platform that simulates trading activity using WebSockets. Built with the MERN stack (MongoDB, Express, React, Node.js) and Socket.io for live communication.
- 📈 Real-time stock data updates using Socket.IO
- 👤 User authentication and session management.
- 🧾 Order placement and history tracking
- 🗃️ MongoDB for persistent storage
- 🎨 React-based responsive UI with Vite for fast builds
- Frontend: React, Vite, TailwindCSS
- Backend: Node.js, Express, Socket.IO, MongoDB
- Other Tools: Mongoose, JWT, dotenv
- Clone the repository
git clone https://github.com/omkarhole/web-trading-platform.git
cd web-trading-platform- Install backend dependencies
npm install- Install frontend dependencies
cd client
npm install
cd ..- Create environment file
cp .env.example .env- Configure your environment variables in
.env:
PORT=5000
MONGODB_URI=mongodb://localhost:27017/trading-platform
JWT_SECRET=your-jwt-secret-key
NODE_ENV=development
-
Make sure MongoDB is running on your system
-
Start the development servers
Backend server:
npm run devFrontend server (in a new terminal):
cd client
npm run dev- Open your browser and navigate to
http://localhost:3000
POST /api/auth/register- Register new userPOST /api/auth/login- User loginGET /api/auth/profile- Get user profile
GET /api/stocks- Get all stocksGET /api/stocks/:symbol- Get specific stock dataPOST /api/orders- Place new orderGET /api/orders- Get user ordersDELETE /api/orders/:id- Cancel order
GET /api/portfolio- Get user portfolioGET /api/portfolio/history- Get trading history
- Register a new account or login with existing credentials
- View real-time stock prices on the dashboard
- Place buy/sell orders using the trading interface
- Monitor your portfolio and trading history
- Receive real-time updates via WebSocket connections
web-trading-platform/
├── client/ # React frontend
│ ├── src/
│ ├── public/
│ └── package.json
├── server/ # Express backend
│ ├── models/
│ ├── routes/
│ ├── middleware/
│ └── server.js
├── .env.example
├── package.json
└── README.md
npm run dev- Start backend development servernpm run start- Start backend production servernpm test- Run testsnpm run build- Build frontend for production
- Fork the project
- Create your 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.
Omkar Hole - [email protected]
Project Link: github