Project Structure
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.
Top-Level Directory Overview
The following uses my-nocobase-app/ as the project directory. There may be slight differences in different environments:
packages/ Subdirectory Description
The packages/ directory contains NocoBase's core modules and extensible packages. The specific content depends on the project source:
- Projects created via
create-nocobase-app: By default, it only includespackages/plugins/, used to store custom plugin source code. Each subdirectory is an independent npm package. - Cloned official source repository: You can see more subdirectories, such as
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/ Runtime Directory
storage/ stores runtime-generated data and build outputs. Common subdirectories are described below:
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 executingyarn build <plugin> --tar.
It's usually recommended to add the storage directory to .gitignore and handle it separately during deployment or backup.
Environment Configuration and Project Scripts
.env,.env.test,.env.e2e: Used for local development, unit/integration testing, and end-to-end testing respectively.scripts/: Stores common maintenance scripts, such as database initialization, release utilities, etc.
Plugin Loading Paths and Priority
Plugins may exist in multiple locations. NocoBase loads them in the following priority order when starting:
- Source code version in
packages/plugins(for local development and debugging). - Packaged version in
storage/plugins(uploaded via UI or imported via CLI). - Dependency packages in
node_modules(installed via npm/yarn or framework built-in).
If a plugin with the same name exists in both the source directory and the packaged directory, NocoBase will prioritize loading the source version, facilitating local overrides and debugging.
Plugin Directory Template
Create a plugin using the CLI:
The generated directory structure is as follows:
After the build completes, the dist/ directory and client-v2.js, server.js files will be loaded when the plugin is enabled. During development, you only need to modify the src/ directory. Before publishing, execute yarn build <plugin> or yarn build <plugin> --tar.
Related Links
- Write Your First Plugin — Create a plugin from scratch and experience the complete development workflow
- Server-side Development Overview — Overall introduction and core concepts of server-side plugins
- Client-side Development Overview — Overall introduction and core concepts of client-side plugins
- Build and Package — Plugin build, packaging, and distribution workflow
- Dependency Management — Plugin dependency declarations and management

