A paper-trading platform for Forex and Bitcoin โ built to practice real trading workflows without risking real capital.
ForexFlow is a full-stack simulated trading platform that combines live market data, chart-based analysis, virtual portfolio management, and trade performance tracking in a single trading workspace.
It is designed for learning, strategy experimentation, and understanding the mechanics of leveraged trading without executing real orders on an exchange or broker.
ForexFlow lets users work with a simulated trading account and:
- ๐ Monitor live market prices
- โฟ Practice Bitcoin trading
- ๐ฑ Practice Forex trading
- ๐ Analyze price action with interactive charts
- ๐ข Open simulated BUY positions
- ๐ด Open simulated SELL positions
- ๐ Set Stop Loss and Take Profit levels
- ๐ฐ Manage virtual account balance and margin
- ๐ Track open and closed trades
- ๐ Review P&L and trading statistics
- ๐งฎ Simulate position sizing and contract-based P&L
โ ๏ธ Apply margin and stop-out protection
No real trades are executed.
ForexFlow integrates with Twelve Data for market information. The application uses live price/OHLC data for charting and trading workflows, with the backend independently validating market prices before accepting trades.
The frontend also supports real-time tick updates through the Twelve Data WebSocket feed.
Trades are simulated against the user's virtual account balance.
When a position is opened, the required margin is reserved from the simulated balance. When the position is closed, the margin is released and simulated P&L is applied to the account.
The platform supports both directions:
- BUY / Long: profits when the closing price is above the entry price.
- SELL / Short: profits when the closing price is below the entry price.
The backend includes server-side validation for trades and a margin stop-out guard. New positions can be rejected when available simulated funds are insufficient or the account's calculated margin level reaches the configured critical threshold.
Stop Loss and Take Profit values are supported as part of the trade model.
ForexFlow calculates and exposes trading-account statistics including:
- Current balance
- Account health
- Net P&L
- Total trades
- Open trades
- Closed trades
- Winning trades
- Losing trades
- Win rate
- Locked margin
- Most frequently traded pair
- Best trade
- Worst trade
This makes the platform useful not only for placing paper trades, but also for reviewing how a trading approach performs over time.
Live Market Data
โ
โผ
Analyze the Market
โ
โผ
Select Trading Pair
โ
โผ
Configure Trade Parameters
(Direction / Lots / Margin)
โ
โผ
Server Validation
โ
โผ
Margin Availability
โ
โผ
Open Paper Trade
โ
โผ
Monitor Position
โ
โผ
Close Position
โ
โผ
Calculate Simulated P&L
โ
โผ
Update Virtual Balance
โ
โผ
Store Trade History
ForexFlow is organized as a separate React/Vite frontend and Node/Express backend.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ ForexFlow โ
โโโโโโโโโโโโโโโโโโโโโฌโโโโโโโโโโโโโโโโโโโค
โ โ โ
โ Frontend โ Backend โ
โ React + Vite โ Node + Express โ
โ โ โ
โ Trading UI โ Authentication โ
โ Charts โ Trade Engine โ
โ Portfolio โ User Management โ
โ Analysis โ Market Service โ
โ โ Validation โ
โโโโโโโโโโโฌโโโโโโโโโโดโโโโโโโโโฌโโโโโโโโโโ
โ โ
โ โผ
โ SQLite DB
โ
โผ
Twelve Data
REST + WebSocket
- React 19
- Vite 7
- Tailwind CSS
- React Router
- Lightweight Charts
- Framer Motion
- Lucide React
- Node.js 20
- Express 5
- SQLite3
- JWT authentication
- bcryptjs password hashing
- CORS
- dotenv configuration
- Twelve Data REST API
- Twelve Data WebSocket
Forexflow/
โ
โโโ forexflow-frontend/
โ โโโ src/
โ โ โโโ components/
โ โ โโโ hooks/
โ โ โโโ pages/
โ โ โโโ ...
โ โโโ package.json
โ โโโ vite.config.js
โ
โโโ forexflow-backend/
โ โโโ src/
โ โ โโโ config/
โ โ โโโ controllers/
โ โ โโโ middleware/
โ โ โโโ models/
โ โ โโโ routes/
โ โ โโโ services/
โ โ โโโ server.js
โ โโโ .env.example
โ โโโ package.json
โ
โโโ DEPLOYMENT.md
โโโ package.json
โโโ README.md
- Node.js 20+
- npm
- A Twelve Data API key
git clone https://github.com/CodeCrafter-AT/Forexflow.git
cd Forexflownpm run install-allCreate the environment file:
cp forexflow-backend/.env.example forexflow-backend/.envSet the required values in forexflow-backend/.env:
PORT=3001
JWT_SECRET=your_super_secret_jwt_key
TWELVEDATA_API_KEY=your_twelvedata_api_key
NODE_ENV=developmentNever commit real credentials or API keys to GitHub.
Create the frontend environment file from its example and configure the API URL required by the application.
From the repository root:
npm run devThe root development script starts both the frontend and backend concurrently.
ForexFlow performs important checks on the server rather than relying only on the client.
Trade execution includes checks for:
- Valid trade parameters
- Positive margin
- Existing user account
- Sufficient available balance
- Existing/open positions
- Margin-level stop-out conditions
Trade balance updates and trade creation are handled inside database transactions so related account changes can be committed or rolled back together.
The repository includes a dedicated production deployment guide covering the intended deployment architecture:
- Frontend: Vercel
- Backend: Render
- Database: SQLite, with persistence considerations documented in the deployment guide
See DEPLOYMENT.md for the deployment workflow and environment configuration.
ForexFlow is an evolving project. Potential future improvements include:
- More trading instruments
- Advanced order types
- Improved historical backtesting
- Trading journal
- Risk/reward tools
- Advanced performance analytics
- More robust persistent production database
- Automated testing
- Expanded authentication and account features
- Improved real-time market infrastructure
ForexFlow is a paper-trading and educational project.
It does not execute real financial transactions and does not provide investment or financial advice. Simulated trading results do not represent guaranteed or expected results in live markets.
Always understand the risks involved before trading real financial instruments.
This project currently uses the repository's existing ISC license configuration.
ForexFlow
A full-stack project focused on building a realistic paper-trading experience for Forex and Bitcoin markets.
Practice the market. Test your strategy. Trade without risking real capital.