README.md 3.86 KB
Newer Older
Aral Balkan's avatar
Aral Balkan committed
1
2
3
4
# Hypha

An attempt at building a peer web.

Aral Balkan's avatar
Aral Balkan committed
5
6
7
8
## Status

![Nothing to see here. Please disperse](https://ar.al/nothing-to-see-here.gif)

9
10
11
__Just getting started.__

[Read this blog post](https://ar.al/2019/02/13/on-the-general-architecture-of-the-peer-web/) and see the [multiwriter-2](https://ar.al/2019/02/01/hypha-spike-multiwriter-2/) and [persistence-1](https://ar.al/2019/02/12/hypha-spike-persistence-1/) spikes to see where all this is heading.
Aral Balkan's avatar
Aral Balkan committed
12

13
14
15
16
17
18
19
20
## About

This repository contains three separate applications:

1. The Hypha [Untrusted Node](https://source.ind.ie/hypha/hypha/tree/master/untrusted).
2. The Hypha [Web Node](https://source.ind.ie/hypha/hypha/tree/master/web).
3. A Hypha Native Node implemented in Node.js (todo: add initial mock/scaffolding).

Aral Balkan's avatar
Aral Balkan committed
21
22
23
24
## Usage

Command                | Description                                      |
-----------------------|--------------------------------------------------|
25
26
27
`$ npm run development` | __Start in development mode.__ Uses [@hypha/web-compiler](https://source.ind.ie/hypha/tools/web-compiler) as middleware with live reload to dynamically build the web node on evert request and on source code updates. Serves the dynamically-generated web node alongside any dynamic HTTPS and WebSocket routes using locally-trusted [mkcert](https://github.com/FiloSottile/mkcert) TLS certificates seamlessly provisioned via [Nodecert](https://source.ind.ie/hypha/tools/nodecert).
`$ npm run production`  | __Start in production mode.__ Makes a static distribution build of the web node and serves it alongside any dynamic HTTPS and WebSocket routes using globally-trusted [Let’s Encrypt](https://letsencrypt.org) TLS certificates seamlessly provisioned via [ACME TLS](https://source.ind.ie/hypha/tools/acme-tls/).
`$ npm test`           | Lint, validate dependencies, and run tests.
28
29
`$ npm start`          | Alias for `npm run development`.
`$ npm run dev`        | Alias for `npm run development`.
30
31
32
33
34
35

### Advanced

Command                | Description                                      |
-----------------------|--------------------------------------------------|
`$ npm run development-global` | __Start development mode with globally-trusted TLS certificates.__ Useful alongside a TLS tunnel like [ngrok](https://ngrok.com/) for testing the app during development from other machines.
36
37
38
39
`$ npm run production-local`   | __Start in production mode with locally-trusted TLS certificates.__ Useful for testing the behaviour of the production run mode from your local development machine.
`$ npm run build`              | Compile all files into the `dist/` directory (as if in production) but do not start the untrusted node server.
`$ npm run inspect`            | Inspect the web node’s dependencies.
`$ npm run create`             | Generate a Choo scaffolding file for the web node.
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60

The Hypha untrusted node is a personal web server that is used for two things:

1. Deliver the Hypha web node (much like an App Store would deliver a native app)
2. Act as a dumb relay to bridge Hypha web and native nodes.

### Run modes and certificate scopes in detail

You can start the Hypha untrusted node in four ways based on the combination of two run modes and two certificate scope settings:

#### Run modes:

  - __development__: (default) uses @hypha/web-compiler as middleware with live reload

  - __production__: builds a static distribution and implements production optimisations

#### Certificate scopes:

  - __local__: (default for development mode) uses locally-trusted mkcert certificates seamlessly obtainted by Nodecert. The untrusted node can be reached without certificate warnings only from the machine you are testing from.

  - __global__: (default for production mode) uses globally-trusted Let’s Encrypt certificates seamlessly obtained by ACME TLS. The untrusted node can be reached without certificate warnings from any machine.
Aral Balkan's avatar
Aral Balkan committed
61
62
63
64

## License

[AGPLv3 or later](./LICENSE.md)