Giter Club home page Giter Club logo

cue4puml4c4's Introduction

cue4puml4c4

For more information, please refer to The Website

Pure cue

  • clone the repo
  • in example dir, tweak example1.cue
  • cue vet to check... and cue genpuml to generate the plantuml

live view

  • Be sure to have a plantuml server running at localhost:8080.
  • within the example dir
  • Run the local server: go run ../cmd
  • open a browser to http://localhost:9090
  • save a file in the current directory
  • profit :D

Simple HOWTO

Create your own diagrams

$ mkdir $TMPDIR/mydir && cd $TMPDIR/mydir // obviously change this to something suitable for you
$ cue mod init
$ mkdir -p cue.mod/pkg/github.com/owulveryck/cue4puml4c4
$ git clone https://github.com/owulveryck/cue4puml4c4.git cue.mod/pkg/github.com/owulveryck/cue4puml4c4
$ cat <<EOF > test.cue
package main

import "github.com/owulveryck/cue4puml4c4:c4"

C1: c4.#C1 & { // the name C1 should be coherent with the name you declare in the command
        Systems: [{id: "sample", label: "my sample"}]
}
EOF

$ cat <<EOF > command_tool.cue
package main

import (
        "tool/cli"
        "text/template"
        "github.com/owulveryck/cue4puml4c4:c4"
)

command: genpuml: {
        c1: cli.Print & {
                text: template.Execute(c4.plantumlTemplate, C1) // change C1 here with the name of your object
        }
}
EOF

$ cue genpuml

Live preview

Prerequisites:

  • Go
  • a running plantuml server
  • run the following command:
cd ./cue.mod/pkg/github.com/owulveryck/cue4puml4c4/cmd/
./cue.mod/pkg/github.com/owulveryck/cue4puml4c4/cmd/cmd

open your browser to localhost:9090

cue4puml4c4's People

Contributors

owulveryck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dolanor-galaxy

cue4puml4c4's Issues

Create a "model" of reusable components

Reference: Diagramming vs modelling on the c4model website.

The idea is to create a model of for a C1/C2 representation leveraging the power of cue to make reusable components.

ex:

package c1

//...
mySystem: c4.#System & {
         label: "my system"
         //...
}
package c2

mycontainer: c4.#Container & {
        //...
}

mySystem: c1.mySystem & {
        containers: [mycontainer]
}

Create a documentation website on github pages

My preference goes to a site generated with Hugo with the theme Docsy.

The goal of this issue is:

  • to have the structure
  • to have automation to continuously deploy the website
  • to create a basic structure according to the divio documentation project.

Create a "hello world" tutorial

This is about writing a first-step tutorial as explained in the divio documentation framework.

The goal is to have a simple system diagram with the live preview that you can tweak.

Express golang code as a diagram

This high level architypes tool could also be used with actual golang code .

you could parse golang code and express it as Cue and render it into a structure .

by adding annotations to your golang you can then hint to the parser what it is .

Labels name examples such as service, data model, dto, etc etc

so then in a live web server you can see the logical component structure of a large golang project . As you add label annotations the diagram would update

You can take it further too and generate signalling code so that when the golang code is running you can see data flows in the diagram.

Even further can you can step throw via the web gui by sending stop events from the web gui down into the golang program.

https://github.com/RussellLuo/kun Uses annotations in the golang code to kick off code generation and so could be used to add the things I discuss above .

now just because you could does not mean you should .
but it makes golang code that teams work on more self describing and always produces component diagrams from the actual code .

Would love to here what you think โ€ฆ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.