Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' of https://github.com/gmrms/nipsr into main
Browse files Browse the repository at this point in the history
  • Loading branch information
morum committed Mar 14, 2023
2 parents e34c5e5 + aac75a0 commit 0ab403b
Showing 1 changed file with 13 additions and 35 deletions.
48 changes: 13 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Nipsr

This is a distributed Nostr relay implementation using Quarkus and Kotlin.
This is a distributed Nostr relay implementation using [Quarkus](https://quarkus.io/) and Kotlin for the server and [Astro](https://astro.build) for the client.

## NIPs

- [X] NIP-01 - Basic protocol flow description
- [X] NIP-02 - Contact List and Petnames
- [ ] NIP-05 - Mapping Nostr keys to DNS-based internet identifiers
- [X] NIP-05 - Mapping Nostr keys to DNS-based internet identifiers
- [X] NIP-09 - Event Deletion
- [X] NIP-11 - Relay Information Document
- [X] NIP-12 - Generic Tag Queries
Expand All @@ -20,54 +20,32 @@ This is a distributed Nostr relay implementation using Quarkus and Kotlin.

### Nipsr

#### Server
- **Relay** - Websocket server that handles the communication with Nostr clients
- **Processor** - Consumes the events from the relay and handles database persistence
- **Management** - Manages users data like NIP-05 identifiers and relay access
- **Payload** - Contains the data model and the serialization/deserialization logic

### Additional technologies
#### Client
- **Client** - Frontend client for NIP-05 identifier registration

#### Additional technologies

- **Nginx** - Reverse proxy server
- **RabbitMQ** - Message broker
- **MongoDB** - Primary database
- ~~**Redis** - Cache database~~ (to be implemented)

## Quickstart

You can always run a _non-containerized_ version of every software but the following guides assume you have Docker installed
to run the broker and database.

### Local

There are two ways to run the application locally:
1. Using the pre-built images with `docker-compose-local.yml` (only needs docker)
2. Building the containers from source with `docker-compose-dev.yml` (needs java installed)

The fastest way is to run with the pre-built images, but for development purposes you might want to build from source.
You can always run a _non-containerized_ version of every software but the following guides assume you have Docker installed to run the broker and database.

#### Building the containers from source
1. Package the application `./mvnw package`
1. Package applications on `server` with `./mvnw package`
2. Enter the `local` directory.
3. Start docker compose `docker compose -f docker-compose-dev.yml up` or `docker-compose -f docker-compose-dev.yml up`
depending on your docker version.

#### Using the pre-built images
1. Enter the `local` directory.
2. Start docker compose `docker compose -f docker-compose-local.yml up` or `docker-compose -f docker-compose-local.yml up`
depending on your docker version.

With either of those you application should be accessible at `ws://localhost`.

#### Running Nipsr without docker

1. Install, configure and start Nginx (optional), RabbitMQ and MongoDB. (not covered here)
2. Package the application `./mvnw install`.
3. You must configure the environment variables according to the files in `/local/env/`.
4. In both `relay` and `processor` directories: run `./mvnw quarkus:dev` to start the relay application in development
mode or `java -jar target/quarkus-app/quarkus-run.jar` to run the app jar.
3. Start docker compose `docker compose up` or `docker-compose up` depending on your docker version.

If the ports were not changed, the relay should be accessible at `ws://localhost:8080` and the processor at `http://localhost:8088`
although the processor currently has no endpoints.
Now the application should be accessible at `ws://localhost` for the relay websocker endpoint and `http://localhost:8080` for the client and management api.

### Production
## Production Setup

_TODO_

0 comments on commit 0ab403b

Please sign in to comment.