From c97304b7866361a6796ccda6668e236dba5a8227 Mon Sep 17 00:00:00 2001 From: XingfenD Date: Tue, 11 Aug 2026 10:56:47 +0800 Subject: [PATCH] update README and AGENTS.md --- AGENTS.md | 48 +++++++++++ README.md | 5 -- docs/README.md | 198 ++++++++++++++++++++++++++++++++++++++++++++++ docs/README_zh.md | 198 ++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 444 insertions(+), 5 deletions(-) create mode 100644 AGENTS.md delete mode 100644 README.md create mode 100644 docs/README.md create mode 100644 docs/README_zh.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..3dcf016 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,48 @@ +# AGENTS.md + +## Commands + +- `npm run dev` — start Vite dev server (port 80 in Docker) +- `npm run build` — production build to `dist/` +- `npm run preview` — preview production build + +No test, lint, typecheck, or formatter scripts are configured. + +## Architecture + +Single-page Vue 3 app (JavaScript, no TypeScript). UI library is Element Plus, state via Pinia, routing via vue-router, i18n via vue-i18n (en-US, zh-CN). + +### Path alias + +`@` maps to `src/`. All internal imports use this alias. + +### gRPC-Web API layer + +Backend communication uses ConnectRPC (gRPC-Web). Generated protobuf code lives in `src/gen/` — **gitignored**, produced at build time by `protoc` from `proto/yoresee_doc/v1/yoresee_doc.proto` (sibling repo directory). The production Dockerfile runs codegen before `npm run build`. + +- `src/services/grpc_client.js` — transport, client instances, `unaryCall` wrapper, `messages` re-export +- `src/services/api/*.js` — domain API functions that wrap `unaryCall` with protobuf request/response mappers +- `src/services/api/shared.js` — common helpers (`unaryCall`, `messages`, mappers like `mapDocument`, `mapAttachment`) +- `src/config/baseUrl.js` — `API_BASE_URL` (from `VITE_API_BASE_URL` env or `window.location.origin`), `GRPC_WEB_ENDPOINT` (defaults to `/grpc`) + +### Key libraries + +- **Rich text editors**: TipTap (collaborative, Yjs-backed), EasyMDE (Markdown), Vditor, CodeMirror +- **Collaborative editing**: Yjs + y-websocket +- **Diff rendering**: `diff` + `diff2html` +- **Mind maps**: markmap-lib / markmap-view +- **Spreadsheets**: x-data-spreadsheet + +### Environment + +- `VITE_API_BASE_URL` — REST/gRPC base (default: `http://localhost:8080` via `.env`) +- `VITE_GRPC_WEB_ENDPOINT` — gRPC endpoint path (default: `/grpc`) +- Dark mode is the default; toggled via `localStorage` key `darkMode`/`theme` + +## Conventions + +- Components are Vue SFCs using `