Skip to content
Oeiuwq Faith Blog OpenSource Porfolio

filearts/plunker

Plnkr.co front-end and backend

filearts/plunker.json
{
"createdAt": "2012-04-23T13:09:26Z",
"defaultBranch": "master",
"description": "Plnkr.co front-end and backend",
"fullName": "filearts/plunker",
"homepage": null,
"language": "CoffeeScript",
"name": "plunker",
"pushedAt": "2019-10-25T11:36:34Z",
"stargazersCount": 598,
"topics": [],
"updatedAt": "2025-01-03T03:59:23Z",
"url": "https://github.com/filearts/plunker"
}

Gitter

The next generation of lightweight collaborative online editing.

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_api]!(//github.com/filearts/plunker_api) The server that connects to a mongodb database and serves requests over a restful api.
  • [plunker_www]!(//github.com/filearts/plunker_www) The server that is responsible for hosting and running the front-end that users see and touch everyday.
  • [plunker-run-plugin]!(//github.com/ggoodman/plunker-run-plugin) The server that allows for previewing of plunks and temporary previews and also does the dynamic transpilation.
  • [plunker_collab]!(//github.com/filearts/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]!(//github.com/filearts/plunker_embed) The server that hosts the embedded views of plunks.

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!

Section titled “Everything below this point is out of date or incorrect!”

…And there be dragons

git clone git://github.com/filearts/plunker.git
git submodule update --init
npm install
node server.js

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 unsrc=\"script.js\"></script></html>"
},
{
"filename": "script.js",
"content": "alert('hello world');"
}
]
}

Copyright Filearts