[RFC] Generate ActiveAdmin like pages #1166
Replies: 7 comments 8 replies
-
|
Hmm, if we exclude customizing, Prisma Studio behind auth is what you're looking for or did I miss your point (and that the whole idea of this is to make it customizable) |
Beta Was this translation helpful? Give feedback.
-
|
The DSL is what makes AA so good. With almost no code you get CRUD operations for all your models. I guess the biggest challenge here is to make it as easy as possible without losing flexibility |
Beta Was this translation helpful? Give feedback.
-
|
This sounds like it could be accomplished as an enhancement to the existing generate command. For instance, a blitz generate pages admin/products --layout AdminLayoutthen there wouldn't need to be a new command. |
Beta Was this translation helpful? Give feedback.
-
|
I like the idea of having How this would be solved? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @engelkes-finstreet, we definitely need something like this!! For most of my uses cases, I just want to deploy something basic like prisma studio along with my blitz app (single deployment with shared auth). Being able to generate and customize the code would be awesome addition when needed. It seems this could be really cool as a blitz plugin. By default, just installing the plugin would not generate code into your project, but it would dynamically inject all the admin pages and crud into your app at build time. This way the admin section is ALWAYS up to date with your prisma schema without changing anything (same as rails active admin). Then also have the ability to "eject" everything or certain parts into your app where you can customize. |
Beta Was this translation helpful? Give feedback.
-
|
For our use case the Admin Dashboard is wrapped in the same Layout and the users who are members of an Organisation have edit rights to update the info for that Organisation. We are building a company register web app where the details of every company are visible to the public and the directors and the founders of a company can login and change the details of that company. |
Beta Was this translation helpful? Give feedback.
-
|
I just posted a guide on How to Run Prisma Studio in Production on Render.com to function as an admin dashboard. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
One thing I love about Ruby on Rails is their ActiveAdmin. The ActiveAdmin is a separate part of the app which lets your admins manage all your models in a pretty simple way without writing too much boilerplate code.
Proposal
We basically generate all mutations right now anyways with
CREATE, UPDATE and DELETEand even create the pages. In my first try I added CREATE / EDIT / DELETE buttons inside my App and only made them visible to admins. A cleaner approach is a completely separate section where all of this is possible.Each App should get a folder structure like this
app/admin/pagesand inside this would be nearly an identical folder structure as we have it in our app right now/users/pages/[userSlug]/editand/users/pages/new... you get the idea.All of this could be wrapped in a separate Layout which is protected by the
useAuthorizehook. So the hook is only needed in one place and not all over your app.We could add a new
blitz generate admincommand which would create all the needed admin files.One thing which I do not like about ActiveAdmin is that it is kind of static. Doing something more fancy was mostly a pain in the $%@. Generating an ActiveAdmin for BlitzJS we could generate all forms but customizing this would be way easier.
Beta Was this translation helpful? Give feedback.
All reactions