From 25857abf26607d47575790aa92fc320c5a6e38fb Mon Sep 17 00:00:00 2001 From: Yaosanqi137 Date: Sun, 5 Apr 2026 14:57:27 +0800 Subject: [PATCH] docs(web): localize web README to Chinese --- apps/web/README.md | 108 +++++++++++++++++++-------------------------- 1 file changed, 46 insertions(+), 62 deletions(-) diff --git a/apps/web/README.md b/apps/web/README.md index 2b4caa6..15e3b1d 100644 --- a/apps/web/README.md +++ b/apps/web/README.md @@ -1,73 +1,57 @@ -# React + TypeScript + Vite +# TodoList Web 前端 -This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. +这是 TodoList 的用户端前端应用(SPA + PWA),基于 `React + TypeScript + Vite`。 -Currently, two official plugins are available: +## 技术栈 -- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react) uses [Oxc](https://oxc.rs) -- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react-swc) uses [SWC](https://swc.rs/) +- React +- TypeScript +- Vite +- Tailwind CSS +- shadcn/ui -## React Compiler +## 本地开发 -The React Compiler is not enabled on this template because of its impact on dev & build performances. To add it, see [this documentation](https://react.dev/learn/react-compiler/installation). +在仓库根目录执行: -## Expanding the ESLint configuration - -If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules: - -```js -export default defineConfig([ - globalIgnores(["dist"]), - { - files: ["**/*.{ts,tsx}"], - extends: [ - // Other configs... - - // Remove tseslint.configs.recommended and replace with this - tseslint.configs.recommendedTypeChecked, - // Alternatively, use this for stricter rules - tseslint.configs.strictTypeChecked, - // Optionally, add this for stylistic rules - tseslint.configs.stylisticTypeChecked - - // Other configs... - ], - languageOptions: { - parserOptions: { - project: ["./tsconfig.node.json", "./tsconfig.app.json"], - tsconfigRootDir: import.meta.dirname - } - // other options... - } - } -]); +```bash +pnpm install +pnpm --filter web dev ``` -You can also install [eslint-plugin-react-x](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-x) and [eslint-plugin-react-dom](https://github.com/Rel1cx/eslint-react/tree/main/packages/plugins/eslint-plugin-react-dom) for React-specific lint rules: +默认开发地址: -```js -// eslint.config.js -import reactX from "eslint-plugin-react-x"; -import reactDom from "eslint-plugin-react-dom"; +- `http://localhost:5173` -export default defineConfig([ - globalIgnores(["dist"]), - { - files: ["**/*.{ts,tsx}"], - extends: [ - // Other configs... - // Enable lint rules for React - reactX.configs["recommended-typescript"], - // Enable lint rules for React DOM - reactDom.configs.recommended - ], - languageOptions: { - parserOptions: { - project: ["./tsconfig.node.json", "./tsconfig.app.json"], - tsconfigRootDir: import.meta.dirname - } - // other options... - } - } -]); +## 后端接口地址 + +前端默认请求: + +- `http://localhost:3000` + +如需自定义,请在运行前设置环境变量: + +```bash +VITE_API_BASE_URL=http://localhost:3000 ``` + +## 构建与预览 + +```bash +pnpm --filter web build +pnpm --filter web preview +``` + +## 当前功能进度(阶段性) + +- 邮箱验证码登录页面 +- OAuth 回调页面 +- 会话本地缓存与启动恢复 +- 基础工作台页面骨架 + +## 目录说明 + +- `src/pages`:页面组件 +- `src/components`:通用 UI 组件 +- `src/services`:接口请求与会话处理 +- `src/lib`:工具函数