bestia-dev / cargo_crev_web

web server to query reviews from cargo-crev
https://lucianobestia.github.io/cargo_crev_web
MIT License
8 stars 0 forks source link

the plan #13

Closed bestia-dev closed 3 years ago

bestia-dev commented 4 years ago

So my plan is this: a developer will first install cargo-crev on his local machine. The user interface through the text terminal is sometimes great, but sometimes not. Then he will installs the cargo_crev_web server on his local machine. Then he uses the browser to open it like: http://127.0.0.1:8051/rust-creviews/ And he can see all his local crev data in the browser. Nice. You can already try that.

He can use it also remotely. For example I have Win10 + WSL Linux. All rust things are in Linux, but the GUI VSCode is in Win10. I have the web server running on Linux and the browser in windows. Works like a charm.

The long-term goal: I am now working on a GUI interface to write a new review inside the browser. On the local machine the web-server could run cargo-lib commands. So cargo-crev would have a cross-platform universal front-end GUI interface in the browser. It opens a lot of possibilities.

The same server is now running on the web. There I cannot use any cargo-lib commands. After the user writes the review I will create a yaml text that the developer can copy/paste in VIM when using $ cargo crev crate review {crate_name}. That will make it easier for many people to write reviews. Work in progress: https://bestia.dev/cargo_crev_web/review_new @dpc, I have in plan also to ask you if is possible to run a crev command to create a review from a file. In that case the developer can download his yaml file from the web and add his review to his repo easily. I would like to hear your thoughts about this.

dpc commented 4 years ago

Ping @kornelski .

You really want to use crev-lib, and not run cargo-crev as commands then. The exactly interface of cargo-crev CLI can still need to change a lot.

The same server is now running on the web. There I cannot use any cargo-lib commands.

I don't understand this one.

I think being able to easily, locally run this web UI locally is a great idea. Especially stuff like browsing stats and reviews can benefit a lot from a rich, clickable, interactive interface, and is constrained by the text output.

I don't know about the proof creation, but it doesn't hurt too. If the user is running it locally the UI could totally create signed proofs.

I have in plan also to ask you if is possible to run a crev command to create a review from a file.

There is already cargo crev repo import that is almost like it, and fine with adding any new command to help . I was thinking about cargo crev proof sign for signing arbitrary data with the given ID anyway.

But I think you would benefit a lot if you created this reviews programmatically via crev-lib. Then you could add some meta-information

kornelski commented 4 years ago

Yeah, crev-lib is the way to go. It's quite easy to use:

https://gitlab.com/crates.rs/crates.rs/-/blob/master/creviews/src/lib.rs https://gitlab.com/crates.rs/crates.rs/-/blob/master/front_end/templates/crev.rs.html

bestia-dev commented 4 years ago

The same server is now running on the web. >There I cannot use any cargo-lib commands. I forgot to write that on the web I cannot use the private key of the developer. It is only on his local machine.

bestia-dev commented 4 years ago

Yeah, crev-lib is the way to go. It's quite easy to use:

I will absolutely use it. I just need some more time to explore some Rust basics to learn. It's a lot to learn. I'm coming from C# and SQL world from Windows. And I'm wasting so much time it's incredible. I resist not loosing my mind only because Rust is a so amazing language. And I am on a long vacation for 1 year. And there is this lock-down now in India and I am stuck in the guesthouse. But my pain points:

Sorry for that stream of complaints. I cannot talk about this to my neighbors in the guesthouse. I will stop right now.

bestia-dev commented 4 years ago

I didn't mention the super slow (horrific latency) and unreliable connection to internet over a mobile mifi router. I am stopping it right now ;-)

bestia-dev commented 4 years ago

It would be easy to make a GUI to copy an old review to a new version with the possibility of editing. If I know the ID, I can filter and show all the versions that need a refreshed review for new version.

dpc commented 4 years ago

These are all important practical problems. I can give some opinions, but you should not shy away from just asking on user forums like https://users.rust-lang.org/ for advise. Especially the auto-completion should work reliably. It must be just some configuration error somewhere.

I personally use rust-analyzer LSP server in a weird text editor I use (kakoune) and it works OK. crev-lib is a bit on a heavy side, since it pulls in ssh and git and some crypto stuff, but it's not too bad, I think.

I use Linux everywhere.

I compile stuff on my desktop that I ssh to from basically any laptop. Compile times are not perfect, but also not terrible. If you setup something like sshfs than you potentially compile on desktop and seamlessly run on laptop too, but for a web-app it's usually OK just to run and connect to remotely.

It's just my preference, but I use debuggers only as a last resort, and dbg! and logging usually get me where I want to be much faster. And when I need a debugger I just do gdb remotely on a machine that I'm running stuff. gdb is really, really a good investement to learn. It might seem odd and scary, but it's just a couple of commands, works everywhere, can easilly be run remotely through ssh, and so on.