Simpatico
Literate markdown server for a local codepen-like experience
VPS deployable - Running Locally - Experiments
Use a text editor and browser you already know and a simple server process to create literate programs that execute immediately and without a build. Tiny, privacy respecting, readable and short JavaScript source. No front-end build!
Features
Offline development
Have a codepen/observablehq/jsfiddle-like experience without being connected to the internet.
Use the text editor that you're comfortable with.
Use local source-code control
Have full control over the html, including head content.
Debug one top-level context rather than an embedded iframe context.
Speed up your build-test-debug (BTD) loop by eliminating the front-end build. No webpack, grunt, or anything else!
Publish
Publish your work in a way that protects your users. No cookies. No 3rd party resources are permitted.
The Reflector server is very small in terms of source (450LOC total), dependencies (only 3 and they have no transitive dependencies).
The Reflector server at simpatico.io takes 200MB of RAM and can handle 10k requests-per-second on a $5 VPS.
Extremely fast, single process operation. TLS terminates in node, nginx proxy is not needed.
Experiments
These are sample experiments users have created that show how Simpatico works. Feel free to fork them and start experimenting yourself.
core
. Very generic, convenience functions that smooth over the JavaScript runtime. Of particular importance is the definition of a comprehensive set of predicates/assertions. Nothing in this module is specific to Simpatico, although it is a good example of my preferred style of ES6 programming -> functional and minimal.combine
. The function used to produce a new state from a previous state plus an input.combine()
is a generalization ofObject.assign()
and previously published as combine-keys. Defines handler invocation and the message cascade.stree
. A data structure that organizes inputs into chains that result in different, related states. Unifies previous distinct concepts like instantiation vs inheritance. Provides natural "collections" support.friendly
. A very simple runtime type system, accessed throughvalidate()
, that helps functions help their callers call them correctly.svg
SVG and SVG animation using only very small primitives. Visually interesting!
More detail about each module is available in the test harness html
file, and the module source code itself.
Running Locally
- Install a recent version of NodeJS (See nvm, the best way to install node with
$ nvm install 20 && nvm use 20
) - Clone this repository:
git clone https://github.com/javajosh/simpatico
- Install the dependencies:
cd simpatico && npm install
- Generate self-signed certificate to run local TLS (see devops/deploy.sh)
- Run the reflector
node reflector.js
- Navigate to https://localhost:8080
Copyright SimpatiCorp 2024