Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebUI to manage OrbitDB and databases #243

Open
haadcode opened this issue Nov 5, 2017 · 13 comments
Open

WebUI to manage OrbitDB and databases #243

haadcode opened this issue Nov 5, 2017 · 13 comments

Comments

@haadcode
Copy link
Member

haadcode commented Nov 5, 2017

OrbitDB should have a WebUI app through which OrbitDB instance can be managed.

This would include:

  • Create new databases
  • Query databases
  • Add databases to replicate
  • Network and connection status
  • Display database information, such as: data directory info, keys, size (bytes or entries), replication status, etc.

At the moment, as we don't have a daemon nor http server, this could simply be a browser app where OrbitDB is embedded. Later on, we can serve the WebUI via a daemon or http server and connect to and manage a "backend / server" instance of OrbitDB.

This is a fairly large task but also not hugely complicated and would be a great task for someone looking to contribute in a big and meaningful way! If you want to work on it, comment here.

@therebelrobot
Copy link

Excellent work going on here! it's pretty similar to the work I wanted to get rolling for Code for San Francisco, but never was able to get off the ground.

As for this Web UI, building it out seems like it'd be dependent on a functioning HTTP server for the frontend to interact with (so long as you want the ui and api decoupled, which would make the most sense for this, imo, then it wouldn't matter what you build the frontend in: React, angular, jquery, swift, whatever), so would this be dependent on #233?

Additionally, some additional requirements would need to be defined, like what devices this should be accessible on for the mvp, if there are any framework restrictions, etc. I'd be happy to take a look at helping out with coding in some spare time on the weekend, as well as code reviews during the week.

@haadcode
Copy link
Member Author

@therebelrobot thanks for jumping in and sharing your thoughts!

There's not much design for this yet, so I'd be happy with whatever the implementor decides to use here. Couple of personal preferences and thoughts around it:

  • This will be a fairly extensive app (eventually) in terms of the frontend, so using a framework would make sense. I personally like React and would love to use it, but I'd be fine with other well-known frameworks as well. Whatever you're comfortable with.
  • I think we could get an MVP without the HTTP API: OrbitDB can be embedded into a browser app just like any other module. When embedded, the databases get created in the browser's storage just the same as they would on a filesystem (same for IPFS). So what we can do to get started, is to manage databases "local-to-browser". We'd be able to create, modify and replicate the databases between two browsers just as they would between two Nodejs/http-api instances of OrbitDB. Here's an example how OrbitDB can be embedded to a browser app.
  • As you propose @therebelrobot, we should definitely separate the layer that interacts with the http-api or the (embedded) OrbitDB instance. If we start with the embedded OrbitDB instance and separate that, we can later replace db.add("hello") with fetch("http://localhost:37373/add/<database_address>/ and it should work all the same.
  • Platforms: the cool thing about js-ipfs is that it works both in the browser and in Node.js. And with the browser version, we can run it on any OS and platform that has a browser, including mobile devices! :) So if we go with the embedded approach, we would have the MVP running on mobile devices too without any extra effort, which would be really cool imo.

Hope this helps! Let me know if you have more questions, suggestions, ideas or otherwise want to explore further 😄

Or if you have the motivation and time to work on this, I'd be more than happy to help you get started and otherwise. #orbitdb on IRC (Freenode) would be the best way to chat in real-time.

@haadcode haadcode changed the title WebUI WebUI to manage OrbitDB and databases Nov 20, 2018
@dnoishi
Copy link
Member

dnoishi commented Apr 15, 2019

Hello, @haadcode @RichardLitt I would like to work on this if you guys approve it!

@RichardLitt
Copy link
Member

Awesome! Yeah, we'd love for you to help out. You're already an old hand from your other repo; if you need to ask general questions, Gitter (which it looks like you joined recently?) is probably the best place. :) All systems go.

@dnoishi
Copy link
Member

dnoishi commented Apr 15, 2019

Thank you @RichardLitt! I'll begin to work based on the message that @haadcode wrote above if I have any question I'll let you know! Thanks!!

@phillmac
Copy link
Member

phillmac commented May 9, 2019

@natachadelarosa Did you end up making any progress with this?

@dnoishi
Copy link
Member

dnoishi commented Jun 23, 2020

@phillmac @RichardLitt I'm so sorry this just fell out completely for me. A lot of things happened, do you mind if I start again on this?

@aphelionz
Copy link
Member

Ah, good news @natachadelarosa! You don't have to start from scratch. Check out: https://github.com/orbitdb/orbit-db-control-center

@RichardLitt
Copy link
Member

It's alright, @natachadelarosa! Thanks for following up, regardless. :)

@phillmac
Copy link
Member

@natachadelarosa Life happens to all of us; I'm certainly no exception. 😁 One of the goals I had in mind was to create a front end for the http api as a sort of control panel, an alternative to running a full node in browser. I've not gotten very far at all with it . One of the intermediate goals was to create a drop in replacement for the orbit-db- package that was 100% compatible, instead backed by the api. I'd still like to have a go at both of these 😁

@dnoishi
Copy link
Member

dnoishi commented Jun 24, 2020

Sounds great @phillmac! I'll go with the HTTP API front-end!

@phillmac
Copy link
Member

phillmac commented Jun 24, 2020

Ok so here's the state of things, orbitdb/orbit-db-http-api is quite outdated and has a few silly bugs in it. however it's mostly working. I really need to update it.
phillmac/orbit-db-http-api-dev is my own fork with a lot of non-standard features for debugging / manipulating the base orbit-db instance. On the other hand It's reasonably up to-date
Usually I fix bugs as quickly as I can however its definitely to be considered 'unstable' and I end up completely breaking it on occasion
There's respective docker images here:

https://hub.docker.com/r/orbitdb/orbit-db-http-api

and here:

https://hub.docker.com/r/phillmac/orbit-db-http-api-dev

if they're any use to you.
Here's an example docker-compose.yml:

orbitdb-archive/orbit-db-http-api#26 (comment)

Here's an example with external ssl via lets'encrypt, certbot & nginx

https://github.com/phillmac/compose-example-orbit-db-http-api

Please do let me know what I can help with esp. if you run into a bug or something doesn't make sense

@nicocossiom
Copy link

nicocossiom commented Oct 24, 2023

Commenting on this issue to let anyone that might be interested: I am writing an RPC server for Orbitdb based on the ConnectRPC framework from Buff.build. It will be written in Typescript and should hopefully cover most use cases by providing native code clients for:

  • Browser
  • Node
  • Go
  • Swift
  • Kotlin

While also being accesible through Buf Studio to try, applications like Postman as well as normal HTTP/2 request using CURL or whatever http client.

My hope is that after doing this is building a webui similar to the old OrbitDB Control Center. The RPC daemon is a necessary step towards this since OrbitDB instances can't share the same directory concurrently for locking issues reasons.

This is the repo for the RPC daemon and the service declaration schema hosted on Buf.build.

I am still in the early implementation since I had to create typings for the Orbitdb package manually since 1.0 had breaking changes with the community typings. Any advice, PRs, issues, etc is welcome. At some point I hope the orbitdb team makes it a package usable from @orbitdb/rpc or something similar, as well as the UI with @orbitdb/webui. Let's see where I can get to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants