A paper trading dashboard for simulating and monitoring trades.
The application consists of two main parts:
-
Backend API Server (
src/api-server/)- Express.js server providing REST API endpoints
- Direct access to SQLite database using DatabaseService
- Handles all data operations and business logic
-
Frontend (
frontend/)- Next.js application
- Uses SWR for data fetching
- Communicates with backend API
- Real-time updates with auto-refresh
- Required: Node.js v18.17.0 or higher (Next.js requirement)
- Recommended: Use nvm for Node.js version management
If using nvm:
nvm install 18.17.0
nvm use 18.17.0If not using nvm, download and install Node.js 18.17.0 or higher from nodejs.org
- npm v8 or higher (included with Node.js)
- Clone the repository:
git clone <repository-url>
cd SolBot-PPtrading- Install Dependencies:
# Install API server dependencies
cd src/api-server && npm install
cd ../..
# Install frontend dependencies
cd frontend && npm install
cd ..- Run Development Environment:
# The dev script will:
# - Check/set correct Node.js version if using nvm
# - Start the API server on port 3001
# - Start the frontend on port 3000
./dev.sh- Access the Application:
- Frontend Dashboard: http://localhost:3000
- API Documentation: http://localhost:3001/api-docs
- API Health Check: http://localhost:3001/health
The frontend will automatically connect to the API server and update in real-time.
If you encounter Node.js version errors:
- Install nvm: Follow instructions at https://github.com/nvm-sh/nvm
- Install and use the correct Node.js version:
nvm install 18.17.0 nvm use 18.17.0
- Restart the development server:
./dev.sh
Frontend (.env.local):
NEXT_PUBLIC_API_URL=http://localhost:3001
The backend provides the following endpoints:
GET /api/dashboard- Get all dashboard dataGET /api/dashboard/positions- Get current positionsGET /api/dashboard/trades- Get recent tradesGET /api/dashboard/stats- Get trading statistics