TradeFlow is a modern full-stack trading platform that simulates a real-world stock trading experience. Users can execute trades, manage portfolios, and track orders, holdings, positions, bids, and funds, while enjoying a responsive user interface, secure backend architecture, and efficient trade execution.
- π Overview
- π₯ Demo Video
- π Live Demo
- π Features
- π οΈ Tech Stack
- π Project Architecture
- π‘ API Endpoints
- π Usage
- π€ Demo User
- π§ Local Setup for Developers
- π¬ Testing
- π¨βπ» Developer
TradeFlow is a fully responsive, full-stack trading platform that delivers a realistic, real-time stock market simulation. It enables users to buy and sell assets, monitor investments, and track orders, holdings, positions, bids, and funds through an intuitive and interactive dashboard. Users can also enjoy advanced search and filtering, light and dark themes, and visual analytics with charts and heatmaps.
The platform incorporates secure authentication and authorization with a modular architecture, reflecting professional-grade FinTech design principles.
π Built with the MERN stack, TradeFlow demonstrates scalable architecture, efficient trade execution, and a seamless user experience.
π Access TradeFlow live here: Visit TradeFlow
-
π Portfolio Management
- Track and manage holdings, positions, and portfolio values through a structured trading dashboard.
-
πΉ Trade Execution
- Execute BUY and SELL trades that automatically update orders, holdings, and positions.
-
π Orders Management
- Create and monitor trading orders with details such as instrument, exchange, quantity, and price.
-
π¦ Funds Management
- Manage available trading funds, including equity and commodity balances.
-
π― Bids System
- Maintain auction-style bids from holdings with real-time profit/loss tracking.
-
π Interactive Search & Watchlist
- Quickly search stocks and perform instant actions like Buy, Sell, or Delete directly from the watchlist.
-
π Secure Authentication
- Authenticate users securely using JWT tokens and bcrypt for password hashing.
-
π₯ Responsive User Interface
- Fully responsive and works seamlessly across all devices.
-
π Light & Dark Themes
- Switch between light and dark modes for a comfortable trading experience.
-
π Visual Analytics
- Analyze portfolio and market trends using charts and heatmaps.
-
β οΈ Error Handling- Robust error handling ensures invalid requests and broken routes are handled gracefully.
-
React
- Builds a dynamic and interactive frontend.
-
React Router
- Handles client-side routing and smooth navigation between pages.
-
Axios
- Performs API requests to fetch and manage trading data.
-
Bootstrap
- Ensures a fully responsive and mobile-friendly UI.
-
Recharts
- Renders charts and graphs for portfolio and market visualization.
-
React Helmet Async
- Dynamically manages page titles and meta tags for SEO and usability.
-
Context API
- Manages global state across the React application.
-
Vanilla CSS (with CSS Variables)
- Scalable, maintainable, and reusable styles.
-
Node.js
- Provides a scalable backend runtime environment.
-
Express.js
- Handles routing, middleware, and RESTful API endpoints.
-
CORS (Cross-Origin Resource Sharing)
- Allows secure resource sharing between frontend and backend.
-
Server-Side Validation (Joi)
- Ensures data integrity and prevents invalid requests with schema validation.
-
MongoDB
- Stores user portfolios, orders, and market data efficiently.
-
Mongoose
- Object Data Modeling (ODM) for MongoDB with schema validation.
-
JWT Authentication
- Secures user authentication and protects API routes.
-
bcrypt password hashing
- Encrypts user passwords for secure storage.
-
Helmet security middleware
- Adds HTTP headers for enhanced application security.
The project adopts a feature-based modular architecture, ensuring scalability, maintainability, and production readiness.
TradeFlow/
βββ backend/
βββ controllers/
β βββ auth.controller.js
β βββ orders.controller.js
β βββ holdings.controller.js
β βββ positions.controller.js
β βββ bids.controller.js
β βββ funds.controller.js
β βββ trade.controller.js
β
βββ init/
β βββ data.js
β βββ index.js
β
βββ middleware/
β βββ authenticate.js
β βββ validate.js
β
βββ models/
β βββ user.model.js
β βββ order.model.js
β βββ holding.model.js
β βββ position.model.js
β βββ bid.model.js
β βββ fund.model.js
β
βββ routes/
β βββ auth.routes.js
β βββ orders.routes.js
β βββ holdings.routes.js
β βββ positions.routes.js
β βββ bids.routes.js
β βββ funds.routes.js
β βββ trade.routes.js
β
βββ utils/
β βββ generateToken.js
β
βββ validators/
β βββ user.validation.js
β βββ order.validation.js
β βββ holding.validation.js
β βββ position.validation.js
β βββ bids.validation.js
β βββ fund.validation.js
β βββ trade.validation.js
β
βββ .env
βββ app.js
βββ index.js
βββ package.json
βββ frontend/
βββ public/
βββ src/
β βββ api.js
β βββ main.jsx
β
β βββ app/
β β βββ App.jsx
β β βββ router.jsx
β
β βββ assets/
β β βββ styles/
β β βββ globals.css
β β βββ reset.css
β β βββ variables.css
β
β βββ modules/
β β βββ auth/
β β β βββ pages/
β β β βββ signup/
β β β βββ SignupPage.jsx
β β β βββ components/
β β β βββ AccountOpeningStepsSection.css
β β β βββ AccountOpeningStepsSection.jsx
β β β βββ AccountTypesSection.css
β β β βββ AccountTypesSection.jsx
β β β βββ BenefitsSection.css
β β β βββ BenefitsSection.jsx
β β β βββ FaqSection.css
β β β βββ FaqSection.jsx
β β β βββ HeroSection.css
β β β βββ HeroSection.jsx
β β β βββ InvestmentOptionsSection.css
β β β βββ InvestmentOptionsSection.jsx
β β β
β β βββ dashboard/
β β β βββ data.js
β β β βββ components/
β β β β βββ actionWindow/
β β β β β βββ BuyActionWindow.css
β β β β β βββ BuyActionWindow.jsx
β β β β β βββ FundsActionWindow.css
β β β β β βββ FundsActionWindow.jsx
β β β β β βββ GeneralContext.jsx
β β β β β
β β β β βββ header/
β β β β β βββ Header.css
β β β β β βββ Header.jsx
β β β β β βββ Menu.css
β β β β β βββ Menu.jsx
β β β β β βββ ProfileDropdown.css
β β β β β βββ ProfileDropdown.jsx
β β β β β
β β β β βββ notFoundPage/
β β β β β βββ NotFoundPageDashboard.css
β β β β β βββ NotFoundPageDashboard.jsx
β β β β β
β β β β βββ sidebar/
β β β β β βββ SidebarPage.css
β β β β β βββ SidebarPage.jsx
β β β β β βββ WatchList.css
β β β β β βββ WatchList.jsx
β β β β β βββ WatchListItems.css
β β β β β βββ WatchListItems.jsx
β β β β β
β β β β βββ widgets/
β β β β βββ CustomContent.jsx
β β β β βββ CustomTooltip.jsx
β β β β βββ NiftyChart.jsx
β β β β βββ TreemapCard.jsx
β β β β
β β β βββ pages/
β β β βββ bids/
β β β β βββ BidsPage.jsx
β β β β βββ components/
β β β β βββ Bids.css
β β β β βββ Bids.jsx
β β β β
β β β βββ dashboardHome/
β β β β βββ DashboardHomePage.jsx
β β β β βββ components/
β β β β βββ Summary.css
β β β β βββ Summary.jsx
β β β β
β β β βββ funds/
β β β β βββ FundsPage.jsx
β β β β βββ components/
β β β β βββ Funds.css
β β β β βββ Funds.jsx
β β β β
β β β βββ holdings/
β β β β βββ HoldingsPage.jsx
β β β β βββ components/
β β β β βββ Holdings.css
β β β β βββ Holdings.jsx
β β β β
β β β βββ orders/
β β β β βββ OrdersPage.jsx
β β β β βββ components/
β β β β βββ Orders.css
β β β β βββ Orders.jsx
β β β β
β β β βββ positions/
β β β βββ PositionsPage.jsx
β β β βββ components/
β β β βββ Positions.css
β β β βββ Positions.jsx
β β β
β β βββ landingPages/
β β βββ about/
β β β βββ AboutPage.jsx
β β β βββ components/
β β β βββ HeroSection.css
β β β βββ HeroSection.jsx
β β β βββ TeamSection.css
β β β βββ TeamSection.jsx
β β β
β β βββ home/
β β β βββ HomePage.jsx
β β β βββ components/
β β β βββ AwardsSection.css
β β β βββ AwardsSection.jsx
β β β βββ EducationSection.css
β β β βββ EducationSection.jsx
β β β βββ HeroSection.css
β β β βββ HeroSection.jsx
β β β βββ PricingSection.css
β β β βββ PricingSection.jsx
β β β βββ StatsSection.css
β β β βββ StatsSection.jsx
β β β
β β βββ pricing/
β β β βββ PricingPage.jsx
β β β βββ components/
β β β βββ BrokerageSection.css
β β β βββ BrokerageSection.jsx
β β β βββ HeroSection.css
β β β βββ HeroSection.jsx
β β β
β β βββ product/
β β β βββ ProductPage.jsx
β β β βββ components/
β β β βββ HeroSection.css
β β β βββ HeroSection.jsx
β β β βββ LeftSection.css
β β β βββ LeftSection.jsx
β β β βββ RightSection.css
β β β βββ RightSection.jsx
β β β βββ UniverseSection.css
β β β βββ UniverseSection.jsx
β β β
β β βββ support/
β β βββ SupportPage.jsx
β β βββ components/
β β βββ CreateTicketSection.css
β β βββ CreateTicketSection.jsx
β β βββ HeroSection.css
β β βββ HeroSection.jsx
β β
β β
β βββ shared/
β βββ components/
β β βββ footer/
β β β βββ Footer.css
β β β βββ Footer.jsx
β β β
β β βββ header/
β β β βββ Header.css
β β β βββ Header.jsx
β β β
β β βββ notFoundPage/
β β β βββ NotFoundPage.css
β β β βββ NotFoundPage.jsx
β β β
β β βββ openAccount/
β β β βββ OpenAccount.css
β β β βββ OpenAccount.jsx
β β β
β β βββ protectedRoute/
β β β βββ ProtectedRoute.jsx
β β β
β β βββ themeToggle/
β β βββ ThemeToggle.css
β β βββ ThemeToggle.jsx
β β
β βββ context/
β β βββ ThemeContext.jsx
β β βββ ThemeProvider.jsx
β β
β βββ hooks/
β β βββ useTheme.js
β β
β βββ layouts/
β β βββ DashboardLayout.css
β β βββ DashboardLayout.jsx
β β βββ MainLayout.jsx
β β
β βββ meta/
β βββ MetaWrapper.jsx
β βββ PageMeta.jsx
β βββ pageTitles.js
β
βββ index.html
βββ package.json
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/signup |
Register a new user |
| POST | /api/auth/login |
User login |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/trade/execute |
Execute a trade |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/orders |
Get all orders |
| POST | /api/orders |
Create a new order |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/holdings |
Get all holdings |
| POST | /api/holdings |
Add a new holding |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/positions |
Get all positions |
| POST | /api/positions |
Add a new position |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/bids |
Get all bids |
| POST | /api/bids |
Create a new bid |
| DELETE | /api/bids/:id |
Delete a bid by ID |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/funds |
Get all funds |
| POST | /api/funds |
Add a new fund |
All API routes were tested using Thunder Client.
- Users can buy and sell assets and manage orders, holdings, positions, bids, and funds in real time.
- Users can track investment performance with interactive dashboards, charts, and heatmaps.
- Users can search and filter assets to quickly find stocks or funds of interest.
- Users can switch between light and dark themes for a personalized experience.
- Secure authentication and authorization protect user accounts and transactions.
- Admins can manage users and monitor transactions to ensure platform integrity.
- Proper error handling displays informative messages, including a βPage Not Foundβ for invalid URLs.
- Fully responsive UI ensures a smooth experience across all devices.
Use the demo account below to explore the dashboard, orders, holdings, bids, and trading features without signing up:
| Credential | Value |
|---|---|
tradeflowadmin@gmail.com |
|
| Password | admin@123 |
-
Fork the repository on GitHub and clone it
git clone <your-forked-repo-url>
-
Install backend dependencies
cd backend npm install -
Install frontend dependencies
cd frontend npm install -
Set up environment variables
Create a .env file inside the backend folder and add:
MONGO_URI=your-mongodb-connection-string
JWT_SECRET=your-jwt-secret
JWT_SECRETcan be any random string used to sign authentication tokens.
Create a .env file inside the frontend folder and add:
VITE_API_URL=http://localhost:8080This connects the frontend to your local backend server.
- Start the development servers
Backend:
cd backend
npm run devFrontend:
cd frontend
npm run devBoth servers run in development mode. The frontend port may vary depending on your system.
- Visit the application
Open the URL displayed in the terminal (usually http://localhost:5173) in your browser to use the frontend.
TradeFlow includes unit tests for critical UI components using Vitest and React Testing Library.
Currently, the Signup Page functionality is tested to ensure:
- The signup form renders correctly
- All input fields appear
- Users can type into fields
- The signup button exists
- API calls are triggered correctly
- Error messages appear when signup fails
cd frontend
npm run testThe tests for the Signup Page ran successfully, confirming the expected behavior of the form components, API integration, and error handling.
All tests passed successfully, ensuring that the Signup Page is reliable and functions as intended.
| Developed by | GitHub | |
|---|---|---|
| Harshal Waghmare | GitHub |
