This template is an example of how to use LikeC4.
Contains:
- LikeC4 sources (
/src) - Model validation (
/test/validate-model.spec.ts) - Deploy to github pages (
pages.yml) - Project configuration with custom generator (
likec4.config.ts)
Demo - https://template.likec4.dev
Try it online:
Or:
You will get popup suggesting to install "LikeC4" extension.
Agree to get syntax highlighting, completions and other features in likec4 files
- Create a new repository from this template
- Pull your repository and open in VSCode
- Install suggested LikeC4 extension
Now you can edit likec4 sources, refactor, navigate and preview diagrams.
You can install globally, locally and use scripts from package.json, or just via npx
Check documentation
LikeC4 requires Node.js version 20+
To start local server with live reload (for development or quick preview)
Inside the project folder:
npx likec4 startExport to PNG:
npx likec4 export png -o pngDocumentation: https://likec4.dev/docs/tools/cli/
likec4.config.ts includes an example of custom generator that generates CSV file with relationships:
npm run generate:relationships-csvtest/validate-model.spec.ts includes an example of model validation tests:
npm run testCheck documentation for more details
Deployment is the same as for any project built with vite.
- Build static site (export to HTML, ready for deployment):
npx likec4 build -o ./distCheck
npx likec4 build --helpfor options and examples
- Upload
./distfolder to your hosting
This template contains workflow to deploy to github pages on every push to main branch.
Check .github/workflows/pages.yml
This project is released under the MIT License