diff --git a/README.md b/README.md index a811bd3..9e74a00 100644 --- a/README.md +++ b/README.md @@ -4,77 +4,37 @@ Automated futures trading dashboard for prop firm accounts via Tradovate. --- -## VPS Setup (Windows Server 2019 / 2022) +## Setup -All commands are run in **PowerShell** (run as Administrator). - -### 1. Install Git - -Download and install from https://git-scm.com/download/win, or via winget: +On a fresh Windows machine, in **PowerShell**, from wherever you want the +instance to live: ```powershell -winget install --id Git.Git -e --source winget +irm https://git.juicerroom.com/senofy/autofirmer-expanded/raw/branch/master/setup-windows.bat -OutFile setup-windows.bat ``` -Restart PowerShell after installing so `git` is on the PATH. - -### 2. Install Node.js 22+ - ```powershell -winget install --id OpenJS.NodeJS.LTS -e --source winget +.\setup-windows.bat ``` -Restart PowerShell, then verify: +That is the whole install. It clones into an `autofirmer` folder beside itself, +installs anything missing (Git, Node, Python) via winget, installs dependencies, +builds, asks for the master dashboard URL and an instance name, and offers to +set up auto-start and auto-update. -```powershell -node --version # should be v22.x or higher -npm --version -``` +Re-running it updates an existing checkout rather than cloning again, so it +doubles as a repair tool. -### 3. Install Windows Build Tools (required for better-sqlite3) +Two things it deliberately does, worth knowing: -`better-sqlite3` compiles a native C++ module and needs the Visual Studio build tools: +- **Node LTS, not latest.** `better-sqlite3` ships prebuilt binaries for LTS + only. On a newer major it falls back to compiling with node-gyp and fails + without Visual Studio Build Tools, so the script warns before that happens. +- **It looks for tools off `PATH`.** A tool installed in the same session it is + needed — or installed without its "add to PATH" option — is invisible to a + running shell, so the script checks the standard install directories too. -```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 - -```powershell -git clone https://github.com/Senofy/autofirmer.git -cd autofirmer -``` - -### 5. Install dependencies - -```powershell -npm install -``` - -### 6. Build - -```powershell -npm run build -``` - -### 7. Run - -**Development (with hot reload):** -```powershell -npm run dev -``` - -**Production:** -```powershell -npm start -``` - -The app runs on **port 3000**. Access it at `http://:3000`. +The dashboard runs on port **3000**: `http://localhost:3000`. --- @@ -119,11 +79,13 @@ Adding a new firm also means adding its host to `host_permissions` in `extension/manifest.json` and reloading. Without it the extension cannot read that site, and every step fails to locate. -### 2. Install the clicker +### 2. The clicker + +`setup-windows.bat` installs its Python dependencies, and re-applies them +whenever `clicker/requirements.txt` changes. To do it by hand: ```powershell -cd clicker -pip install -r requirements.txt +python -m pip install -r clicker\requirements.txt ``` See `clicker/README.md` for the per-platform notes — display scaling and @@ -132,11 +94,14 @@ run before letting it click anything on a new machine. ### 3. Start the runner +Auto-start runs it under PM2, so normally there is nothing to do. To run it by +hand instead: + ```powershell python clicker\runner.py ``` -Leave it running. It reports in every two seconds, and the dashboard greys out +It reports in every two seconds, and the dashboard greys out the automation buttons when it is not there. A running Python process does not reload when the source changes, so restart it after pulling updates; the dashboard warns when its version is behind.