https://github.com/racketscript/racketscript-playground
Online playground from RacketScript
https://github.com/racketscript/racketscript-playground
compiler javascript playground racket racketscript
Last synced: about 1 month ago
JSON representation
Online playground from RacketScript
- Host: GitHub
- URL: https://github.com/racketscript/racketscript-playground
- Owner: racketscript
- License: mit
- Created: 2016-09-17T02:50:22.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2024-03-28T02:44:57.000Z (almost 2 years ago)
- Last Synced: 2024-05-09T23:15:26.580Z (almost 2 years ago)
- Topics: compiler, javascript, playground, racket, racketscript
- Language: Racket
- Homepage:
- Size: 222 KB
- Stars: 19
- Watchers: 4
- Forks: 9
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Racketscript Playground
=======================
[](LICENSE)
[](https://hub.docker.com/r/racketscript/racketscript-playground)
[](http://play.racketscript.org)
Playground for [RacketScript](https://github.com/racketscript/racketscript).
Both server-side and client-side code is written in RacketScript.
Playground uses Github Gist to save and load files. The name of Gist
file must be `source.rkt`.
- URL of format `/#gist/:id` will load gist of that provided id.
- URL of format `/#example/:id` will download
`$ROOT_URL/examples/:id.rkt` from server.
- A `POST /compile` request will take JSON payload of format: `{
"code": }` and return a compiled JS file in reponse.
[CoreMirror](https://codemirror.net/) is used as editor
component. Search and Replace shortcuts
are [here](https://codemirror.net/demo/search.html).
## Build and Deploy
### With Docker (for deployment)
Easiest way is to pull the latest image from Docker registry
([racketscript/racketscript-playground](https://hub.docker.com/r/racketscript/racketscript-playground)).
```bash
# Pull docker image
docker pull racketscript/racketscript-playground
# Run playground webserver on port 8080
docker run -dp 8080:8080 -t racketscript/racketscript-playground
```
You can also build image yourself using `make docker-build`, followed by `make
docker-run` to start the playground web server. By default, `make docker-run`
binds webserver to port 8080.
### Without Docker (for development)
After installing Racket, NodeJS, and RacketScript, execute following
commands to run the playground:
```bash
make -j4 run
```
For development, you can use `quickrun`, after runnning `run` once,
for building both server and client without npm install/update:
```bash
make -j4 quickrun
```
## License
RacketScript is licensed under [MIT license](LICENSE). Third-party
libraries can be found over [here](static/index.html)
and [here](package.json).
## Troubleshooting
- Running `docker` commands gives permission error
[Add user name to `docker` user group](https://docs.docker.com/engine/install/linux-postinstall/): `sudo usermod -aG docker $USER`