How yaoapp/yao works
• CLI & Command Modules: The “cmd” folder holds various CLI commands (e.g., dump, get, inspect, migrate, run, upgrade, version, etc.). These are the entry points that a developer uses to interact with the engine.
• DSL & Engine Core: The DSL processing and execution layers are spread over packages such as “engine”, “sui”, “neo”, “pipe”, and “moapi”. These modules parse the DSL input, translate it into executable actions, and integrate with the built-in V8 engine (which provides native TypeScript support).
• API Layer: The “api” along with “moapi” directories represent web API handling. They expose endpoints and/or provide REST/API gateways for the deployed applications.
• AI Integration: The “aigc” and “openai” folders indicate integration with AI services for generating or assisting with application code.
• Data & Persistence: Components such as “data”, “store”, “model”, “connector”, “config”, and “share” handle various configuration settings, data binding, and interactions with databases or caching layers.
• Plugin and Extension Mechanisms: Modules under “plugin” and several “widgets” directories provide extension points, visual components, and additional services, allowing the system to be customized or extended.
• External Services & Integrations: Folders such as “neo/assistant”, “neo/vision”, “wework”, “socket”, “crypto”, and “cert” illustrate integrations with external APIs, cloud storage, security/encryption, and certificates.
• DevOps & Deployment: The presence of multiple Docker-related directories (“docker/build”, “docker/development”, “docker/production”), GitHub Actions workflows (.github/workflows), and Makefile indicate that deployment, CI/CD, and containerization are first-class citizens in the system.
Relationships and Interactions Between Components
• The journey begins at the CLI interface (commands in “cmd”), which takes user inputs and translates them through the DSL.
• The DSL parser and runtime (in “engine”, “sui”, “neo”, “pipe”, etc.) processes the commands and instructions. It then interacts with lower-level components (for instance, helpers in “helper”, “importer”, and “data” management modules) to transform and execute the application logic.
• The API layer exposes services through REST endpoints (in folder “api” and “moapi”), which might interact with the DSL engine for executing business flows.
• AI modules (“aigc”, “openai”) communicate with the DSL core to provide auto-generated code or suggestions – usually collaborating with the core DSL engine.
• Plugin and widget systems (directories like “widgets”, “plugin”) allow external or additional components to be integrated, thereby extending the core functionality.
• Storage and external communication (handled by “store”, “connector”, “socket”, etc.) form the backbone for data persistence and interoperability between different modules.
• The entire system is containerized and prepared for different deployment environments using Docker and GitHub Actions, ensuring a smooth CI/CD pipeline.
Architectural Patterns and Design Principles
• Modular Design: The codebase is clearly segmented by function (CLI, engines, API, integrations, plugins), which promotes separation of concerns.
• Layered Architecture: The application clearly separates concerns—presentation (CLI/API), business logic (DSL engine, core processors), and data/integration layers.
• Extensibility & Plugin-based: With multiple “plugin” and “widgets” directories, the system is built to be extended in a plug-and-play manner.
• All-in-One Deployment: Yao is designed with a single executable in mind that encapsulates everything, reducing external dependencies.
Putting It All Together
• Below that, outline the DSL Engine layer with sub-modules (engine core, sui, neo, pipe) that process the DSL and manage AI integration.
• To the side, note the API layer (api, moapi), which handles incoming external requests, connecting to the DSL engine as needed.
• Finally, include separate blocks for Deployment & DevOps tools (docker, GitHub Actions) that ensure continuous integration and containerized deployment.