How azusark/vue-1-admin works
Project type and purpose
• This is a frontend-only, single-page administrative dashboard template built with Vue 3 and Vite.
• It provides a structure for routing, state management, API interaction (with optional mock servers), and component-based UI.
File structure
• Top-level files:
• .env.* – environment variables for dev/test/prod
• vite.config.ts – Vite build and dev server configuration
• tsconfig*.json – TypeScript config
• Public folder: static assets served as-is
• Mock folder: mock/user.ts simulates backend responses
• src: the heart of the app
• main.ts – bootstraps Vue and injects router/store
• App.vue – root component
• router/ – Vue Router definitions (routes.ts, index.ts)
• store/ – Vuex modules (user.ts)
• api/ – request utility and typed API modules (user)
• views/ – route-level pages (login, home, 404)
• assets/styles – global CSS/SCSS and images
• utils/request.ts – wraps fetch/axios for API calls
README for additional insights
• Confirms Vue 3 + Vite stack, Volar for TS support, build & dev tasks.
a. Main components
• Browser / End-User Interface
• Vite Dev Server (dev mode) / Vite Build Pipeline (prod)
• Vue 3 Application
– Router (vue-router)
– Store (vuex)
– Component Hierarchy (App.vue → Views → Components)
– API Layer (utils/request.ts + src/api modules)
• Static Assets (public/, src/assets/)
• Mock Server (mock/user.ts) or Real Backend Service
• Environment Configuration (.env files)
b. Relationships & Data Flow
1. User interacts with UI components in the Browser.
2. Vue Router matches URL → renders corresponding View.
3. Views dispatch actions to Vuex Store or call API services.
4. API Layer uses request util → hits mock.ts or actual backend.
5. Store updates state → triggers component re-render.
6. Vite Dev Server serves files, injects HMR; Production build bundles assets.
c. Architectural patterns & principles
• Component-based decomposition (separate reusable UI pieces).
• MVVM-style data flow: View ↔ Store (state) & Service (actions).
• Unidirectional data flow: Actions → Mutations → State → UI.
• Separation of concerns: routing, state, API, UI all in distinct folders.
• Environment-based configuration via .env.* loaded by Vite.
d. Key technologies
• Vue 3 (Composition API, Single-File Components)
• Vite (ESM dev server, Rollup-based bundler)
• Vue Router, Vuex
• TypeScript + vue-tsc
• SCSS for styling, static asset pipeline
• Optional Mock Service layer