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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
563554c58f
commit
c19dde7079
@@ -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
|
```bash
|
||||||
npm run dev
|
apt update && apt upgrade -y
|
||||||
# or
|
|
||||||
yarn dev
|
|
||||||
# or
|
|
||||||
pnpm dev
|
|
||||||
# or
|
|
||||||
bun dev
|
|
||||||
```
|
```
|
||||||
|
|
||||||
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.
|
```bash
|
||||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
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://<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
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user