mirror of
https://github.com/zuiidea/antd-admin
synced 2026-10-23 08:23:54 +00:00
4dc473ba55635e73b642f7de71a3ac0aa58a7bd6
* refactor(api): introduce defineApi + axios request layer Replace ad-hoc fetch httpClient with api/request.ts (axios interceptors, envelope unwrap, auth refresh) and defineApi-based resource modules. Move session hydration into api/auth, sync both templates, and update docs. Co-authored-by: zuiidea <zuiiidea@gmail.com> * chore: unify Cursor rules, fix monorepo install hooks, refresh basic docs Add root preinstall to set githooks and disable parallel vp config git lock races; merge per-app Cursor thin rules into app.mdx; keep template READMEs free of monorepo-only paths and describe basic as default English rather than English-only. Co-authored-by: Cursor <cursoragent@cursor.com> * chore: add root turbo fmt and format app sources Expose fmt via turbo at the monorepo root, apply Oxfmt in basic/with-lingui, and run vp staged through pnpm exec in pre-commit so hooks work without a global vp. Co-authored-by: Cursor <cursoragent@cursor.com> * chore: drop root eslint/prettier and bump turbo to 2.11.9 Root formatting and lint stay on turbo fmt/lint via Vite+ in workspace apps. Co-authored-by: Cursor <cursoragent@cursor.com> * chore: consolidate agent guidance into AGENTS.md Merge scoped instructions into per-app AGENTS.md, add monorepo AGENTS.md and add-resource skill, and remove template .github Copilot files plus the Cursor app router rule. Co-authored-by: Cursor <cursoragent@cursor.com> * chore(basic): add add-resource skill and portable app-root paths Align basic with with-lingui for CRUD scaffolding via AGENTS.md and .agents/skills, and drop hardcoded monorepo paths in agent docs. Co-authored-by: Cursor <cursoragent@cursor.com> * refactor(api): split modules under shared/ with API_PREFIX Move auth and users into folder modules, centralize path constants, and align MSW with endpoint paths in both template apps. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: document modular API layer in README files Expand template READMEs with src/api layout, fix CLI table and E2E script references. Co-authored-by: Cursor <cursoragent@cursor.com> * docs: align site with modular src/api layout Document API_PREFIX, folder structure, templates, and E2E script usage in en/zh. Co-authored-by: Cursor <cursoragent@cursor.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: zuiidea <zuiidea@example.com>
Antd Admin
Introduction
Antd Admin provides production-style admin templates with modern frontend tooling, mock-first development, and practical testing coverage.
Available templates:
basic: Admin template with plain-string UI copy (default English; no bundled Lingui)with-lingui: Lingui i18n workflow (en+zh) with locale switching
Scaffolding CLI:
init-antd-admin(frompackages/create)
Key Features
- JWT login with access/refresh flow
- Backend-driven menu and permission guards
- URL-synced table state (pagination, sorting, search)
- Dark mode theme switching
- Mock-first local development (no backend required)
- Modular API layer (
defineApiper domain, Zod schemas, sharedAPI_PREFIX) - Typed API boundaries and reusable CRUD patterns
- React 19 + Ant Design 6 + TanStack Router/Query + Zustand + Zod
- Optional Lingui-based i18n workflow (
with-lingui) - E2E coverage with Playwright
Quick Start
Use init-antd-admin to scaffold a standalone app from official templates.
Interactive
npx init-antd-admin@latest
pnpm dlx init-antd-admin@latest
yarn dlx init-antd-admin@latest
bunx init-antd-admin@latest
Non-interactive examples
pnpm dlx init-antd-admin@latest my-app --example basic -m pnpm
pnpm dlx init-antd-admin@latest my-app --example with-lingui --skip-install
Common options
| Option | Description |
|---|---|
[project-directory] |
Target folder |
-e, --example <name|url> |
Template name (basic, with-lingui) or URL |
--example-path <path> |
Subpath inside remote repository |
-m, --package-manager <pm> |
npm / pnpm / yarn / bun |
--skip-install |
Skip dependency install |
--skip-transforms |
Skip rewrite transforms |
--no-git |
Skip git initialization |
For detailed CLI behavior, see [packages/create/README.md](./packages/create/README.md).
AI / agent guidance
Each template app keeps AGENTS.md as the single source of truth (Cursor, Claude Code, Codex, etc.). Monorepo overview: AGENTS.md at the repo root.
Production docs: https://antd-admin-doc.zuiidea.top
Links
License
MIT
Languages
TypeScript
82.4%
MDX
8.3%
JavaScript
5.6%
CSS
3.2%
HTML
0.3%
Other
0.2%