Covers Node.js install, build-tools for native SQLite module, clone, install, build, run, PM2 process management, firewall, and update steps. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
116 lines
1.9 KiB
Markdown
116 lines
1.9 KiB
Markdown
# AutoFirmer
|
|
|
|
Automated futures trading dashboard for prop firm accounts via Tradovate.
|
|
|
|
---
|
|
|
|
## VPS Setup (Ubuntu 22.04 / 24.04)
|
|
|
|
### 1. Update the system
|
|
|
|
```bash
|
|
apt update && apt upgrade -y
|
|
```
|
|
|
|
### 2. Install Node.js 22+
|
|
|
|
```bash
|
|
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
|
apt install -y nodejs
|
|
node --version # should be v22.x or higher
|
|
```
|
|
|
|
### 3. Install build tools (required for better-sqlite3 native module)
|
|
|
|
```bash
|
|
apt install -y build-essential python3
|
|
```
|
|
|
|
### 4. Clone the repo
|
|
|
|
```bash
|
|
git clone https://github.com/Senofy/autofirmer.git
|
|
cd autofirmer
|
|
```
|
|
|
|
### 5. Install dependencies
|
|
|
|
```bash
|
|
npm install
|
|
```
|
|
|
|
### 6. Build
|
|
|
|
```bash
|
|
npm run build
|
|
```
|
|
|
|
### 7. Run
|
|
|
|
**Development (with hot reload):**
|
|
```bash
|
|
npm run dev
|
|
```
|
|
|
|
**Production:**
|
|
```bash
|
|
npm start
|
|
```
|
|
|
|
The app runs on **port 3000** by default. Access it at `http://<your-vps-ip>:3000`.
|
|
|
|
---
|
|
|
|
## First-time setup
|
|
|
|
On first run, the SQLite database (`autotrader.sqlite`) is created automatically in the project root. No migrations need to be run manually.
|
|
|
|
Open the app in your browser and add your firms through the UI:
|
|
|
|
1. Click **+ Add Firm** on the main page
|
|
2. Enter the firm name, Tradovate username, and password
|
|
3. Go to the firm's **Settings** page to configure account types (prefix, profit target, consistency %, etc.)
|
|
4. Return to the main page — accounts will populate once the firm connects to Tradovate
|
|
|
|
---
|
|
|
|
## Keeping it running (PM2)
|
|
|
|
```bash
|
|
npm install -g pm2
|
|
pm2 start "npm start" --name autofirmer
|
|
pm2 save
|
|
pm2 startup # follow the printed command to enable on reboot
|
|
```
|
|
|
|
To restart after pulling updates:
|
|
```bash
|
|
git pull
|
|
npm install
|
|
npm run build
|
|
pm2 restart autofirmer
|
|
```
|
|
|
|
---
|
|
|
|
## Firewall
|
|
|
|
If you only need local/trusted access, restrict port 3000:
|
|
|
|
```bash
|
|
ufw allow ssh
|
|
ufw allow from <your-ip> to any port 3000
|
|
ufw enable
|
|
```
|
|
|
|
---
|
|
|
|
## Updating
|
|
|
|
```bash
|
|
git pull
|
|
npm install # only needed if dependencies changed
|
|
npm run build
|
|
pm2 restart autofirmer
|
|
```
|