loco-rs / loco

🚂 🦀 The one-person framework for Rust for side-projects and startups
https://loco.rs
Apache License 2.0
5.44k stars 235 forks source link

Admin site #819

Open alper opened 1 month ago

alper commented 1 month ago

Hi! I think a lot of people want to know whether an autogenerated admin site is in the cards for this. It's a huge feature that makes a lot of difference when getting something off the ground.

(A lot of the views on the site I'm working on right now would have been unnecessary if there had been something of an admin).

jondot commented 1 month ago

You're correct. the big question is, what UI to use on the admin. API and backend is really not a problem. We would need 2 things:

  1. UI that is flexible and can map into types and data structs
  2. A way to describe (probably because this is Rust, in compile time) the data contracts so that the UI can be generated from it
Sillyvan commented 1 month ago

The Apis are the important part here imo. Together with the OpenAPI implementation it will be fairly easy to implement yourself no matter if you do backend templating or use a frontend framework. I think it’s too early to generate Ui parts.

darricheng commented 1 month ago

I agree with @Sillyvan here. I think focusing our efforts on getting the API generation right is more important than creating a frontend first.

I think there can be lots of opinions on how the frontend should be created, but all that is easier to handle once we have a robust API.

I think going with the API generation first should also allow us to get a part of this feature out sooner? I.e. an endpoint for admins to access. At least in my mind I think it should be simpler than creating a proper UI generation framework that would work across all data types.