feat: 初始化项目

This commit is contained in:
richarjiang
2025-08-13 15:17:33 +08:00
commit 4f9d648a50
72 changed files with 29051 additions and 0 deletions

45
start.sh Executable file
View File

@@ -0,0 +1,45 @@
#!/bin/bash
# 定义颜色
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 打印带颜色的消息
print_message() {
echo -e "${GREEN}$1${NC}"
}
print_warning() {
echo -e "${YELLOW}$1${NC}"
}
# 检查PM2是否安装
if ! command -v pm2 &> /dev/null; then
print_warning "PM2未安装正在全局安装PM2..."
npm install -g pm2
fi
# 创建日志目录
print_message "创建日志目录..."
mkdir -p logs
# 安装依赖
print_message "安装依赖..."
yarn install
# 构建项目
print_message "构建项目..."
yarn build
# 使用PM2启动项目
print_message "使用PM2启动项目..."
yarn pm2:start
# 显示PM2状态
print_message "PM2状态"
pm2 status
print_message "应用已成功部署并启动!"
print_message "可以使用以下命令查看日志: yarn pm2:logs"
print_message "日志文件位置: ./logs/output.log 和 ./logs/error.log"