README.md
August 10, 2026 ยท View on GitHub
๐ก๏ธ URBAC (Unified Role-Based Access Control)
The enterprise-grade full-stack boilerplate for NestJS, Angular, and TypeORM.
URBAC is a complete, production-ready boilerplate designed to help you scaffold secure, multi-level access control systems in minutes. It provides a flawless developer experience with a seeded PostgreSQL database, a powerful NestJS backend, and a dynamic Angular UI built with Optimus UI and Tailwind CSS.
โจ Core Features
- ๐ Hierarchical Group-Based RBAC: A clean
User -> Group -> Role -> Privilegearchitecture. - ๐ข Role Escalation: Strict level-based security. A Level 10 User cannot assign a Level 50 Admin role.
- ๐งฉ Dynamic Frontend: Custom Angular
*hasPermission="'action'"directives to automatically render or hide UI elements based on the user's active group context. - ๐ช Configurable Sign-Ups: Toggle public registrations via the
ALLOW_PUBLIC_SIGNUPenvironment variable. - โก Clean Structure: Fully decoupled NestJS backend and Angular frontend for easy deployment.
๐ Quick Start
Prerequisites: You need Node.js (v18+) and a running instance of PostgreSQL.
1. Clone the Repository
git clone [https://github.com/kasoir/urbac.git](https://github.com/kasoir/urbac.git)
cd urbac
2. Start the Backend (NestJS)
Navigate to the backend folder, install dependencies, and configure your database connection.
cd backend
npm install
cp .env.example .env
(Make sure to update the .env file with your local PostgreSQL credentials!) Seed your PostgreSQL database with the default roles and Super Admin account, then start the server:
npm run seed
npm run start:dev
The API is now running at http://localhost:3000/api.
3. Start the Frontend (Angular)
Open a new terminal tab, navigate to the frontend folder, and start the application.
cd frontend
npm install
npm start
The Angular UI is now running at http://localhost:4200.
๐ Default Credentials
The npm run seed command provisions a Super Admin account out of the box so you can immediately test the dashboard and role-management features.
| Password | Group | Role Level | |
|---|---|---|---|
| admin@urbac.com | Admin123! | Super Admins | 100 (Max) |
๐๏ธ Architecture & Database Schema
URBAC intentionally avoids complex three-way junction tables in favor of a clean, top-down administrative grouping model. This makes querying incredibly fast and the mental model easy to grasp:
1- Groups are administrative buckets (e.g., "Users", "Admins", "Super Admins").
2- Users are assigned to a Group.
3- Roles are assigned to a Group.
4- Privileges are attached to Roles.
// Example of protecting a NestJS Endpoint
@Post('create')
@RequirePermissions('user:create')
async createNewUser() { ... }
<!-- Example of dynamic UI rendering in Angular -->
<button *hasPermission="'user:delete'" class="p-button-danger">
Delete User
</button>
๐ฌ Community & Support
We are building this together! If you need help, want to share what you've built, or have ideas for new features, join us in the Discussions Tab.
๐ Found a bug? Please open an Issue.
๐ ๏ธ Want to contribute? Check out our CONTRIBUTING.md guide.
๐ License
URBAC is open-source software licensed under the MIT License.