From c35c57d700cf7e63aba45f276d38e97a15bdb131 Mon Sep 17 00:00:00 2001 From: jiayx Date: Sun, 22 Jun 2025 19:39:18 -0400 Subject: [PATCH] update readme --- README.en.md | 106 +++++++++++++++-------------------------------- README.md | 112 +++++++++++++++++--------------------------------- package.json | 6 ++- wrangler.toml | 3 -- 4 files changed, 76 insertions(+), 151 deletions(-) diff --git a/README.en.md b/README.en.md index b53a517..98dfc21 100644 --- a/README.en.md +++ b/README.en.md @@ -6,9 +6,9 @@

If you find this project helpful, please consider giving it a ⭐️ Star ⭐️. Your support is greatly appreciated!

- + ZMAIL Logo - +

💌 Secure, Simple, Disposable Email Service

@@ -18,7 +18,7 @@ 💻 Development • 🔧 Tech Stack

- +
Cloudflare @@ -85,70 +85,38 @@ ZMAIL consists of two parts that need to be deployed separately, deploy the backend first, then the frontend: -### ⚙️ Backend Deployment +### ⚙️ Deployment Steps
-

2️⃣ Deploy Backend to Cloudflare Workers

-
- Deploy Backend to Cloudflare Workers +

Deploy to Cloudflare Workers

+
+ Deploy to Cloudflare
    -
  1. Click the "Deploy to Cloudflare Workers" button
  2. -
  3. Connect your GitHub account and select this repository
  4. -
  5. Configure build settings: +
  6. Click "Deploy to Cloudflare" button
  7. +
  8. Follow the instructions on the page
      -
    • Deploy command: yarn deploy
    • -
    • Advanced settings -> Root directory: /worker
    • +
    • Connect your GitHub account
    • +
    • Enter an application name
    • +
    • Enter a database name
  9. -
  10. Configure D1 database: -
      -
    • Create a D1 database (e.g., mail_db)
    • -
    • Bind it to your Worker (binding name: DB)
    • +
    • Advanced settings -> Build variables +
        +
      • VITE_API_BASE_URL: Your Worker API base URL (e.g., https://api.mdzz.uk)
      • +
      • VITE_EMAIL_DOMAIN: Your domain list, separated by ',' (e.g., mdzz.uk,zaunist.com)
    • -
    • Configure Email routing: -
        +
      • Click "Create and Deploy"
      • +
      • Configure Cloudflare Email routing +
        • Set up Email routing in the Cloudflare dashboard to forward emails to your Worker
        • If you want to configure multiple domain emails, set up email forwarding for each domain to the worker in the CloudFlare dashboard
        • -
        +
    • -
    • Click "Deploy"
    • -
-
- ---- - -### 🖥️ Frontend Deployment - -
-

1️⃣ Deploy Frontend to Cloudflare Pages

- - Deploy Frontend to Cloudflare Pages - -
- -
-
    -
  1. Click the "Deploy to Cloudflare Pages" button
  2. -
  3. Connect your GitHub account and select this repository
  4. -
  5. Configure build settings: -
      -
    • Build command: yarn build
    • -
    • Build output directory: dist
    • -
    • Root directory (Advanced) -> Path: frontend
    • -
    -
  6. -
  7. Configure environment variables: -
      -
    • VITE_API_BASE_URL: Your Worker API base URL (e.g., https://api.mdzz.uk)
    • -
    • VITE_EMAIL_DOMAIN: Your domain list, separated by ',' (e.g., mdzz.uk,zaunist.com)
    • -
    -
  8. -
  9. Click "Save and Deploy"
@@ -156,39 +124,33 @@ ZMAIL consists of two parts that need to be deployed separately, deploy the back ## 💻 Local Development -### 🎨 Frontend Development +### 🚀 Development
```bash -# Navigate to frontend directory -cd frontend +# install dependencies +pnpm install -# Install dependencies -yarn install +# start frontend development server +pnpm dev:frontend -# Start development server -yarn dev +# start backend development server +pnpm dev:backend ```
-### ⚙️ Worker Development +### ⚙️ Deployment
```bash -# Navigate to worker directory -cd worker +# frontend build +pnpm build:frontend -# Install dependencies -yarn install - -# Build preview -yarn build - -# Deploy to Cloudflare -yarn deploy +# deploy +pnpm run deploy ```
@@ -228,7 +190,7 @@ Contributions via Pull Requests or Issues are welcome!

If this project has been helpful to you, or if you like it, please give it a Star ⭐️

Your support motivates me to make continuous improvements!

- + GitHub stars @@ -236,4 +198,4 @@ Contributions via Pull Requests or Issues are welcome! ## 📄 License -[MIT License](./LICENSE) \ No newline at end of file +[MIT License](./LICENSE) diff --git a/README.md b/README.md index 3dd0ade..0db0c84 100644 --- a/README.md +++ b/README.md @@ -6,9 +6,9 @@

如果这个项目对您有帮助,请考虑给它一个 ⭐️ Star ⭐️,这将是对我最大的鼓励!

- + ZMAIL Logo - +

💌 安全、简单、即用即走的临时邮箱服务

@@ -18,7 +18,7 @@ 💻 本地开发 • 🔧 技术栈

- +
Cloudflare @@ -83,111 +83,75 @@ ## 🚀 快速部署 -ZMAIL 由前端和后端两部分组成,需要先部署后端,然后再部署前端: +ZMAIL 由前端和后端两部分组成,支持快速部署到 Cloudflare Workers -### ⚙️ 后端部署步骤 +### ⚙️ 部署步骤
-

2️⃣ 部署后端到 Cloudflare Workers

-
- Deploy Backend to Cloudflare Workers +

部署到 Cloudflare Workers

+
+ Deploy to Cloudflare
    -
  1. 点击"部署后端到 Cloudflare Workers"按钮
  2. -
  3. 连接您的GitHub账户并选择导入此仓库
  4. -
  5. 设置构建配置: +
  6. 点击 "Deploy to Cloudflare" 按钮
  7. +
  8. 按照页面提示
      -
    • 部署命令: yarn deploy
    • -
    • 高级设置 -> 根目录: /worker
    • +
    • 连接您的 GitHub 账户
    • +
    • 填写一个应用名称
    • +
    • 填写数据库名称
  9. -
  10. 配置D1数据库: -
      -
    • 创建一个D1数据库 (例如: mail_db)
    • -
    • 将其绑定到您的Worker (绑定名称: DB)
    • +
    • 高级设置 -> 构建变量 +
        +
      • VITE_API_BASE_URL: 您的 Worker API 基础 URL (例如: https://api.mdzz.uk)
      • +
      • VITE_EMAIL_DOMAIN: 您的域名列表,使用 ',' 分割 (例如: mdzz.uk,zaunist.com)
    • -
    • 配置Email路由: -
        -
      • 在Cloudflare控制面板中设置Email路由,将邮件转发到您的Worker
      • -
      • 如果你想配置多个域名邮箱,那么就在CloudFlare后台将每一个域名都设置邮件转发到上述 worker 中
      • -
      +
    • 点击"创建和部署"
    • +
    • 配置 Cloudflare Email 路由 +
        +
      • 在 Cloudflare 控制面板中设置 Email 路由,将邮件转发到您的 Worker
      • +
      • 如果你想配置多个域名邮箱,那么就在 CloudFlare 后台将每一个域名都设置邮件转发到上述 worker 中
      • +
    • -
    • 点击"部署"
--- -### 🖥️ 前端部署步骤 - -
-

1️⃣ 部署前端到 Cloudflare Pages

- - Deploy Frontend to Cloudflare Pages - -
- -
-
    -
  1. 点击"部署前端到 Cloudflare Pages"按钮
  2. -
  3. 连接您的GitHub账户并选择导入此仓库
  4. -
  5. 设置构建配置: -
      -
    • 构建命令: yarn build
    • -
    • 构建输出目录: dist
    • -
    • 根目录(高级)-> 路径: frontend
    • -
    -
  6. -
  7. 配置环境变量: -
      -
    • VITE_API_BASE_URL: 您的Worker API基础URL (例如: https://api.mdzz.uk)
    • -
    • VITE_EMAIL_DOMAIN: 您的域名列表,使用','分割 (例如: mdzz.uk,zaunist.com)
    • -
    -
  8. -
  9. 点击"保存并部署"
  10. -
-
- ## 💻 本地开发 -### 🎨 前端开发 +### 🚀 开发
```bash -# 进入前端目录 -cd frontend - # 安装依赖 -yarn install +pnpm install -# 启动开发服务器 -yarn dev +# 启动前端开发服务器 +pnpm dev:frontend + +# 启动后端开发服务器 +pnpm dev:backend ```
-### ⚙️ Worker开发 +### ⚙️ 部署
```bash -# 进入worker目录 -cd worker +# 前端构建 +pnpm build:frontend -# 安装依赖 -yarn install - -# 构建预览 -yarn build - -# 部署到 cloudflare -yarn deploy +# 部署 +pnpm run deploy ```
@@ -227,11 +191,11 @@ yarn deploy

如果您觉得这个项目对您有所帮助,或者您喜欢这个项目,请给它一个 Star ⭐️

您的支持是我持续改进的动力!

- + GitHub stars - +

Buy Me A Coke @@ -241,4 +205,4 @@ yarn deploy ## 📄 许可证 -[MIT License](./LICENSE) \ No newline at end of file +[MIT License](./LICENSE) diff --git a/package.json b/package.json index 95debb5..d009f1c 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,10 @@ "version": "1.0.0", "description": "", "scripts": { - "build": "pnpm --filter frontend run build", - "dev": "wrangler dev", + "dev:frontend": "pnpm --filter frontend run dev", + "dev:backend": "wrangler dev", + "build:frontend": "pnpm --filter frontend run build", + "build:backend": "wrangler deploy --dry-run --outdir dist", "deploy": "wrangler deploy" }, "keywords": [], diff --git a/wrangler.toml b/wrangler.toml index 65b9f0c..ce23508 100644 --- a/wrangler.toml +++ b/wrangler.toml @@ -16,9 +16,6 @@ database_id = "987e6b1a-946a-4cba-84fc-23c4c31d72d6" # 需要替换为您的实 [triggers] crons = ["0 * * * *"] # 每小时运行一次清理任务 -[build] -command = "pnpm run build" - [assets] binding = "ASSETS" directory = "frontend/dist"