Closed rolznz closed 9 months ago
@bumi @im-adithya do you have any thoughts here? does the general idea sound good to you?
Yes, awesome!
I don't think we need a second service.
The go server would simply serve the static files for the frontend.
So we expose a JSON API for:
/apps
- listing app connections/apps
- creating an app connection/apps/:id
- show app connection details/apps/:id
- delete an app connectionand move the UI into a react application that consumes this API.
Some thoughts (needs review):
https://medium.com/@pavelfokin/how-to-embed-react-app-into-go-binary-12905d5963f0 this looks like maybe an option for the go side ? (@im-adithya to see if it works or something else needed for the bundling as a desktop app: https://github.com/getAlby/nostr-wallet-connect/issues/185)
Then we could try a vite template with (create-vite using react-swc-ts template https://vitejs.dev/guide/) https://vitejs.dev/guide/static-deploy.html - the dist folder should be ignored in github and we need to make sure we compile it somehow to make sure it works on umbrel
I would try that first so we have a skeleton app and make sure the go app can serve both the HTML and run its normal backend services and new JSON API simultaneously.
Then we can add tailwind and other react libraries and routing, etc. as a followup step?
And thus was born https://github.com/getAlby/nostr-wallet-connect-next :rocket:
A simple React (or other frontend framework) app can then talk to the NWC backend. This simplifies the go app (which the frontend is hard to maintain with a lot of custom JS) and enables other apps (like getalby.com) to embed their own NWC UI directly rather than directing users to a separate application.
For Umbrel we should be able to add a second service to the docker-compose.yml: https://github.com/getAlby/umbrel-community-app-store/blob/master/alby-nostr-wallet-connect/docker-compose.yml
Another approach would be to integrate it into the existing container: