How yudaocode/yudao-ui-admin-vue3 works
Main Components
• Frontend Application (Client-Side UI): Based on Vue 3 with Vite, using Element Plus for UI components, unocss for styling, and TypeScript for type safety.
• Core Engine & Configuration:
– Entry point (main.ts) that bootstraps the app.
– Routing (vue-router) and state management (pinia) elements.
– Global configuration modules (e.g. axios configuration in src/config/axios and environment variables).
• Modules / Views for Business Domains:
– Large “views” directory containing sub-modules for AI, BPM, CRM, ERP, Mall, member, pay, system, mp, etc.
– Each module (e.g., src/views/system, src/views/ai, src/views/bpm) represents a business domain with its own components and pages.
• UI Components Library:
– A rich set of reusable components (in src/components) for dialogs, tables, charts (echarts), forms, editors, image viewers, and even complex components like form builders and process designers.
• Plugins and Directives:
– Additional functionality such as internationalization (vue-i18n), animations, permission directives, and route guards.
• Build & Configuration Infrastructure:
– Vite and pnpm based build scripts (files in build/ and vite.config.ts) for development and production builds.
– Prettier, ESLint, and style-related configurations ensure code quality.
• Assets & Public Resources:
Relationships & Interactions
• The App Initialization (main.ts) starts the application, loads configuration files, sets up plugins (e.g., axios service, vue-i18n), and registers global components.
• The Router (src/router) controls navigation between various business modules. Each module encapsulates its set of pages/views (located in src/views/*) and communicates with state management (src/store) via Pinia.
• API Interaction: Under src/api, many folders implement the API client layer that makes calls to back-end services for modules (e.g., ai, bpm, crm, erp, mall). These act as service definitions and abstractions to the backend, typically using Axios.
• Utility Modules (src/utils, src/hooks) support cross-cutting concerns such as permission management, date formatting, and reactive global events.
• The Build System and Configuration are responsible for bundling the application, optimizing code, and injecting environment-specific parameters during deployment.
Architectural Patterns & Technologies
• Component-Based Architecture: The entire application is decomposed into reusable Vue components.
• Module Separation: Each business domain is maintained in its own directory (e.g., src/views/ai, src/views/crm) and has corresponding API definitions, state management modules, and routing configurations.
• Service Oriented Communication: The frontend is designed to interact with separate backend services (Spring Boot or Spring Cloud) which implement business logic.
• Configuration Driven: Environment configuration via various .env files and build scripts signal a flexible, multi-environment deployment setup.
• Design Patterns: Clear separation of concerns (presentational components vs. business logic in store and API modules), usage of hooks for common behaviours, and adherence to MVC-like separation in page designs.