手动安装

手动安装和配置 FastBuildAI。

环境准备

拉取代码到本地

git clone https://git.likeshop.cn/fastbuildai/fastbuildai-monorepo.git

启动容器

cd fastbuildai-monorepo
docker:up

安装依赖

# 如果没有pnpm,需要先安装pnpm
npm install -g pnpm

# 安装依赖
pnpm install

配置环境变量

cp .env.development.local.example .env.development.local

编辑 .env.development.local 文件,配置数据库连接信息

# 示例
# Base
NODE_ENV=development
APP_NAME=FastBuildAI
APP_VERSION=1.0.0

# Server
SERVER_PORT=4090
SERVER_CORS_ENABLED=true
SERVER_CORS_ORIGIN=*
SERVER_SHOW_DETAILED_ERRORS=false

# PM2
PM2_APP_NAME=fastbuildai

# JWT
JWT_SECRET=fastbuildai
JWT_EXPIRES_IN=1d

# Database
DB_TYPE=postgres
DB_HOST=localhost
DB_PORT=5432
DB_USERNAME=postgres
DB_PASSWORD=postgres
DB_DATABASE=fastbuildai
DB_TABLE_PREFIX=fb_
DB_SYNCHRONIZE=true
DB_LOGGING=true

# Redis
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_USERNAME=
REDIS_PASSWORD=
REDIS_DB=0
REDIS_TTL=60*60*24

# Logs
# type LogLevel = "log" | "error" | "warn" | "debug" | "verbose" | "fatal"
LOG_LEVELS=error,warn,debug,fatal
LOG_TO_FILE=true

# Web
VITE_APP_BASE_URL='http://localhost:4090'
VITE_APP_WEB_API_PREFIX=/web
VITE_APP_CONSOLE_API_PREFIX=/console
VITE_APP_SHOP_URL='https://freebuildai-shop.yixiangonline.com'

启动服务

pnpm dev

访问