Skip to content

Low code modelizer that works with external plugins for technology integration (terraform, jenkins, kubernetes...)

License

Notifications You must be signed in to change notification settings

ditrit/leto-modelizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Leto Modelizer (leto-modelizer)

Quality Gate Status Reliability Rating Maintainability Rating Security Rating

Code Smells Bugs Vulnerabilities Technical Debt

Lines of Code Coverage Duplicated Lines (%)

Technical topology low-code editing tool.

Leto modelizer is an application that can help you generate infrastructure code without you having to write any code! One of theirs main qualities is that you can choose:

  • which languages you can provide with this application

Or

  • Implements your own plugin

Or

  • Override existing plugins

If your company take care only of terraform files, you just have to install terraform before build this app and deploy it.

If you only want your own language component (maybe based on existing plugins), you can implement/override existing plugin and just install your plugin definition.

Requirements

Official plugins

For now, we don't have many plugins to offer you, but follow us and in the next (few) months you will see new plugins (like Jenkins or Kubernetes).

Terraform plugin

Plugin to manage terraform files, by default it comes with aws provider definition.

GitHub url

Github plugin

Plugin to manage GitHub action files.

GitHub url

Kubernetes plugin

Plugin to manage Kubernetes files.

GitHub url

Compatibility versions table

Leto-modelizer Supported version
Plugin-core Terrator-plugin Githubator-plugin kubernator-plugin
1.0.0 = 0.13.0
= 0.14.0
= 0.1.12 🚫 🚫
1.1.0 = 0.15.2 = 0.2.0 = 0.1.1 🚫
1.2.0 = 0.16.0 = 0.3.0 = 0.2.0 🚫
1.3.0 = 0.21.0 = 0.7.0 = 0.2.5 🚫
1.4.0 = 0.28.0 = 0.12.2 = 0.5.2 = 0.3.2

How to install plugin

Run npm install to let npm retrieve all dependencies and especially our cli to easily install your plugins πŸ˜‰.

Then you just have to know two things about your plugins:

  • its name
  • its version

Install official plugins

The leto-modelizer-plugin-cli.json file, at the root of Leto Modelizer, contains the list of official plugins provided by the team. Each plugin is represented by an object containing the name, scope and version of the plugin.

To install plugin, run this command npm run plugin:install.

Install custom plugin

If you want to add a custom plugin, you can modify leto-modelizer-plugin-cli.json:

  • if your plugin is referenced on npm:
// leto-modelizer-plugin-cli.json
[
  // (...)
  {
    "displayName": "YOUR_PLUGIN_DISPLAY_NAME",
    "name": "YOUR_PLUGIN_NAME",
    "scope": "NPM_ORGANISATION",
    "version": "X.X.X"
  }
]
  • if your plugin only have a repository url on a git provider:
// leto-modelizer-plugin-cli.json
[
  // (...)
  {
    "displayName": "YOUR_PLUGIN_DISPLAY_NAME",
    "name": "YOUR_PLUGIN_NAME",
    "scope": "YOUR_ORGANISATION",
    "version": "X.X.X",
    "url": "YOUR_REPOSITORY_URL" // like http(s)://github.com/repository.git#1.0.0
  }
]

For more information about configuring plugin, you can read this documentation.

Then execute this command npm run plugin:install and choose your custom plugin in the list to install it.

Install official/custom plugin in command line

Options name and version can be added with the npm run plugin:install command to bypass cli prompts.

# Example with terraform plugin
npm run plugin:install -- name="terrator-plugin" version="0.12.2"

# Example with github action plugin
npm run plugin:install -- name="githubator-plugin" version="0.5.2"

# Example with kubernator plugin
npm run plugin:install -- name="kubernator-plugin" version="0.3.2"

Now that your plugin is installed, you can continue to install other plugins with the same command if you want.

How to uninstall plugin

Run npm install to let npm retrieve all dependencies and especially our cli to easily uninstall your plugins πŸ˜‰.

Then you just have to know two things about your plugins:

  • its name
  • its version

Uninstall plugins

To uninstall plugin, run this command npm run plugin:uninstall.

Uninstall plugin in command line

Options name and version can be added with the npm run plugin:uninstall command to bypass cli prompts.

# Example with terraform plugin
npm run plugin:uninstall -- name="terrator-plugin" version="0.12.2"

# Example with github action plugin
npm run plugin:uninstall -- name="githubator-plugin" version="0.5.2"

# Example with kubernator plugin
npm run plugin:uninstall -- name="kubernator-plugin" version="0.3.2"

Now that your plugin is uninstalled, you can continue to uninstall other plugins with the same command if you want.

How to setup the authentication with Leto-Modelizer-Api

We are using Leto-Modelizer-Api authentication (as a backend). To configure it, you must fill the configuration inside global.config.json root file.

We have administration view Leto-Modelizer-Admin, for users who have admin role, to manage users, groups and roles.

{
  "backendUrl": "https://localhost:8443"
}

To get the authentication setup, backendUrlis mandatory.

NOTE: If the previous configuration is not present in the configuration file, Leto-Modelizer will be launched with the backend mode deactivated. NOTE: For now, there is no UI associated to the backend, but the UI for the admin is coming soon ! NOTE: The AI tools are only available with the backend mode and it needs to be authenticated with Leto-Modelizer-Api.

How to build this app

Native build

Once you have installed and initialized all your plugins, run this command to build the app:

npm run build

It will generate the built application in the dist folder.

Docker build

To build this app with docker (the two main plugins for terraform & github are included), please use this command:

docker build . -build-arg TERRATOR_PLUGIN_VERSION="0.12.2" -build-arg GITHUBATOR_PLUGIN_VERSION="0.5.2" -build-arg KUBERNATOR_PLUGIN_VERSION="0.3.2" -t leto-modelizer

Docker run

Once your image is built, to run the associated container please use this command:

docker run -p 8080:80 leto-modelizer

Proxy

See nginx configuration.

Environment variables

  • Using templates from a remote repository

TEMPLATE_LIBRARY_BASE_URL is used to define the url of a template library you want to use. To have more information on how to build your own template library, please visit leto-modelizer-templates-library. To define TEMPLATE_LIBRARY_BASE_URL, go to your repository, open the index.json file (which contains all the metadata of your templates) in raw mode and get the url to the branch name, without including the file name.

# Example with the leto-modelizer-templates-library repository that contains all default templates for leto-modelizer.
TEMPLATE_LIBRARY_BASE_URL="https://raw.githubusercontent.com/ditrit/leto-modelizer-templates-library/main" npm run build

To be able to access external resources for your templates, you need to set a reverse proxy named template-library. You can see an example below of an nginx.conf file:

http {
  server {
    listen 80;
    location /template-library {
      proxy_pass TEMPLATE_LIBRARY_BASE_URL; # replace by your url
    }
  }
}

Same for your Leto-Modelizer-Api, you need to set a reverse proxy named backend. You can see an example below of an nginx.conf file:

http {
  server {
    listen 1337;
    location /backend {
      proxy_pass YOUR_URL; # replace by your url
    }
  }
}

NOTE: You can use the global configuration file global.config.json to define environment variables like so :

{
  "templateLibrary": "YOUR_TEMPLATE_LIBRARY_BASE_URL",
  "backendUrl": "YOUR_URL"
}
  • Allow to keep data-cy attribute in html

KEEP_CYPRESS_ATTRIBUTE is used to keep all data-cy attribute in the generated html.

KEEP_CYPRESS_ATTRIBUTE=true npm run build