dev / templates / app-cljs-live / README.md
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# __NAME__

TODO: one line on what __NAME__ is — live at
**[__HOST__](https://__HOST__)**, repo published at
**[git.ardegazu.ro/__SUB__](https://git.ardegazu.ro/__SUB__)**.

TODO: a short paragraph on what it does and why. Installable PWA, safe-area
aware, works from any static file host.

## Architecture

- **No server.** Browsers are [js-libp2p](https://libp2p.io) peers: they meet
  through a circuit-relay-v2 node, upgrade to direct WebRTC, and speak a
  room-scoped protocol under [`client/src/…/net/`](client/src/). Rooms are
  keyed by a secret in the URL fragment — membership is proved pairwise with a
  sealed hello, and every frame is end-to-end encrypted by libp2p's noise
  layer. The app only adds a typed wire protocol and its own logic in
  `client/src/…/game/`.
- **ClojureScript, shadow-cljs builds** (deps.edn classpath, exact-pinned
  compiler pair). `npm run dev` watches on :5173, `npm run build` produces a
  static `client/dist/` with relative asset paths. The vendored `net/`,
  `id/boot.cljs` and `i18n/runtime.cljs` are byte-identical to the canon
  (game1) modulo the namespace substitution plus the one protocol-prefix
  line — never edit them here; fixes happen in game1 and replicate.
- **Hosting without an origin server.** `client/dist/` is pinned to IPFS,
  named by IPNS and served straight from the gateway on the app's own domain
  (DNSLink). The published repo works the same way (`deploy/publish-repo.sh`
  + the shared `git.ardegazu.ro` source root).

## Develop

```bash
cd client && npm install && npm run dev   # http://localhost:5173
```

(needs JVM ≥ 17 + the clojure CLI for shadow-cljs; `deps.edn` carries a
`:dev` alias with cider-nrepl, so `cider-jack-in-cljs` works out of the box)

Open two tabs on the same `#room` URL to talk to yourself. From the suite
workspace, `ardz dev __SUB__` does the same (and `ardz relay` runs a local
dev relay on :9090).

## Deploy

```bash
ardz build __SUB__          # shadow-cljs release + workbox → client/dist
ardz release __SUB__        # pin to IPFS, publish the IPNS name
ardz publish-src __SUB__    # anonymity-gated source mirror → git.ardegazu.ro
```

Clone: `git clone https://git.ardegazu.ro/__SUB__.git`

MIT — see [LICENSE](LICENSE).

static mirror of HEAD · about · clone: git clone https://git.ardegazu.ro/dev.git