Architecture
v2 makes directory boundaries explicit so contributors and coding agents do not have to guess where code belongs.
Layers
text
views -> components / composables -> api modules / services -> transport / types
main -> plugins / router / store
build -> Vite pluginssrc/api/client.tsowns Axios, interceptors, response unwrapping, andApiErroronly.src/api/modulesdeclares domain endpoints without Toast, Router, or component behavior.src/servicescontains framework-independent providers, protocol parsers, and adapters.src/composablesorchestrates Vue reactivity and lifecycle.src/storecontains client state only; TanStack Query owns server state.src/viewsis the route composition layer; non-core pages are lazy-loaded.
Router Decision
The project keeps an explicit router table. At the current scale, RouteRecordRaw is easier to review for permissions, layouts, titles, KeepAlive, and bundle boundaries. The old vite-plugin-pages integration was not restored. If page count eventually justifies file conventions, evaluate unplugin-vue-router as a complete typed-routes, meta, layout, and migration-testing change.
Build
Vite 8 uses Rolldown. VITE_UI_FRAMEWORK selects one UI resolver and demo alias. AI Chat, Query examples, and secondary pages use dynamic imports. SVG sprites are always available; Sharp/SVGO, PWA, gzip, and bundle reports are feature flags.
Protected Constraints
- The request layer does not import UI or Router.
- The Service Worker does not cache APIs by default.
- Three UI libraries never enter the same production graph.
- AI and Markdown output is sanitized.
- pnpm is the only package manager.