Whether you clone the source code from Git or initialize a project using create-nocobase-app, the generated NocoBase project is essentially a Yarn Workspace-based monorepo.
The following example uses my-nocobase-app/ as the project directory. There may be slight differences in different environments:
The packages/ directory contains NocoBase's core modules and extensible packages. The content depends on the project source:
create-nocobase-app: By default, it only includes packages/plugins/, used to store custom plugin source code. Each subdirectory is an independent npm package.core/, plugins/, pro-plugins/, presets/, etc., corresponding to framework core, built-in plugins, and official preset solutions.Regardless of the case, packages/plugins is the main location for developing and debugging custom plugins.
storage/ stores runtime-generated data and build outputs. Common subdirectory descriptions are as follows:
apps/: Configuration and cache for multi-app scenarios.logs/: Runtime logs and debug output.uploads/: User-uploaded files and media resources.plugins/: Packaged plugins uploaded via UI or imported via CLI.tar/: Compressed plugin packages generated after executing yarn build <plugin> --tar.It's usually recommended to add the
storagedirectory to.gitignoreand handle it separately during deployment or backup.
.env, .env.test, .env.e2e: Used for running locally, unit/integration testing, and end-to-end testing respectively.scripts/: Stores common maintenance scripts (such as database initialization, release utilities, etc.).Plugins may exist in multiple locations. NocoBase will load them in the following priority order when starting:
packages/plugins (for local development and debugging).storage/plugins (uploaded via UI or imported via CLI).node_modules (installed via npm/yarn or framework built-in).When a plugin with the same name exists in both the source directory and the packaged directory, the system will prioritize loading the source version, facilitating local overrides and debugging.
Create a plugin using the CLI:
The generated directory structure is as follows:
After the build completes, the
dist/directory andclient.js,server.jsfiles will be loaded when the plugin is enabled. During development, you only need to modify thesrc/directory. Before publishing, executeyarn build <plugin>oryarn build <plugin> --tar.