How dromara/go-view works
A high-level layered view
• Entry Point Layer: Show the index.html that loads the main.ts entry script. This bootstraps the root App.vue.
– Layout components (src/layout) that structure the overall page (header, sidebar, footer, transitions).
– Page-specific components (src/views/chart, src/views/edit, src/views/preview, etc.).
– Rich, domain-specific chart configuration modules (all the chart component folders in src/packages/components/Charts).
• State Management Layer: Highlight the Pinia-based store (located in src/store and its modules) that manages application state such as chart editing, theme settings, language preferences, and system configuration.
• API/Data Interaction Layer: Show the API modules (src/api) wrapping axios (with configuration and mock data) that serve to communicate with the backend (or serve mock data) – this includes HTTP setup, REST endpoint paths, and mocks.
• Plugins and Utilities: Include the custom plugins (src/plugins) and utility modules (src/utils, src/hooks, src/directives) that add cross-cutting support such as theme management, storage, file handling, and encryption.
Main components and interactions
• UI Components – the presentation layer is highly modular. Layers of reusable components (e.g., GoAppProvider, GoLoading, chart components in packages) are used throughout the project.
• Routing – the router modules dynamically load views based on navigation and use router guards (src/router/router-guards.ts) to control permissions and flow.
• Data Flow – UI components interact with the global state via the Pinia stores so that user interactions (in pages like ContentEdit, ContentConfigurations, etc.) trigger updates. These stores, in turn, use API services in src/api (configured with axios) for fetching data or persisting changes.
Architectural patterns/design principles
• Modular and Component-Based Architecture: The clear separation of views, components, and packages indicates a design that endorses reuse and loose coupling.
• Separation of Concerns: Data interactions (API layer), state management (store), configuration (settings), presentation (components/views) are all partitioned clearly.
• Composition API and Hooks Pattern: The src/hooks directory along with the expansive use of TS and custom directives shows a design that aims for reusability and clarity.
• “Entry Point (index.html, main.ts, App.vue)”
• “Router” (with modules like chart.route, edit.route, preview.route, project.router)
• “Views & Layouts” (for all page-level components)
• “State Management (Pinia Stores)” (listing modules such as chartEditStore, designStore, langStore, etc.)
• “API Module” (with axios configuration, mock endpoints, and paths)
• “Plugins & Utilities” (custom plugins, hooks, directives, and utils)
• “Settings/Configuration” (chart themes, design settings, HTTP settings)
• The initialization process (index.html → main.ts → App.vue).
• Data flow from API calls → Store updates → UI re-render.
• Navigation flow via Router leading to components within Views.
• Optionally, add a “Build & Deployment” section that shows how files like vite.config.ts, Makefile, and the CI/CD pipelines (.workflow, .husky) interact with the source-code repository.