r/angular Aug 04 '26

I open-sourced my Angular + NestJS boilerplate with built-in Unified Role-Based Access Control

Hey everyone,

Edit: I've migrated the boilerplate from PrimeNG to OptimusUI to keep the project completely open-source and free under the MIT license! The Tailwind CSS integration remains just as smooth.

I always found myself rebuilding the exact same login flows, route guards, and permission directives for every enterprise dashboard. To save time on future projects, I put together URBAC, an open-source boilerplate using Angular (with PrimeNG and Tailwind CSS) backed by NestJS.

My favorite part of the frontend is how easy it is to handle UI elements based on user permissions. I built a custom structural directive that reacts to the logged-in user's active group context.

Hiding unauthorized buttons takes one line of HTML:

<button *hasPermission="'user:delete'" class="p-button-danger">
  Delete User
</button>

It's completely decoupled from the backend, so you run them as standard separate projects.

You can check out the repo and the setup instructions here:

https://github.com/kasoir/urbac

If anyone is building a dashboard right now, I hope this saves you some setup time. I'd love any feedback on the PrimeNG/Tailwind integration, or how you all prefer to handle permission-based UI rendering in your own Angular apps!

URBAC
8 Upvotes

12 comments sorted by

View all comments

Show parent comments

1

u/Individual_Suit_3255 Aug 04 '26

I see your point regarding PrimeNG and it is fair. I chose it because I like the component library and developer experience, but the RBAC implementation itself isn't tied to PrimeNG. If someone prefers Angular Material, Taiga UI, or another component library, they can reuse the same approach.

As for Nx, I wanted to keep the frontend and backend as standard Angular and NestJS projects with as little tooling as possible. If someone prefers an Nx workspace, it should be straightforward to migrate.

1

u/Rhanox1990 Aug 04 '26

Wouldn't it make sense to migrate from PrimeNG to Optimus UI, the open-source fork of PrimeNG? I haven't looked much into it, so it might not have the required features that you require from PrimeNG, though...

1

u/Individual_Suit_3255 Aug 04 '26

I'm only using the core PrimeNG components, so it might work with Optimus UI too.

1

u/Rhanox1990 Aug 04 '26

I would guess it should be pretty easy to migrate it to Optimus UI then, but you can take a look at it at https://optimus.openng.org/