How archttp/cfzhv3.0_public_admin works
Project Type and Purpose
• This is a single-page frontend admin dashboard built with Vue 3 and Arco Design. It provides the UI for managing:
• Smart city parking
• EV charging (cars and two-wheelers)
• Property management (face access control, visits, payments)
• The repo contains only the frontend code—API modules under src/api call out to your backend microservices/REST endpoints.
File Structure Analysis
• Top-level:
• config/ & vite.config.* – Vite build and plugin configurations
• src/ – Application source
– api/ – HTTP request modules
– components/, layout/, views/ – Vue components & pages
– router/ – Vue Router definitions and guards
– store/ – Vuex modules
– hooks/, utils/ – reusable composables and helpers
– assets/, locale/, mock/ – static assets, i18n, mock data
• Build scripts: babel.config.js, vite.config.*
• Env configs: .env.development, .env.production
Key README Insights
• Uses Arco Design component library
• Heavy use of charts (echarts via src/types/echarts.ts and src/components/chart)
• Mock folder indicates development fallback when backend is unavailable
• Deployment is static frontend; needs to connect to self-hosted backend services
a. Main Components
• Browser (client)
• Vue App (SPA)
– Router
– Vuex Store
– UI Components & Pages
– API Service Layer
• Build & Deployment Pipeline (Vite → static assets → CDN/Server)
• External Backend Services (Authentication, Parking API, EV Charging API, Property Management API)
• Third-Party Libraries (Arco Design, echarts, etc.)
b. Relationships & Data Flow
1. Developer triggers “vite build” → produces static JS/CSS assets.
2. Static assets are served (via CDN or web server) to the Browser.
3. In the Browser:
– Vue Router detects URL → loads corresponding Page component.
– Page/component dispatches Vuex actions or calls API modules (src/api/*.ts).
– API module makes HTTP requests to backend services.
– Responses update Vuex store or resolve inside component.
– UI components re-render with fresh data.
4. Mock server kicks in if mock mode is enabled.
c. Architectural Patterns & Principles
• Modular folder structure (feature by folder under views/api/store)
• Separation of concerns:
– “views” handle page layout
– “components” are reusable UI blocks
– “api” layers abstract HTTP calls
– “store” for app state
– “router” for navigation
• Composables (src/hooks) for cross-cutting logic (loading, theming, locale)
• Configuration-driven routes (router/routes)
d. Key Technologies & Libraries
• Vue 3 + Composition API
• Vuex for state management
• Vue Router for navigation
• Vite for bundling and dev server
• Arco Design Vue UI components
• ECharts for data visualization
• Axios or fetch (inside src/api/interceptor.ts)
• i18n via locale files under src/locale and view-level locale folders