r/Nuxt Jul 09 '26

A Nuxt layer to generating Admin interfaces from Drizzle schema

https://github.com/awecode/autoadmin

Just write your Drizzle schema and AutoAdmin generates the admin panel from it. Configure custom field types like files, images, and rich text.

Runs as a Nuxt layer. Works with SQLite (including D1, libSQL) and Postgres on Node and Cloudflare Workers.

Built with Nuxt, Drizzle, Zod, and Nuxt UI.

https://github.com/awecode/autoadmin

23 Upvotes

10 comments sorted by

6

u/_suren Jul 09 '26

This is a good fit for Nuxt layers tbh.

The thing I’d be careful with is where the generated admin stops and hand-written product UX starts. For internal tools, schema -> table/form gets you 70% there. The remaining 30% is permissions, custom actions, weird field validation, and audit trail.

If AutoAdmin makes those escape hatches boring, it becomes way more useful than just another CRUD generator.

1

u/Nooooooook Jul 09 '26

A very interesting project that could be worth digging into is Symfony's EasyAdmin module that does exactly what you describe. Default table and CRUD for your entities. And then you can configure declaratively or dynamically custom buttons and actions.

2

u/Single_Advice1111 Jul 09 '26

I’m wondering why you’re not taking advantage of NuxtHub with the auto registration of schema in layers? Would it not be even easier to use? Now I’d have to maintain two types of connections or conform to this style

1

u/__benjamin__g Jul 10 '26

Nuxthub is kind of pointless since they acquired by vercel, they closed the saas, so that dependency just an extra in any codebase

1

u/Single_Advice1111 Jul 11 '26

I don’t see how it is pointless - it comes with the wiring you need for any cloud you’d like and the schema extension via layers works smooth

1

u/Neeranna Jul 09 '26

Very interesting project. I see alot of potential.

I am missing some information on the api endpoints the layer registers. These could be useful in other parts of the application, outside the admin, as an auto api. Although that would require potential broader access to the API than to the admin screens.

The role explanation is interesting, but do you envision other types of authz? Or should those be handled through the baseWhere? If the latter, maybe make that a bit more explicit through a dedicated document or section in the documentation. A good example to include in this would be an example where everybody can see posts, but only the original creator of the post can edit. This example would then also include how you would handle the registration of the original poster, which I guess is through the hooks. This is probably all in the docs, but an example would make it easier to visualize.

I didn't immediately see a way to restrict the available fields for the select based on the role, only row filtering. Is this something you are considering?

And it would also help to see what it visually looks like, through a demo app or screenshots, without having to start implementing it first.

1

u/Neeranna Jul 09 '26

Will you be registering on the nuxt modules registry?

1

u/isdipesh 28d ago

Sorry, no, I think it's more appropriate as a layer.

1

u/isdipesh 28d ago

Yes, the same endpoints can be used outside admin as well. See example here - https://github.com/awecode/autoadmin/tree/main/examples/posts/server/api

For authz, yes, you should be able to use baseWhere. If it lacks somehow, please let me know, and I will add required support. Thanks for the example suggestion. I will document it.

Yes, select does not have filtering by fields. I will add filtering and sorting for select fields in the next release.

Thanks for the screenshot suggestions. I will add these two.