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
This commit is contained in:
2026-05-27 09:38:57 +08:00
parent 7ebf5ee5dc
commit 34071a421a
19 changed files with 61 additions and 87 deletions

16
LICENSE
View File

@@ -1,3 +1,19 @@
Copyright 2025 lanyuanxiaoyao
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
---
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/

View File

@@ -1,14 +1,10 @@
# my-app
# Alfred·阿福
(替换为你的项目介绍)
Bun 全栈应用模板,基于 Bun + React + TDesign 的前后端一体化开发框架。
基于 AI 的信息综合处理平台,融合多源信息、智能分析与一站式处理。
## 快速开始
```bash
git clone <your-repo-url> my-project
cd my-project
cp config.example.yaml config.yaml
bun install
bun run dev config.yaml
@@ -16,16 +12,12 @@ bun run dev config.yaml
访问 http://127.0.0.1:5173 查看应用。
## 使用此模板
从零创建新项目:[使用模板](docs/user/usage.md)
## 文档导航
| 文档 | 内容 |
| -------------------------------------- | ---------------------------------- |
| [docs/README.md](docs/README.md) | 文档总览、归属矩阵、影响分析规则 |
| [docs/user/](docs/user/) | 模板使用、配置、部署、故障排查 |
| [docs/user/](docs/user/) | 使用、配置、部署、故障排查 |
| [docs/development/](docs/development/) | 架构、后端、前端、构建发布开发规范 |
| [docs/prompts/](docs/prompts/) | AI 提示词资产(不属于常规文档流) |
@@ -41,4 +33,4 @@ bun run dev config.yaml
## 开源协议
MIT
Apache 2.0

View File

@@ -11,7 +11,7 @@ server:
level: "info"
file:
level: "info"
path: "./data/logs/my-app.log"
path: "./data/logs/alfred.log"
rotation:
size: "50MB"
frequency: "daily"

View File

@@ -1,6 +1,6 @@
# my-app 文档
# Alfred·阿福 文档
本文档是 my-app 的文档路由入口。AI 工具和开发者应先阅读本文件判断本次任务需要读取和更新哪些专题文档,再按任务类型读取最小必要上下文。
本文档是 Alfred·阿福 的文档路由入口。AI 工具和开发者应先阅读本文件判断本次任务需要读取和更新哪些专题文档,再按任务类型读取最小必要上下文。
## 目录索引
@@ -34,7 +34,7 @@ docs/
| --------------------------------- | -------------------------------------- |
| [项目 README](../README.md) | 项目整体介绍、快速开始、文档引导 |
| [开发文档](development/README.md) | 开发入口、全局规则、常用命令、质量门禁 |
| [用户文档](user/README.md) | 模板使用、配置、部署、排障入口 |
| [用户文档](user/README.md) | 使用、配置、部署、排障入口 |
## 按任务阅读路径
@@ -48,7 +48,7 @@ docs/
| 修改构建、脚本、发布 | [构建与发布](development/release.md)、[部署文档](user/deploy.md) |
| 修改配置 schema | [配置文件](user/config.md)、[后端开发](development/backend.md) |
| 修改文档规则或文档目录结构 | 本文档、[OpenSpec 配置](../openspec/config.yaml) |
| 使用模板创建新项目 | [使用模板](user/usage.md)、[配置文件](user/config.md) |
| 首次安装或配置 | [快速开始](user/usage.md)、[配置文件](user/config.md) |
| 排查运行或构建问题 | [故障排查](user/troubleshoot.md) |
## 文档归属矩阵
@@ -62,7 +62,7 @@ docs/
| 后端 API、配置加载、logger、helpers、类型规范、后端测试 | `docs/development/backend.md` |
| 前端技术栈、组件、样式、数据层、前端测试 | `docs/development/frontend.md` |
| 构建、发布、脚本、前后端静态资源集成 | `docs/development/release.md` |
| 使用模板、配置应用信息、清理 OpenSpec 历史 | `docs/user/usage.md` |
| 快速开始、安装配置 | `docs/user/usage.md` |
| YAML 配置、变量语法、server/storage/logging、JSON Schema | `docs/user/config.md` |
| 生产构建、可执行文件运行、运行时配置 | `docs/user/deploy.md` |
| 常见运行问题、配置校验、变量解析、构建失败 | `docs/user/troubleshoot.md` |
@@ -80,9 +80,9 @@ docs/
## user 文档如何更新
用户文档解释"如何使用"和"用户能观察到什么"。变更影响模板使用方式、配置、部署或运行行为时,必须更新 `docs/user/` 对应文档。
用户文档解释"如何使用"和"用户能观察到什么"。变更影响使用方式、配置、部署或运行行为时,必须更新 `docs/user/` 对应文档。
- 使用模板流程、应用信息配置、初始化步骤更新到 `docs/user/usage.md`
- 安装、配置、快速开始更新到 `docs/user/usage.md`
- 配置结构、变量语法、server/storage/logging 字段更新到 `docs/user/config.md`
- 生产构建、可执行文件运行、运行时依赖更新到 `docs/user/deploy.md`
- 常见错误和排查路径更新到 `docs/user/troubleshoot.md`

View File

@@ -1,6 +1,6 @@
# 开发文档
本文档是 my-app 的开发入口。AI 工具和开发者应先阅读 [`../README.md`](../README.md) 判断文档归属,再阅读本文和最小必要专题。
本文档是 alfred 的开发入口。AI 工具和开发者应先阅读 [`../README.md`](../README.md) 判断文档归属,再阅读本文和最小必要专题。
适用场景:修改源码、测试、构建脚本、开发流程、架构边界或项目工程规则。
@@ -59,7 +59,7 @@
- 后端优先使用 Bun 内置 API其次是 es-toolkit、标准 Web API、主流三方库最后才自行实现。
- 前端样式优先使用 TDesign 组件、组件 props、TDesign CSS tokens、styles.css CSS 类,最后才自行开发组件。
- 前端禁止组件内联 style、覆盖 TDesign 内部类名、使用 !important、硬编码色值。
- 当前项目为模板参考项目,不需要考虑向前兼容。
- 当前项目无需考虑向前兼容。
## 包管理、依赖与提交
@@ -78,7 +78,7 @@
| `src/shared/` | 前后端共享 TypeScript 类型 |
| `scripts/` | 独立运行脚本,可 import 项目源码 |
| `tests/` | 测试目录,结构镜像 src/ |
| `docs/user/` | 模板使用、配置、部署和排障文档 |
| `docs/user/` | 用户使用、配置、部署和排障文档 |
| `docs/development/` | 架构、后端、前端、发布开发文档 |
| `openspec/` | OpenSpec 变更管理与规格文档 |

View File

@@ -1,6 +1,6 @@
# 架构与边界
本文档说明 my-app 的项目结构、启动链路、运行时流程、HTTP 请求流程和前后端边界。
本文档说明 alfred 的项目结构、启动链路、运行时流程、HTTP 请求流程和前后端边界。
适用场景修改目录边界、启动流程、运行时调度、HTTP server、前后端集成方式或主要模块职责。

View File

@@ -1,6 +1,6 @@
# 后端开发
本文档说明 my-app 后端的 API、配置加载、日志、版本管理和后端测试开发约定。
本文档说明 alfred 后端的 API、配置加载、日志、版本管理和后端测试开发约定。
适用场景:修改 src/server/、src/shared/api.ts、后端测试、配置契约、API 响应或日志模块。

View File

@@ -1,6 +1,6 @@
# 前端开发
本文档说明 my-app 前端的 React、TDesign、TanStack Query、组件、样式和前端测试约定。
本文档说明 alfred 前端的 React、TDesign、TanStack Query、组件、样式和前端测试约定。
适用场景:修改 src/web/、前端共享类型使用方式、组件结构、样式规则或前端测试。

View File

@@ -43,7 +43,7 @@ bun run build
```text
1. Vite build -> dist/web/
2. Code generation -> .build/static-assets.ts + .build/server-entry.ts
3. Bun compile -> dist/my-app
3. Bun compile -> dist/alfred
```
构建参数:

View File

@@ -1,14 +1,14 @@
# 用户文档
本文档是 my-app 的用户使用入口,说明如何使用模板、配置、部署和排查问题。
本文档是 Alfred·阿福 的用户使用入口,说明如何安装、配置、部署和排查问题。
适用场景:使用本模板创建新项目、编写配置、生产部署、排查运行问题。
适用场景:首次安装、编写配置、生产部署、排查运行问题。
## 文档索引
| 文档 | 内容 |
| ---------------------------------- | ------------------------------------------- |
| [usage.md](usage.md) | 克隆模板、配置应用信息、准备配置、开始开发 |
| [usage.md](usage.md) | 快速开始、安装配置 |
| [config.md](config.md) | YAML 结构、变量语法、server/storage/logging |
| [deploy.md](deploy.md) | 生产构建、可执行文件运行、运行时配置 |
| [troubleshoot.md](troubleshoot.md) | 常见问题:配置校验、变量解析、构建失败 |
@@ -17,14 +17,14 @@
| 任务 | 建议阅读 |
| -------- | -------------------------------------------------------------- |
| 首次使用 | [项目快速开始](../../README.md#快速开始)、[使用模板](usage.md) |
| 首次使用 | [项目快速开始](../../README.md#快速开始)、[安装配置](usage.md) |
| 编写配置 | [配置文件](config.md) |
| 生产部署 | [部署](deploy.md)、[故障排查](troubleshoot.md) |
| 排查问题 | [故障排查](troubleshoot.md) |
## 用户文档更新规则
- 使用模板流程、应用信息配置、初始化步骤变化时,更新 [usage.md](usage.md)。
- 安装、配置、快速开始流程变化时,更新 [usage.md](usage.md)。
- 配置结构、变量语法、server/storage/logging 字段变化时,更新 [config.md](config.md)。
- 生产构建、可执行文件运行、运行时依赖变化时,更新 [deploy.md](deploy.md)。
- 常见错误、配置校验、构建失败排查方式变化时,更新 [troubleshoot.md](troubleshoot.md)。

View File

@@ -20,7 +20,7 @@ server:
level: info
file:
level: info
path: "./logs/my-app.log"
path: "./logs/alfred.log"
rotation:
size: 50MB
frequency: daily
@@ -57,7 +57,7 @@ server:
| 字段 | 类型 | 说明 |
| ----- | ------ | ----------------------------------------------- |
| level | string | 文件日志级别,未设置时继承 server.logging.level |
| path | string | 日志文件路径,默认 <dataDir>/logs/my-app.log |
| path | string | 日志文件路径,默认 <dataDir>/logs/alfred.log |
### server.logging.file.rotation

View File

@@ -6,7 +6,7 @@
```bash
bun run build
./dist/my-app config.yaml
./dist/alfred config.yaml
```
启动后:
@@ -24,7 +24,7 @@ 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/my-app(单可执行文件)
3. Bun compile -> dist/alfred(单可执行文件)
```
- Vite 构建前端资源到 dist/web/,自动 code splittingvendor-react、vendor-tdesign、vendor-chart
@@ -36,7 +36,7 @@ scripts/build.ts 执行三步流水线:
| 产物 | 用途 |
| ----------- | ---------------------------------------- |
| dist/my-app | 生产可执行文件(含前端资源,单文件部署) |
| dist/alfred | 生产可执行文件(含前端资源,单文件部署) |
| dist/web/ | Vite 构建的前端资源(构建中间产物) |
## 构建参数

View File

@@ -1,6 +1,6 @@
# 故障排查
本文档记录使用模板时的常见问题和排查入口。
本文档记录使用 Alfred·阿福时的常见问题和排查入口。
## 配置校验失败

View File

@@ -1,31 +1,14 @@
# 使用模板
# 快速开始
本文档说明如何使用本模板创建新项目
本文档说明如何安装和配置 Alfred·阿福
## 1. 克隆模板
## 1. 安装依赖
```bash
git clone <template-repo-url> my-project
cd my-project
rm -rf .git && git init
bun install
```
## 2. 配置应用信息
编辑 `src/shared/app.ts`,修改应用元信息:
```typescript
export const APP = {
name: "your-app", // 机器标识kebab-case
title: "Your App", // 人类可读标题
subtitle: "你的副标题", // 副标题
description: "应用描述", // SEO meta 描述
} as const;
```
同时修改 `package.json``name` 字段保持一致,`version` 字段管理应用版本号。
## 3. 准备配置文件
## 2. 准备配置文件
```bash
cp config.example.yaml config.yaml
@@ -33,24 +16,7 @@ cp config.example.yaml config.yaml
按需编辑 `config.yaml` 中的监听地址、日志、存储路径等配置。配置文件为启动时的必传参数。
## 4. 清理 OpenSpec 历史
删除模板自带的 OpenSpec 变更历史,保留框架配置:
```bash
rm -rf openspec/specs/*
rm -rf openspec/changes/*
```
`openspec/config.yaml``openspec/schemas/fast-drive/` 需要保留,其中包含项目开发规范配置与自定义 OpenSpec workflow schema。
## 5. 安装依赖
```bash
bun install
```
## 6. 开始开发
## 3. 启动开发模式
```bash
bun run dev config.yaml

View File

@@ -24,8 +24,8 @@ context: |
- 禁止创建git操作task
- 积极使用subagents精心设计并行任务节省上下文空间加速任务执行
- 优先使用提问工具对用户进行提问
- 本项目为 Bun 全栈应用模板docs/user/ 记录模板使用方法docs/development/ 记录模板开发技术细节
- 本项目为模板参考项目,帮助其他项目快速启动项目,因此开发本项目无需考虑兼容性问题
- 本项目为 Bun 全栈应用Alfred·阿福docs/user/ 记录用户使用方法docs/development/ 记录开发技术细节
- 本项目无需考虑向前兼容性
rules:
design:

View File

@@ -1,5 +1,5 @@
{
"name": "my-app",
"name": "alfred",
"version": "0.1.0",
"type": "module",
"private": true,

View File

@@ -1,6 +1,6 @@
export const APP = {
description: "基于 Bun + React + TDesign 的全栈开发框架",
name: "my-app",
subtitle: "Bun 全栈应用",
title: "My App",
description: "基于 AI 的信息综合处理平台",
name: "alfred",
subtitle: "智能信息处理中枢",
title: "Alfred·阿福",
} as const;

View File

@@ -4,7 +4,7 @@
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="description" content="" />
<title>App</title>
<title>Alfred·阿福</title>
</head>
<body>
<div id="root"></div>

View File

@@ -203,7 +203,7 @@ describe("loadServerConfig", () => {
test("绝对日志路径保持不变", async () => {
const temp = tmpdir();
const logPath = join(temp, "my-app.log");
const logPath = join(temp, "alfred.log");
const yamlPath = join(temp, "abs-log.yaml");
await writeFile(yamlPath, `server:\n logging:\n file:\n path: ${JSON.stringify(logPath)}\n`);