reanimate/playground
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2021-08-11 11:04:02 +08:00
..
snippets Drop chalkduster from fonts example. 2020-10-27 17:10:11 +08:00
src How-To: Use system fonts (#175) 2020-10-05 11:43:15 +08:00
viewer-elm Update documentation links. 2021-07-04 00:25:17 +08:00
Dockerfile.nginx Fix nginx configuration. 2020-09-22 19:21:25 +08:00
gen_snippets.sh Rewamp object effects. 2020-09-01 14:15:06 +08:00
hie.yaml Improve the safety of the playground and limit the resources it may use. (#144) 2020-08-28 14:49:55 +08:00
LICENSE Improve the safety of the playground and limit the resources it may use. (#144) 2020-08-28 14:49:55 +08:00
nginx.conf Fix cert renewal for web.rgeometry.org 2021-08-11 11:04:02 +08:00
nginx_default.conf Fix nginx configuration. 2020-09-22 19:21:25 +08:00
playground.cabal Make the playground threaded. 2020-09-22 19:21:08 +08:00
playground.hs Fix some hlint warnings, and more consistency in examples (#167) 2020-09-20 22:51:22 +08:00
README.md Improve the safety of the playground and limit the resources it may use. (#144) 2020-08-28 14:49:55 +08:00
stack.yaml Update stack lts version. (#200) 2021-03-11 13:08:14 +08:00

Always run with GHCi. Forbid TemplateHaskell. Generate a single frame at a time. Stop generating frames once a limit is hit:

  • 5 seconds iff there's a queue.
  • 30 seconds if there isn't a queue.
  • 5 megs of disk space used.
  • Framerate hits 30 fps.
  • Code crashes.
  • Code hits memory ceiling.
  • New render request from the same user. Queue rendering. Skip queue when cache hit.

Test against:

  • last [1..]
  • let e = error ("error: " ++ e) in e

How to run locally:

Backend

stack build
stack exec --cwd ../ playground

Frontend

By default the frontend will use the backend running at reanimate.clozecards.com. To switch to a local backend, change 'backend' in Main.elm to 'Local'.

cd viewer-elm
npm install
npm run dev-server

Design

The playground frontend connects to the backend (reanimate.clozecards.com) over HTTPS. The backend runs nginx to serve static files and as a reverse proxy for the websocket server. All backend services are run in docker and auto-updated. SSL certificate is from lets-encrypt.org Frontend is written in Elm and automatically deployed to reanimate's GitHub Page on every push to master. The built-in examples are in the 'snippets/' folder and they are type-checked on every commit to master.