diff --git a/apps/docs/content/configuration.mdx b/apps/docs/content/configuration.mdx new file mode 100644 index 0000000..44fc3e9 --- /dev/null +++ b/apps/docs/content/configuration.mdx @@ -0,0 +1,17 @@ +--- +title: 配置参考 +description: 环境变量与构建相关简短说明 +--- + +# 配置参考 + +## 模板应用(`apps/basic`、`apps/with-lingui`) + +- 使用 **Vite+**(`vp`)管理依赖与开发/构建;具体脚本见各目录 `package.json`。 +- **MSW** 在开发环境拦截 API;worker 目录由各应用 `package.json` 的 `msw.workerDirectory` 配置。 +- 更完整的栈说明、目录树与测试命令见对应应用的 **README**(仓库内 `apps/basic/README.md`、`apps/with-lingui/README.md`)。 + +## 文档站(`apps/docs`) + +- **Next.js + Nextra**,无首期 `basePath`;生产构建:`pnpm run build`。 +- 本地开发端口 **3000**,见 [apps/docs README](https://github.com/zuiidea/antd-admin/blob/master/apps/docs/README.md) 与设计说明 `docs/specs/2026-04-15-apps-docs-nextra-design.md`(若存在于仓库中)。 diff --git a/apps/docs/content/features.mdx b/apps/docs/content/features.mdx new file mode 100644 index 0000000..1a602a5 --- /dev/null +++ b/apps/docs/content/features.mdx @@ -0,0 +1,22 @@ +--- +title: 功能与约定 +description: 能力概览并指向各应用 README 与源码 +--- + +# 功能与约定 + +本 monorepo 在 **`apps/basic`** 与 **`apps/with-lingui`** 中提供同一套产品能力(JWT、动态菜单与 RBAC、表格 URL 状态、MSW、Playwright 等)。差异主要在 **国际化与包名**,详见 [模板对比](/templates)。 + +## 进一步阅读 + +- **Basic 应用说明:** [apps/basic/README.md](https://github.com/zuiidea/antd-admin/blob/master/apps/basic/README.md) +- **Lingui 变体说明:** [apps/with-lingui/README.md](https://github.com/zuiidea/antd-admin/blob/master/apps/with-lingui/README.md) +- **通用 AI 指引(Vite+):** 各应用目录下的 `AGENTS.md` + +## 源码入口(便于跳转) + +| 主题 | 路径(两应用结构类似) | +|------|-------------------------| +| 根路由与 Ant Design 包裹 | `src/routes/__root.tsx` | +| 持久化 Store 工厂 | `src/stores/createPersistentStore.ts` | +| 设置与主题 | `src/stores/settings.ts` | diff --git a/apps/docs/content/index.mdx b/apps/docs/content/index.mdx new file mode 100644 index 0000000..d59e853 --- /dev/null +++ b/apps/docs/content/index.mdx @@ -0,0 +1,8 @@ +--- +title: 概述 +description: antd-admin monorepo 与模板说明 +--- + +# 概述 + +本仓库提供两个可运行模板:**`apps/basic`**(英文-only)与 **`apps/with-lingui`**(Lingui 中英文)。详细对比见「模板对比」。 diff --git a/apps/docs/content/quick-start.mdx b/apps/docs/content/quick-start.mdx new file mode 100644 index 0000000..58bba7d --- /dev/null +++ b/apps/docs/content/quick-start.mdx @@ -0,0 +1,40 @@ +--- +title: 快速开始 +description: 环境要求、安装与本地运行(文档站与模板端口) +--- + +# 快速开始 + +## 环境要求 + +- [Node.js](https://nodejs.org) **≥ 20** +- [Vite+](https://viteplus.dev/guide/) 全局 CLI:`vp` + +## 运行模板应用(Vite+) + +在仓库中任选其一: + +```bash +cd apps/basic && vp install && vp dev +# 或 +cd apps/with-lingui && vp install && vp dev +``` + +开发服务器默认地址为 **[http://localhost:5173](http://localhost:5173)**(与下方文档站 **3000** 端口不同,请勿混淆)。 + +**默认登录账号:** `admin` / `admin` + +## 运行文档站(Nextra / Next.js) + +文档站位于 `apps/docs`,使用 **Next.js**,端口 **3000**: + +```bash +cd apps/docs && pnpm install && pnpm dev +``` + +浏览器打开 [http://localhost:3000](http://localhost:3000)。 + +| 项目 | 目录 | 开发命令 | 默认端口 | +|------|------|----------|----------| +| 模板应用 | `apps/basic` 或 `apps/with-lingui` | `vp dev` | **5173** | +| 中文文档 | `apps/docs` | `pnpm dev` | **3000** | diff --git a/apps/docs/content/templates.mdx b/apps/docs/content/templates.mdx new file mode 100644 index 0000000..43e157e --- /dev/null +++ b/apps/docs/content/templates.mdx @@ -0,0 +1,20 @@ +--- +title: 模板对比 +description: basic 与 with-lingui 的包名、国际化与持久化键对比 +--- + +# 模板对比 + +以下字段以仓库内 **`package.json`** 与 **`src/stores/settings.ts`** 为准。 + +| 项目 | `apps/basic` | `apps/with-lingui` | +|------|----------------|---------------------| +| **package.json `name`** | `antd-admin-basic` | `antd-admin` | +| **Lingui(i18n)** | 无(英文界面) | 有(`@lingui/core`、`@lingui/react`,en / zh) | +| **Ant Design `ConfigProvider` locale** | 固定 `antd/locale/en_US` | 随设置切换:`en` → `en_US`,`zh` → `zh_CN`(见 `src/routes/__root.tsx`) | +| **Zustand persist(settings)`name`** | `settings-storage-basic` | `settings-storage` | + +选型建议: + +- 只要英文、希望依赖最少:选 **`apps/basic`**。 +- 需要中英文切换、Lingui 工作流与 Ant Design 随语言联动:选 **`apps/with-lingui`**。