From 29b0f03c24f3bb51c7bd76910020e1de089d0ef8 Mon Sep 17 00:00:00 2001 From: jocay <1579649885@qq.com> Date: Mon, 17 Aug 2026 23:57:43 +0800 Subject: [PATCH] update --- AGENTS.md | 28 +++ CLAUDE.md | 22 +- scripts/import-sets.js | 6 +- scripts/verify-questions.js | 36 ++- server.js | 326 +++++++++++++++++++++----- vite.config.js | 2 +- web/src/api.js | 29 ++- web/src/htmlUtil.mjs | 6 +- web/src/styles/theme.css | 19 +- web/src/views/AdminView.vue | 439 +++++++++++++++++++++++++++++------- web/src/views/QuizView.vue | 428 +++++++++++++++++++++++++++-------- 11 files changed, 1085 insertions(+), 256 deletions(-) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..6a28e8b --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,28 @@ +# Repository Guidelines + +## Project Structure & Module Organization + +This is a Vue 3 and Express quiz application about Dart and Flutter; it is not a Flutter SDK project. The Express API and production static server live in `server.js`. The Vue client is under `web/`: views belong in `web/src/views/`, shared browser utilities in `web/src/`, and global styles in `web/src/styles/theme.css`. `questions.json` is the application database, while `scripts/data/` contains import sources and `scripts/` contains maintenance utilities. Vite writes production assets to the generated, ignored `dist/` directory. Root `index.html` is a legacy artifact; the active entry is `web/index.html`. + +## Build, Test, and Development Commands + +- `npm install` installs the pinned dependencies from `package-lock.json`. +- `npm run dev` starts Express and Vite together; browse via Vite at `http://localhost:5173`. +- `npm run build` bundles `web/` into `dist/`. +- `npm start` serves the built client and API on `PORT` (default `3031`). +- `node scripts/verify-questions.js` validates question fields, answer indexes, explanations, and difficulty values. +- `node scripts/fix-escaping.js` normalizes stored HTML escaping in place; restart the server afterward. + +Keep `vite.config.js`'s `/api` proxy aligned with the Express `PORT` when changing local ports. + +## Coding Style & Naming Conventions + +Use two-space indentation. Follow existing JavaScript style: CommonJS in `server.js` and `scripts/`, ES modules and Vue `