Update README for Windows VPS setup
Switch from Ubuntu to Windows Server instructions: winget for Git/Node, Visual Studio Build Tools for better-sqlite3 native compilation, PM2 with pm2-windows-startup for persistence, and Windows Firewall rules. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
c19dde7079
commit
1902322627
@@ -4,60 +4,77 @@ Automated futures trading dashboard for prop firm accounts via Tradovate.
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## VPS Setup (Ubuntu 22.04 / 24.04)
|
## VPS Setup (Windows Server 2019 / 2022)
|
||||||
|
|
||||||
### 1. Update the system
|
All commands are run in **PowerShell** (run as Administrator).
|
||||||
|
|
||||||
```bash
|
### 1. Install Git
|
||||||
apt update && apt upgrade -y
|
|
||||||
|
Download and install from https://git-scm.com/download/win, or via winget:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
winget install --id Git.Git -e --source winget
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Restart PowerShell after installing so `git` is on the PATH.
|
||||||
|
|
||||||
### 2. Install Node.js 22+
|
### 2. Install Node.js 22+
|
||||||
|
|
||||||
```bash
|
```powershell
|
||||||
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
|
winget install --id OpenJS.NodeJS.LTS -e --source winget
|
||||||
apt install -y nodejs
|
```
|
||||||
|
|
||||||
|
Restart PowerShell, then verify:
|
||||||
|
|
||||||
|
```powershell
|
||||||
node --version # should be v22.x or higher
|
node --version # should be v22.x or higher
|
||||||
|
npm --version
|
||||||
```
|
```
|
||||||
|
|
||||||
### 3. Install build tools (required for better-sqlite3 native module)
|
### 3. Install Windows Build Tools (required for better-sqlite3)
|
||||||
|
|
||||||
```bash
|
`better-sqlite3` compiles a native C++ module and needs the Visual Studio build tools:
|
||||||
apt install -y build-essential python3
|
|
||||||
|
```powershell
|
||||||
|
npm install -g windows-build-tools
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If that fails on newer Node, install manually:
|
||||||
|
- Download **Build Tools for Visual Studio** from https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2022
|
||||||
|
- During install, select **"Desktop development with C++"**
|
||||||
|
|
||||||
### 4. Clone the repo
|
### 4. Clone the repo
|
||||||
|
|
||||||
```bash
|
```powershell
|
||||||
git clone https://github.com/Senofy/autofirmer.git
|
git clone https://github.com/Senofy/autofirmer.git
|
||||||
cd autofirmer
|
cd autofirmer
|
||||||
```
|
```
|
||||||
|
|
||||||
### 5. Install dependencies
|
### 5. Install dependencies
|
||||||
|
|
||||||
```bash
|
```powershell
|
||||||
npm install
|
npm install
|
||||||
```
|
```
|
||||||
|
|
||||||
### 6. Build
|
### 6. Build
|
||||||
|
|
||||||
```bash
|
```powershell
|
||||||
npm run build
|
npm run build
|
||||||
```
|
```
|
||||||
|
|
||||||
### 7. Run
|
### 7. Run
|
||||||
|
|
||||||
**Development (with hot reload):**
|
**Development (with hot reload):**
|
||||||
```bash
|
```powershell
|
||||||
npm run dev
|
npm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
**Production:**
|
**Production:**
|
||||||
```bash
|
```powershell
|
||||||
npm start
|
npm start
|
||||||
```
|
```
|
||||||
|
|
||||||
The app runs on **port 3000** by default. Access it at `http://<your-vps-ip>:3000`.
|
The app runs on **port 3000**. Access it at `http://<your-vps-ip>:3000`.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -76,15 +93,26 @@ Open the app in your browser and add your firms through the UI:
|
|||||||
|
|
||||||
## Keeping it running (PM2)
|
## Keeping it running (PM2)
|
||||||
|
|
||||||
```bash
|
Install PM2 globally:
|
||||||
|
|
||||||
|
```powershell
|
||||||
npm install -g pm2
|
npm install -g pm2
|
||||||
|
npm install -g pm2-windows-startup
|
||||||
|
```
|
||||||
|
|
||||||
|
Start the app and save the process list:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
cd C:\path\to\autofirmer
|
||||||
pm2 start "npm start" --name autofirmer
|
pm2 start "npm start" --name autofirmer
|
||||||
pm2 save
|
pm2 save
|
||||||
pm2 startup # follow the printed command to enable on reboot
|
pm2-startup install
|
||||||
```
|
```
|
||||||
|
|
||||||
To restart after pulling updates:
|
To restart after pulling updates:
|
||||||
```bash
|
|
||||||
|
```powershell
|
||||||
|
cd C:\path\to\autofirmer
|
||||||
git pull
|
git pull
|
||||||
npm install
|
npm install
|
||||||
npm run build
|
npm run build
|
||||||
@@ -95,19 +123,24 @@ pm2 restart autofirmer
|
|||||||
|
|
||||||
## Firewall
|
## Firewall
|
||||||
|
|
||||||
If you only need local/trusted access, restrict port 3000:
|
To restrict port 3000 to a specific trusted IP only:
|
||||||
|
|
||||||
```bash
|
```powershell
|
||||||
ufw allow ssh
|
New-NetFirewallRule -DisplayName "AutoFirmer" -Direction Inbound -Protocol TCP -LocalPort 3000 -RemoteAddress <your-ip> -Action Allow
|
||||||
ufw allow from <your-ip> to any port 3000
|
```
|
||||||
ufw enable
|
|
||||||
|
Or open it to all inbound (less secure):
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
New-NetFirewallRule -DisplayName "AutoFirmer" -Direction Inbound -Protocol TCP -LocalPort 3000 -Action Allow
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Updating
|
## Updating
|
||||||
|
|
||||||
```bash
|
```powershell
|
||||||
|
cd C:\path\to\autofirmer
|
||||||
git pull
|
git pull
|
||||||
npm install # only needed if dependencies changed
|
npm install # only needed if dependencies changed
|
||||||
npm run build
|
npm run build
|
||||||
|
|||||||
Reference in New Issue
Block a user