Files
Alfred/docs/user/deploy.md
lanyuanxiaoyao 34071a421a refactor: 品牌重塑 my-app → Alfred·阿福
将项目从模板标识 my-app 全部替换为产品标识 Alfred·阿福,
去掉所有模板措辞,文档语态转为产品视角。

核心标识替换:
- name: my-app → alfred
- title: My App → Alfred·阿福
- subtitle: Bun 全栈应用 → 智能信息处理中枢
- description: 全栈开发框架 → 基于 AI 的信息综合处理平台
- 日志路径: my-app.log → alfred.log
- 构建产物: dist/my-app → dist/alfred(由 APP.name 自动适配)

文档更新:
- README.md 重写为产品介绍
- docs/README.md 去掉模板段落
- docs/user/ 从模板使用指南改为产品手册
- docs/development/ 标识替换 + 去模板措辞
- openspec/config.yaml 去模板项目描述
- LICENSE 填入 Copyright 2025 lanyuanxiaoyao
2026-05-27 09:38:57 +08:00

55 lines
1.7 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.
# 生产部署
本文档说明如何构建和运行生产环境的应用。
## 生产构建和运行
```bash
bun run build
./dist/alfred config.yaml
```
启动后:
| 地址 | 行为 |
| ------------------------------ | ------------------- |
| http://127.0.0.1:3000/ | 返回前端 SPA |
| http://127.0.0.1:3000/api/meta | 返回应用元信息 JSON |
| http://127.0.0.1:3000/health | 返回健康检查 |
## 构建流程
scripts/build.ts 执行三步流水线:
```text
1. Vite build -> dist/web/(前端静态资源,含 code splitting
2. Code generation -> .build/static-assets.ts + .build/server-entry.ts含版本号字面量注入
3. Bun compile -> dist/alfred单可执行文件
```
- Vite 构建前端资源到 dist/web/,自动 code splittingvendor-react、vendor-tdesign、vendor-chart
- Code generation 扫描 dist/web/ 生成 import with { type: "file" } 声明,将资源嵌入 binary
- Bun compile 以 .build/server-entry.ts 为入口编译最终可执行文件
- .build/ 临时目录在构建完成后自动清理
## 产物
| 产物 | 用途 |
| ----------- | ---------------------------------------- |
| dist/alfred | 生产可执行文件(含前端资源,单文件部署) |
| dist/web/ | Vite 构建的前端资源(构建中间产物) |
## 构建参数
| 环境变量 | 说明 |
| ------------------------- | ------------------------------------ |
| BUN_TARGET / BUILD_TARGET | 交叉编译目标平台(如 bun-linux-x64 |
## 清理
```bash
bun run clean
```
清理 dist/ 构建产物和 .build/ 临时文件。