This WIP uses svelte as GUI and golang and postgresql as backend.
Inspiration is taken from algia and gnost-relay. And biggest thanks goes to fiatjaf go-nostr for making life easier.
My goal is first of all to learn go better and to make a kind of twitter/X clone where you can use to read notes in peace, without getting distracted with the stream and flow of data. Maybe later i will add more features like zap and such. It is not my goal to make it mobile or running everywhere. It will always be a desktop app running locally, so you stay in control.
You need go version 1.20 and npm version 9.1 to build the source. If you want the translate function, you will also need to install libretranslate. This is a python app which means you will have to install python as well.
The server uses postgresql version > 15 as backend. The postgresql installer does not work (LC_ALL) error. On windows you can either use wsl2 or msys2. For linux it is straight forward.
git clone https://github.com/amavis442/nostr-reader.git
This needs git installed or get the zip from github.
cd src
go build . // will build nostr-reader
cd web/nostr-reader
npm install
npm run build // will build the front-end
This will get the packages and build the frontend. The front-end will be stored in the web/nostr-reader/dist folder.
Minimal configuration. Need to be at ~/.config/nostr-reader/config.json or in
// <UserDir>/AppData/Roaming/nostr-reader/config.json
{
"database": {
"user": "xxxxx",
"password": "xxxxxx",
"dbname": "xxxxxx",
"port": 5432,
"host": "localhost"
},
"server": {
"port": 8080,
"frontend": "../web/nostr-reader/dist"
},
"nostr": {
"privatekey": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
"nip05": "https://nostrcheck.me/"
}
}
Private key can also start with nsec and it will have the form of nsecXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#web/nostr-reader/.env.local
VITE_API_LINK=http://localhost:8080 // change this port to the same port as in config.json under server : {port: 8080}
VITE_APP_TRANSLATE_URL=http://translate.local/translate // leave this empty if you do not want to use libretranslate service
VITE_APP_MODE=dev // set to prod for production
VITE_APP_TRANSLATE_LANG=nl // set to eng for English
If you want to change the server port (8080) into something else because of a conflict, then you need to rebuild the front-end. Set the port in .env.local with VITE_API_LINK and run npm run build
Start nostr-reader.exe, make sure you have a valid config.json with at least your private key. Also start the postgresql server on the standard port or change that in the config file.
In browser goto http://localhost:8080/. If you want to set another port then change that in config.json and in .env.local and rebuild the server and the frontend.
The server takes a get data from the relays every 5 minutes. This is to make sure the relays are not getting stressed and you can read the notes in peace without flashing streams.
MIT