deotalandAi/apps/frontend/VERCEL-README.md

55 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Vercel 部署说明 🚀
## 快速开始
本项目已配置为可直接部署到 Vercel。以下是快速部署步骤
### 1. 推送代码到 Git 仓库
```bash
git add .
git commit -m "准备部署到 Vercel"
git push origin main
```
### 2. 在 Vercel 中导入项目
1. 访问 [vercel.com](https://vercel.com)
2. 点击 "New Project"
3. 选择你的 Git 仓库
4. 选择 `frontend` 作为根目录
5. 点击 "Deploy"
### 3. 配置环境变量
在 Vercel 项目设置中添加以下环境变量:
```
VITE_GOOGLE_API_KEY=你的_Google_AI_API_密钥
VITE_APP_BASE_API=你的_API_地址
VITE_STRIPE_PUBLISHABLE_KEY=你的_Stripe_公钥
NODE_ENV=production
```
## 重要文件说明
- `vercel.json` - Vercel 部署配置文件
- `vite.config.js` - 优化的 Vite 配置(包含 Vercel 特定设置)
- `.env.example` - 环境变量示例
- `docs/vercel-deployment-guide.md` - 完整部署指南
- `docs/environment-setup.md` - 环境变量详细说明
## 立即部署
想要现在就开始?运行以下命令:
```bash
# 安装 Vercel CLI
npm i -g vercel
# 登录并部署
vercel login
cd frontend
vercel --prod
```
## 更多详情
查看 [完整部署指南](docs/vercel-deployment-guide.md) 获取详细的部署说明和故障排除指南。