Giter Club home page Giter Club logo

petc's Introduction

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 [email protected]: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.

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.