一个基于React + Node.js的腾讯云EdgeOne多租户管理平台,支持多账户管理、域名管理、SSL证书管理等功能。
edgeone-platform/ ├── backend/ # 后端服务 │ ├── src/ │ │ ├── controllers/ # 控制器 │ │ ├── middleware/ # 中间件 │ │ ├── routes/ # 路由 │ │ ├── services/ # 服务层 │ │ ├── utils/ # 工具函数 │ │ └── app.ts # 应用入口 │ ├── prisma/ # 数据库模型 │ └── package.json ├── frontend/ # 前端应用 │ └── edgeone-frontend/ │ ├── src/ │ │ ├── components/ # 组件 │ │ ├── pages/ # 页面 │ │ ├── contexts/ # 上下文 │ │ ├── services/ # 服务 │ │ └── App.tsx # 应用入口 │ └── package.json └── README.md
git clone <repository-url>
cd edgeone-platform
cd backend
# 安装依赖
npm install
# 配置环境变量
cp .env.example .env
# 编辑 .env 文件,填入必要的配置
# 初始化数据库
npx prisma migrate dev
npx prisma generate
# 启动开发服务器
npm run dev
cd frontend/edgeone-frontend
# 安装依赖
npm install
# 启动开发服务器
npm run dev
# 数据库 DATABASE_URL="file:./dev.db" # JWT配置 JWT_SECRET="your-jwt-secret-key" JWT_EXPIRES_IN="7d" # 加密密钥 ENCRYPTION_KEY="your-32-byte-hex-encryption-key" # 服务器配置 PORT=3000 NODE_ENV="development"
# API服务器地址 VITE_API_URL=http://localhost:3000/api # 应用配置 VITE_APP_NAME=EdgeOne管理平台 VITE_APP_VERSION=1.0.0
POST /api/auth/login - 用户登录POST /api/auth/register - 用户注册POST /api/auth/refresh - 刷新令牌GET /api/accounts - 获取账户列表POST /api/accounts - 创建账户PUT /api/accounts/:id - 更新账户DELETE /api/accounts/:id - 删除账户POST /api/accounts/:id/test - 测试连接POST /api/accounts/:id/sync - 同步数据GET /api/sites - 获取站点列表GET /api/sites/:id - 获取站点详情POST /api/sites/:id/sync - 同步站点GET /api/certificates - 获取证书列表POST /api/certificates/:id/renew - 续期证书构建前端
cd frontend/edgeone-frontend
npm run build
构建后端
cd backend
npm run build
配置生产环境变量
启动服务
npm start
# 构建镜像
docker build -t edgeone-platform .
# 运行容器
docker run -p 3000:3000 -p 5173:5173 edgeone-platform
git checkout -b feature/AmazingFeature)git commit -m 'Add some AmazingFeature')git push origin feature/AmazingFeature)本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情。
如有问题或建议,请通过以下方式联系:
© 2024 EdgeOne管理平台. 保留所有权利.