How airpowerteam/airpower-web works
Project type and purpose
• This is AirPower-Web, an NPM-publishable Vue 3 + Element Plus + TypeScript UI component library and rapid-development scaffolding.
• It bundles a suite of reusable Vue components, custom hooks, decorators, HTTP utilities, and other tooling to accelerate frontend development.
File structure
• Top-level build/config files:
• tsconfig.json, vite.config.ts, package.json, eslint.config.js
• Entry point: src/index.ts exports everything as a Vue plugin/library.
• Assets: src/assets (CSS/SCSS, SVG images)
• UI layer: src/components houses all Vue UI components (button, dialog, table, form, etc.)
• Core utilities & services:
• src/http (Http client, enums, types)
• src/feedback, src/file, src/permission, src/validator, src/i18n
• src/service (abstract service classes)
• State & data modeling:
• src/model (entities, query/request/response models)
• src/interface (TypeScript interfaces for payloads, files, trees, users…)
• Custom decorators: src/decorator (Form, Model, Search, Table, Field)
• Reusable logic hooks: src/hooks (detail, editor, table variants, selector, tree…)
• Configuration/constants: src/config, src/type, src/shared
• Routing helper: src/router
• Dialog helpers: src/dialog
Extract README insights
• Highlights that this library depends on other @AirPower packages (Transformer, Enum, i18n, Util)
• Built with Vite, TypeScript, Vue 3, Element Plus
• Designed as a plug-and-play scaffolding toolkit for rapid development
a. Main components
• Library Entry (src/index.ts)
• UI Components
• Hooks & Decorators
• Core Services & HTTP Layer
• Models & Interfaces
• Utilities (i18n, feedback, file, permission, validator)
• External Dependencies (AirPower-Transformer, AirPower-Enum, AirPower-i18n, AirPower-Util, Vue 3, Element Plus, Vite)
b. Relationships & data flow
• Entry Point → registers UI Components & Utilities as Vue plugin
• UI Components ← use Hooks, Decorators, Services, Models, Utilities
• Hooks → call HTTP Layer and Services → return Models/Interfaces
• Decorators ➔ enhance Models & Form components
c. Architectural patterns & principles
• Modular monorepo-style library: each feature lives in its own folder
• Vue plugin pattern: single entry to install all components/utilities
• Separation of concerns: UI vs data layer vs utilities vs decorators/hooks
• Decorator pattern for metadata (forms, models, tables)
• Hook-based composition for data fetching and state management
d. Key technologies & frameworks
• Vue 3 Composition API, Element Plus UI framework
• TypeScript (strict typing for interfaces/models)
• Vite (build tool)
• NPM packaging
Capturing essential detail
• Keep the entry point central—everything figures into or out of src/index.ts