mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-16 09:11:03 +08:00
docs: add Windows installation guide
This commit is contained in:
81
README.md
81
README.md
@@ -186,6 +186,87 @@ Access Web Interface: **http://localhost:3000**
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Windows Installation
|
||||||
|
|
||||||
|
### Method 1: Docker Desktop (Recommended)
|
||||||
|
|
||||||
|
1. **Install Docker Desktop**
|
||||||
|
- Download from [docker.com/products/docker-desktop](https://www.docker.com/products/docker-desktop/)
|
||||||
|
- Run the installer and restart your computer
|
||||||
|
- Start Docker Desktop and wait for it to be ready
|
||||||
|
|
||||||
|
2. **Run NOFX**
|
||||||
|
```powershell
|
||||||
|
# Open PowerShell and run:
|
||||||
|
curl -o docker-compose.prod.yml https://raw.githubusercontent.com/NoFxAiOS/nofx/main/docker-compose.prod.yml
|
||||||
|
docker compose -f docker-compose.prod.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **Access**: Open **http://localhost:3000** in your browser
|
||||||
|
|
||||||
|
### Method 2: WSL2 (For Development)
|
||||||
|
|
||||||
|
1. **Install WSL2**
|
||||||
|
```powershell
|
||||||
|
# Open PowerShell as Administrator
|
||||||
|
wsl --install
|
||||||
|
```
|
||||||
|
Restart your computer after installation.
|
||||||
|
|
||||||
|
2. **Install Ubuntu from Microsoft Store**
|
||||||
|
- Open Microsoft Store
|
||||||
|
- Search "Ubuntu 22.04" and install
|
||||||
|
- Launch Ubuntu and set up username/password
|
||||||
|
|
||||||
|
3. **Install Dependencies in WSL2**
|
||||||
|
```bash
|
||||||
|
# Update system
|
||||||
|
sudo apt update && sudo apt upgrade -y
|
||||||
|
|
||||||
|
# Install Go
|
||||||
|
wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz
|
||||||
|
sudo tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz
|
||||||
|
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
|
||||||
|
source ~/.bashrc
|
||||||
|
|
||||||
|
# Install Node.js
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
||||||
|
sudo apt-get install -y nodejs
|
||||||
|
|
||||||
|
# Install TA-Lib
|
||||||
|
sudo apt-get install -y libta-lib0-dev
|
||||||
|
|
||||||
|
# Install Git
|
||||||
|
sudo apt-get install -y git
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **Clone and Run NOFX**
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/NoFxAiOS/nofx.git
|
||||||
|
cd nofx
|
||||||
|
|
||||||
|
# Build and run backend
|
||||||
|
go build -o nofx && ./nofx
|
||||||
|
|
||||||
|
# In another terminal, run frontend
|
||||||
|
cd web && npm install && npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **Access**: Open **http://localhost:3000** in Windows browser
|
||||||
|
|
||||||
|
### Method 3: Docker in WSL2 (Best of Both Worlds)
|
||||||
|
|
||||||
|
1. **Install Docker Desktop with WSL2 backend**
|
||||||
|
- During Docker Desktop installation, enable "Use WSL 2 based engine"
|
||||||
|
- In Docker Desktop Settings → Resources → WSL Integration, enable your Linux distro
|
||||||
|
|
||||||
|
2. **Run from WSL2 terminal**
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://raw.githubusercontent.com/NoFxAiOS/nofx/main/install.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Server Deployment
|
## Server Deployment
|
||||||
|
|
||||||
### Quick Deploy (HTTP via IP)
|
### Quick Deploy (HTTP via IP)
|
||||||
|
|||||||
@@ -169,6 +169,87 @@ npm run dev
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
## Windows 安装
|
||||||
|
|
||||||
|
### 方法一:Docker Desktop(推荐)
|
||||||
|
|
||||||
|
1. **安装 Docker Desktop**
|
||||||
|
- 从 [docker.com/products/docker-desktop](https://www.docker.com/products/docker-desktop/) 下载
|
||||||
|
- 运行安装程序并重启电脑
|
||||||
|
- 启动 Docker Desktop 并等待就绪
|
||||||
|
|
||||||
|
2. **运行 NOFX**
|
||||||
|
```powershell
|
||||||
|
# 打开 PowerShell 运行:
|
||||||
|
curl -o docker-compose.prod.yml https://raw.githubusercontent.com/NoFxAiOS/nofx/main/docker-compose.prod.yml
|
||||||
|
docker compose -f docker-compose.prod.yml up -d
|
||||||
|
```
|
||||||
|
|
||||||
|
3. **访问**:在浏览器打开 **http://localhost:3000**
|
||||||
|
|
||||||
|
### 方法二:WSL2(适合开发)
|
||||||
|
|
||||||
|
1. **安装 WSL2**
|
||||||
|
```powershell
|
||||||
|
# 以管理员身份打开 PowerShell
|
||||||
|
wsl --install
|
||||||
|
```
|
||||||
|
安装完成后重启电脑。
|
||||||
|
|
||||||
|
2. **从 Microsoft Store 安装 Ubuntu**
|
||||||
|
- 打开 Microsoft Store
|
||||||
|
- 搜索 "Ubuntu 22.04" 并安装
|
||||||
|
- 启动 Ubuntu 并设置用户名/密码
|
||||||
|
|
||||||
|
3. **在 WSL2 中安装依赖**
|
||||||
|
```bash
|
||||||
|
# 更新系统
|
||||||
|
sudo apt update && sudo apt upgrade -y
|
||||||
|
|
||||||
|
# 安装 Go
|
||||||
|
wget https://go.dev/dl/go1.21.5.linux-amd64.tar.gz
|
||||||
|
sudo tar -C /usr/local -xzf go1.21.5.linux-amd64.tar.gz
|
||||||
|
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.bashrc
|
||||||
|
source ~/.bashrc
|
||||||
|
|
||||||
|
# 安装 Node.js
|
||||||
|
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
|
||||||
|
sudo apt-get install -y nodejs
|
||||||
|
|
||||||
|
# 安装 TA-Lib
|
||||||
|
sudo apt-get install -y libta-lib0-dev
|
||||||
|
|
||||||
|
# 安装 Git
|
||||||
|
sudo apt-get install -y git
|
||||||
|
```
|
||||||
|
|
||||||
|
4. **克隆并运行 NOFX**
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/NoFxAiOS/nofx.git
|
||||||
|
cd nofx
|
||||||
|
|
||||||
|
# 构建并运行后端
|
||||||
|
go build -o nofx && ./nofx
|
||||||
|
|
||||||
|
# 在另一个终端运行前端
|
||||||
|
cd web && npm install && npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
5. **访问**:在 Windows 浏览器打开 **http://localhost:3000**
|
||||||
|
|
||||||
|
### 方法三:WSL2 + Docker(两全其美)
|
||||||
|
|
||||||
|
1. **安装 Docker Desktop 并启用 WSL2 后端**
|
||||||
|
- Docker Desktop 安装时勾选 "Use WSL 2 based engine"
|
||||||
|
- 在 Docker Desktop 设置 → Resources → WSL Integration 中启用你的 Linux 发行版
|
||||||
|
|
||||||
|
2. **在 WSL2 终端运行**
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://raw.githubusercontent.com/NoFxAiOS/nofx/main/install.sh | bash
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## 服务器部署
|
## 服务器部署
|
||||||
|
|
||||||
### 快速部署 (HTTP/IP 访问)
|
### 快速部署 (HTTP/IP 访问)
|
||||||
|
|||||||
Reference in New Issue
Block a user