How mrxujiang/pc-dooring works
Main Components
• Frontend Application:
• The core of the editor is implemented in React (as seen by multiple “.tsx” and “.jsx” files in paths like src/app.tsx and src/pages/editor).
• The “pages” directory shows dedicated entry points for the editor, help, and mobile tip.
• Layouts and global styling (src/layouts, src/global.css) define the common user interface structure.
• UI Component Library:
• Each component typically has several accompanying files: a main component file, style sheets (less/css), a “schema” file that defines its data structure, and a “template” file that likely supplies default configurations.
• Panel Components and Other Editors:
• The “PanelComponents” directory contains components used for configuration and editing (e.g., FormEditor, CardPicker, DataList, etc.), which most likely interact with the core editor to provide drag‐and‐drop or property editing functionalities.
• Server and Deployment:
• The server.js file, along with configuration files (package.json, .env, and others), represents the backend or deployment entry point. This Node.js server is used to serve the static files (or bundled front-end) for production and supports local development launch.
• Utility Modules:
• Under src/utils, utility functions for making HTTP requests and common tool functions support the application logic.
Relationships and Data Flow
• The main UI Editor (found under src/pages/editor) is the primary interface where users interact with the system. It directly integrates:
• The component library (BasicShop) for available UI blocks.
• The panel components for component configuration and property editing.
• Possibly a dynamic engine (src/components/DynamicEngine) that handles drag-and-drop and real-time update of the editor canvas.
• The core application uses layouts for overall structure and interacts with external assets (such as audio files in src/assets) and external services (if any are defined in src/pages/editor/services).
• On the backend side, server.js starts a Node server for serving the application after building (using yarn build) or for local development with http-server.
Architectural Patterns and Design Principles
• Modular Component Design: Each UI element is isolated into its own folder with separate concerns (display logic, styling, schema definitions, and templates). This adheres to separation of concerns and reusability.
• Visual Composition: The system architecture clearly separates the "building blocks" of UI (the BasicShop components) from the higher-level editor view (pages/editor) and configuration panels (PanelComponents), reflecting a component-based design.