A Wev Server for Idealists
Self-hosted, privacy preserving, minimalist approach to writing code. No front-end build, no frameworks. Support a very fast and minimalist build-test-debug cycle Literate Markdown.
Web development can be a pleasure again with no front-end builds or complex servers. Reconnect with the roots of web-development by programming the browser on its own terms.
Write code like this in markdown, and have it run in the page, and signal you when it breaks:
js
const a = {a: 1};
const b = {b: 2};
is.hasProp(a, 'a');
as.hasProp(a, 'a');
assert(c.hasProp(a, 'a'))
assert(!c.hasProp(a, 'b'))
Installation
Install the server (see the readme for more details):
- 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
- Usen OpenSSL to generate a self-signed certificate to run local TLS (see devops/deploy.sh)
- Run the reflector
node reflector.js
- Navigate to https://localhost:8080
Features
The server is called the reflector, and features:
- No cookie support.
- No 3rd party content, because they ALL violate your users privacy.
- File-watching, in memory cache of all content.
- Aggressive client-caching headers are standard for all resources.
- Cache-busting sub-resource URLs (coming soon).
- Support for URLs with or without file extension.
- A single process and (almost) a single file, 500-line node program.
- Support for automatic Let's Encrypt TLS certificate renewal.
- Terminates TLS natively - no need for a proxy.
- Supports dropping privileges to the user of your choice, all in node.
- Extensive script support for deploying and running your own instance].
- Native Markdown. Not just markdown, but literate markdown that gives you common headers and runs your code (and is Github compatible).
- Minimal, and minimal dependencies.
- Fast. Cold start in 90ms. Most resources served in 10ms.
- All code is modern, ES6+ using ES modules
import
instead of CommonJSrequire()
. - Websocket support for chat.
- Logs are not stored, only printed to stdout.
- MIT licensed
Requirements:
- Node 17+
- Openssh to generate your local tls certs.
Limitations:
- Not released to
npm
/npx
- you need to clone and modify. Coming soon. - There is a lot of content that is currently irrelevant and needs to be moved/removed. Coming soon.
- Currently no docker support. Coming Soon.
Compare with:
- Caddy, Nginx, redbean. Minimalist, fast web-servers with lots of features.
- Codepen, Observable, jupyter. Simpatico serves a similar role as a notebook application, but it's browser focused, locally hosted, and easy to deploy to the public internet.
Building Applications
Literate Markdown serves as the basis of fast, minimalist content creation. Use this, in combination with the assertion library in core and the functions in testable, as the foundation of a simple but powerful test harness. Combine all the tests in a single place, acceptance, for a "go"/"no go" deployment decision.
Chat
Chat the basis for a privacy-preserving E2EE structured-chat platform. Coming soon.
Static site generator
Static site generator a very simple site generator, with the ability to load all content at once.
Explore and exercise Browser APIs
Explore svg authoring and animation, and subtle.crypto for browser-native PKI.
Wrap a client-side websocket in an stree.
Write new libraries
core - a pure js library that defines comprehensive predicates and assertions.
friendly - a 200-line runtime-type checker, comparable to Zod but it is pure javascript.
combine - a generalization of Object.assign()
that is a smaller, less verbose Redux.
stree - a generalization of a trie-structure over arbitrary objects. Visualize it and use it to model a websocket, for use in chat.
Deeply enjoy a fast and minimalist build-test-debug cycle
[Example video]
Copyright SimpatiCorp 2024