Skip to content

hmcts/cp-c4-architecture

Repository files navigation

Common Platform Archiecture

This repository describes the archiecture of the Crime Common Platform. It uses the LikeC4 tools and DSL to describe the model, and the principles of the C4 modelling approach.

The output of this project can be viewed in interactive form at https://hmcts.github.io/cp-c4-architecture/

Install/update node using your terminal or download and run the .pkg installer

How-to

Setup your local environment

LikeC4 works best in an IDE, there are extensions/plugins for both Visual Studio Code and IntelliJ idea, however the IntelliJ plugin is not currently maintained and therefore Visual Studio Code is the suggested editor of choice.

The following instructions are for Visual Studio Code on MacOS, once completed you should be able to run likec4 locally from the command line, using the instructions on the cli section below.

Install Visual Studio Code

Download and install Visual Studio Code from the official VS Code page. The simplest installation is to download the zip file and extract the app, but choose the option you're most familiar with.

Once installed, complete the setup wizard within the app and see the setup overview guide for familiarisation.

Install extension for Visual Studio Code

Navigate to the exension page and click the install button, it should take you to the extensions window inside VSC to complete the installation.

After installation, when a .c4 file is opened in the editor there will be an 'open preview' link directly above any view definition. Clicking this link opens the view in the Diagram Preview tab.

Install Node.js

LikeC4 requires Node.js version 20+

Check if you have a compatible version already installed

node -v

CLI

You can install globally, locally and use scripts from package.json, or just via npx
Check documentation

To start local server with live reload (for development or quick preview)
The app should start and load a localhost webapp in your default browser (e.g. http://localhost:5173/) showing your models Inside the project folder:

npx likec4 start

Export to PNG:

npx likec4 export png -o png

Documentation: https://likec4.dev/docs/tools/cli/

Custom generator

likec4.config.ts includes an example of custom generator that generates CSV file with relationships:

npm run generate:relationships-csv

Model validation

test/validate-model.spec.ts includes an example of model validation tests:

npm run test

Check documentation for more details

Deployment

Deployment is the same as for any project built with vite.

  1. Build static site (export to HTML, ready for deployment):
npx likec4 build -o ./dist

Check npx likec4 build --help for options and examples

  1. Upload ./dist folder to your hosting

Github Pages

This tproject deploys to github pages on every push to main branch.
Check .github/workflows/pages.yml

License

This project is licensed under the MIT License.

About

Common Platform architecture defined using C4 modelling notation

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •