Skip to content

typingduck/petc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pannus et Circulos: whiteboard as code

Quickly sketching diagrams on black/whiteboards is a great way to understand and explain complex systems. If we could digitize the experience, that knowledge could be stored for future reference. Doing so would also allow easier colloboration and extension. These are the motivations behind Pannus et Circulos (cloth and circles):

Pannus et Circulos demo

Once digitized it is possible to make dynamic illustrations. E.g. in an emergency instead of trying to visualize the mental model of a broken system, why not automate chart updates:

curl -X PATCH -d '{ "op": "add", "path": "/nodes/server-2/className", "value": "failed server" }' http://api-server/docs/$DOCID

demo with node style

Building on a simple API would allow knowledge to be programmed into the chart:

curl -X PATCH -d '{ "op": "add", "path": "/edges/lb-1-server-3/className", "value": "red-edge" }' http://api-server/docs/$DOCID
curl -X PATCH -d '{ "op": "add", "path": "/edges/lb-2-server-3/className", "value": "red-edge" }' http://api-server/docs/$DOCID

demo with edge style

With a chart data model based on simple standards (css and json) accessed simultaneously through a UI and API allowing the best of automated and human input:

{
  "nodes": {
    "server-1": {
      "id"   : "server-1",
      "label": "server 1",
      "x"    : 10,
      "y"    : 20
    },
    "mysql": {
      "id"       : "database-1",
      "label"    : "mysql",
      "className": "mysql",
      "x"        : 30,
      "y"        : 40
    }
  },
  "edges": {
    "server-1-mysql": {
      "id"       : "connection-1",
      "source"   : "server-1",
      "target"   : "database-1",
      "className": "red-edge"
    }
  },
  "style": {
    "nodes": {
      "mysql": {
        "backgroundColor": "#DDF",
        "borderColor"    : "#369",
        "borderRadius"   : "20px",
        "borderWidth"    : "10px",
        "height"         : "32px",
        "width"          : "32px"
      }
    },
    "edges": {
      "red-edge": {
        "paintStyle": {
          "stroke": "red"
        }
      }
    }
  }
}

Quick Start

git clone git@github.com:typingduck/petc.git
cd petc
npm install
npm start  # this starts the UI/API server and DB.

Ports used

  • DB: 5002
  • API: 5001
  • UI: 5000

Code/Architecture

A React app, node API server and couchdb database. Uses socket.io websockets to allow realtime collaboration/updates. Each of the components db, server, client are self contained in their own directory. See their respective directories for more details, running them independently, testing, etc.

Status

Started as a prototype, but went better than expected. Having reached the intial milestone, I consider it done pending a good reason to take it to the next level. Would be nice to make the whiteboard-esque behaviour complete and productionize the backend.

Warning

This project currently uses comic sans, a font known to the State of California to potentially cause seizures in individuals with prior sensitivity to taste. But remember: Autoritätsdusel ist der größte Feind der Wahrheit.

About

Pannus et Circulos: whiteboard as code

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages