Multi-projects
Sometimes you may want to split your LikeC4 model into multiple ones, based on domains, teams, or any other criteria.
You can do this by creating multiple projects in your workspace and linking them together.
You can also use this feature to share your model with other teams or projects.
To mark a folder as a project, create a likec4.config.json
file in the folder:
Directorycloud
- likec4.config.json
- service1.c4
- service2.c4
- …
Directoryexternals
- likec4.config.json
- amazon.c4
- …
The likec4.config.json
file must have the name of the project and must be unique in the workspace.
{ "name": "project-name"}
Exclude files
Section titled “Exclude files”By default, LikeC4 recursively scans in the project folder.
You can exclude files by adding an exclude
array to the config file.
{ "name": "project-name", "exclude": [ "**/node_modules/**/*" ]}
If no exclude pattern is provided, LikeC4 uses ["**/node_modules/**/*"]
as default.
The exclude pattern is the same as the one used by picomatch.
Import elements
Section titled “Import elements”You can import elements from other projects by using the import
keyword.
import { serviceA } from 'projectA'
model { serviceB = service { -> serviceA.api 'calls serviceA' }}