Coder Social home page Coder Social logo

plunker's Introduction

Plunker

Gitter

The next generation of lightweight collaborative online editing.

WARNING: This repository does not contain the code for what you see running on http://plnkr.co

The current code for Plunker is in the repositories listed below

Originally, Plunker was coded in a single repository with different sub-servers existing in the /servers path. The entire application was run on a single server.

However, with increasing popularity, reality decided to come hang out and make everyone's lives difficult. The solution was simple; since the components of Plunker were designed as 'sub-servers', it should be easy to split them out and run them separately. However, having different logical entities with different functions in the same repository doesn't make sense.

I decided to create separate repositories for each of the Plunker servers that are currently deployed on Nodejitsu. They are as follows:

Plunker component repositories

  • plunker_api The server that connects to a mongodb database and serves requests over a restful api.
  • plunker_www The server that is responsible for hosting and running the front-end that users see and touch everyday.
  • plunker-run-plugin The server that allows for previewing of plunks and temporary previews and also does the dynamic transpilation.
  • plunker_collab The server that serves the code necessary for collaborative coding as well as doing the actual operational transformation over a browserchannel connection.
  • plunker_embed The server that hosts the embedded views of plunks.

Plunker config files

Each server, once cloned locally, requires one or two config.json files to run.

Servers that use the environment-specific config files config.development.json and config.production.json:

  • plunker_api
  • plunker_www
  • plunker_run
  • plunker_collab

Only plunker_embed uses a single config.json file.

Sample configuration file:

Not all fields are required by each server, but if all are present no harm should come to any small animals.

{
  "host": "hostname.com",
  "url": {
    "www": "http://hostname.com",
    "collab": "http://collab.hostname.com",
    "api": "http://api.hostname.com",
    "embed": "http://embed.hostname.com",
    "run": "http://run.hostname.com",
    "carbonadsH": "OOPS, this is pretty specific to my current deploy",
    "carbonadsV": "OOPS, this is pretty specific to my current deploy"
  },
  "port": 8080,
  "oauth": {
    "github": {
      "id": "series_of_random_chars",
      "secret": "longer_series_of_random_chars"
    }
  }
}

Everything below this point is out of date or incorrect!

...And there be dragons

Usage

git clone git://github.com/filearts/plunker.git
git submodule update --init

npm install

node server.js

Editor API

POST /edit/

You can send a POST request to /edit/ to bootstrap the editor with the basic structure of a plunk. The JSON format for this is described below.

{
  "description": "Description of Plunk",
  "tags": ["array", "of", "tags"],
  "files": [
    {
      "filename": "index.html",
      "content": "<html><script src=\"script.js\"></script></html>"
    },
    {
      "filename": "script.js",
      "content": "alert('hello world');"
    }
  ]
}

License

Copyright Filearts

plunker's People

Contributors

ggoodman avatar gitter-badger avatar majgis avatar mati0090 avatar rafaelstz avatar

Watchers

 avatar

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.