Nostr client intended to be run on server for just one user
-
Create your
.env
filecp template.env .env
-
Paste your private key to the
.env
file -
Export the
.env
- the easies way is to install direnv which will do it automatically for you (you need to enable exporting.env
files) -
Install deps
mix deps.get
-
Start Phoenix server
mix phx.server
Client is GenServer
which upon startup spawns two DynamicSupervisor
s:
Connections
which supervises all active WebSocket connectionsSubscriptions
which supervises all active Nostr subscriptions
Each subscription is executed inside in one or more connections.
Each relay connection is sending received messages to corresponding subscription process which is handling de-duplication and sending it to handler process.
Each relay connection is identified by the URL and is concerned only with sending and receiving messages through WebSocket.
Subscription process is handling encoding/decoding.
flowchart TD
cli[Client]
conn[Connections]
subs[Subscriptions]
cli --> conn
cli --> subs
conn --> relay1
conn --> relay2
conn --> relay3
subs --> sub1
subs --> sub2
sub1 -.-> relay1
sub1 -.-> relay2
sub1 -.-> relay3
sub2 -.-> relay3