| Script | Command | Purpose |
|---|---|---|
dev |
vite |
Dev server with HMR, proxies /api → http://localhost:8080 (strips prefix) |
build |
vue-tsc -b && vite build |
Type-check (project references mode) then production build |
preview |
vite preview |
Preview production build locally |
api:gen |
orval |
Generate API client + models from http://localhost:8080/v3/api-docs |
Build order matters: npm run build runs vue-tsc -b before vite build. After changes, always run npm run build (not just vue-tsc).
<script setup> SFCs, Vite 6, TypeScript 5.8, Element Plus 2, Pinia 3, Vue Router 4UserLayout (public, horizontal nav), AdminLayout (sidebar + header)meta.requiresAdmin → must be logged in + role admin, else redirectlocalStorage key token; Pinia useLoginUserStore persists via pinia-plugin-persistedstate@ → ./src/*npm run api:gen fetches OpenAPI spec from live backend at localhost:8080, writes to src/api/auth-controller.ts, user-controller.ts) use customAxiosInstance from src/util/axios-instance.ts/login redirectsrc/api/models/ — re-exported via index.tsapi:gen when backend API changes. orval is a runtime dep (unconventional but works).src/api/ controllers or models as needed.#e34889 — set as CSS variable --el-color-primary and Element Plus primary color. Apply consistently across all components.api:gennpx prettier --write <file>tsconfig.app.json: strict: true, noUnusedLocals: true, noUnusedParameters: true@/ imports over relative paths/admin/other route has component: AdminLayout (self-referencing stub — avoid using).env files; base URL defaults to /api (Vite proxy). Override via VITE_API_BASE_URL env var