From c19dde707907a8651fd989da7cc9c0f47cfb06e1 Mon Sep 17 00:00:00 2001 From: Senofy <63175905+Senofy@users.noreply.github.com> Date: Mon, 9 Mar 2026 13:58:24 -0500 Subject: [PATCH] Replace Next.js boilerplate README with VPS setup guide 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 --- README.md | 121 ++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 100 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index e215bc4..cfa8e6f 100644 --- a/README.md +++ b/README.md @@ -1,36 +1,115 @@ -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). +# AutoFirmer -## Getting Started +Automated futures trading dashboard for prop firm accounts via Tradovate. -First, run the development server: +--- + +## VPS Setup (Ubuntu 22.04 / 24.04) + +### 1. Update the system ```bash -npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev +apt update && apt upgrade -y ``` -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. +### 2. Install Node.js 22+ -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. +```bash +curl -fsSL https://deb.nodesource.com/setup_22.x | bash - +apt install -y nodejs +node --version # should be v22.x or higher +``` -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. +### 3. Install build tools (required for better-sqlite3 native module) -## Learn More +```bash +apt install -y build-essential python3 +``` -To learn more about Next.js, take a look at the following resources: +### 4. Clone the repo -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. +```bash +git clone https://github.com/Senofy/autofirmer.git +cd autofirmer +``` -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! +### 5. Install dependencies -## Deploy on Vercel +```bash +npm install +``` -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. +### 6. Build -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. +```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://: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 to any port 3000 +ufw enable +``` + +--- + +## Updating + +```bash +git pull +npm install # only needed if dependencies changed +npm run build +pm2 restart autofirmer +```