{"id":19060304,"url":"https://github.com/sgiath/nostr-private-server","last_synced_at":"2025-04-24T06:51:45.128Z","repository":{"id":65321473,"uuid":"585136016","full_name":"Sgiath/nostr-private-server","owner":"Sgiath","description":"Nostr private relay implementation","archived":false,"fork":false,"pushed_at":"2024-03-10T23:19:20.000Z","size":129,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T06:51:41.813Z","etag":null,"topics":["elixir","elixir-phoenix","nostr","websockets"],"latest_commit_sha":null,"homepage":"https://sgiath.dev/libraries#nostr","language":"Elixir","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Sgiath.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2023-01-04T12:11:04.000Z","updated_at":"2024-10-25T07:18:56.000Z","dependencies_parsed_at":"2023-02-14T08:16:29.531Z","dependency_job_id":null,"html_url":"https://github.com/Sgiath/nostr-private-server","commit_stats":null,"previous_names":["sgiath/nostr-private-server"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sgiath%2Fnostr-private-server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sgiath%2Fnostr-private-server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sgiath%2Fnostr-private-server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sgiath%2Fnostr-private-server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sgiath","download_url":"https://codeload.github.com/Sgiath/nostr-private-server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250580713,"owners_count":21453531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elixir","elixir-phoenix","nostr","websockets"],"created_at":"2024-11-09T00:14:29.717Z","updated_at":"2025-04-24T06:51:45.107Z","avatar_url":"https://github.com/Sgiath.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nostr\n\nNostr client intended to be run on server for just one user\n\n## How to run\n\n1. Create your `.env` file\n\n   ```bash\n   cp template.env .env\n   ```\n\n2. Paste your private key to the `.env` file\n3. Export the `.env` - the easies way is to install [direnv](https://direnv.net/) which will do it\n   automatically for you (you need to\n   [enable](https://direnv.net/man/direnv.toml.1.html#codeloaddotenvcode) exporting `.env` files)\n4. Install deps `mix deps.get`\n5. Start Phoenix server `mix phx.server`\n6. Go to \u003chttp://localhost:4000/nostr\u003e\n\n## Supervision tree\n\n### Client\n\nClient is `GenServer` which upon startup spawns two `DynamicSupervisor`s:\n\n- `Connections` which supervises all active WebSocket connections\n- `Subscriptions` which supervises all active Nostr subscriptions\n\nEach subscription is executed inside in one or more connections.\n\nEach relay connection is sending received messages to corresponding subscription process which is\nhandling de-duplication and sending it to handler process.\n\nEach relay connection is identified by the URL and is concerned only with sending and receiving\nmessages through WebSocket.\n\nSubscription process is handling encoding/decoding.\n\n```mermaid\nflowchart TD\n  cli[Client]\n  conn[Connections]\n  subs[Subscriptions]\n\n  cli --\u003e conn\n  cli --\u003e subs\n\n  conn --\u003e relay1\n  conn --\u003e relay2\n  conn --\u003e relay3\n\n  subs --\u003e sub1\n  subs --\u003e sub2\n\n  sub1 -.-\u003e relay1\n  sub1 -.-\u003e relay2\n  sub1 -.-\u003e relay3\n  sub2 -.-\u003e relay3\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgiath%2Fnostr-private-server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgiath%2Fnostr-private-server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgiath%2Fnostr-private-server/lists"}