Skip to content

Basith-08/AuthForge

Repository files navigation

AuthForge: Laravel 12 RBAC Starter Kit

1. High-level Explanation

AuthForge is a production-grade, modular RBAC starter kit built on Laravel 12. To ensure high maintainability, it avoids the standard Laravel directory bloat by segregating logic into the app/Modules/RBAC namespace. This kit provides a complete dashboard for managing Users, Roles, and Permissions with real-time UI interactions powered by Alpine.js.

2. Technical Stack

  • Framework: Laravel 12 (PHP 8.3)
  • Database: PostgreSQL (Docker-based)
  • Frontend: Blade Templates + Alpine.js (Lightweight Interactivity)
  • Styling: Tailwind CSS (Lucid & Modern UI)
  • Virtualization: Docker & Docker Compose (Nginx + PHP-FPM + Postgres)

3. Modular Folder Structure

app/Modules/RBAC/
├── Actions/           # Pure business logic (e.g., CreateRoleAction, AssignRoleAction)
├── Controllers/       # Thin orchestrators (RoleController, UserController, PermissionController)
├── Models/            # Database entities (Role, Permission)
├── Traits/            # Shared logic (HasRolesAndPermissions on User model)
└── ...

4. Key Features

  • Dynamic RBAC: Create permissions and roles on the fly via the dashboard.
  • Permission Middleware: Route-level protection using permission:resource.action.
  • Super Admin Gate: Instant access for super-admin role via Gate::before.
  • Modern Login Flow: Beautiful, secure, and responsive custom login interface.
  • Docker Ready: One-command setup for the entire development environment.

5. Getting Started

Prerequisites

  • Docker & Docker Compose installed.

Installation

  1. Clone the repository.
  2. Run the environment setup:
    docker compose up -d
  3. Run migrations and seeders:
    docker compose exec app php artisan migrate:fresh --seed
  4. Access the dashboard at http://localhost:8000/login.
    • User: superadmin@example.com
    • Password: password

6. Architecture Decisions

  • Thin Controllers: Controllers only handle requests and responses; all logic resides in Actions.
  • Alpine.js Modals: Zero page reloads for CRUD operations while maintaining a server-side rendered (SSR) core.
  • PostgreSQL: Chosen for its robust support for relational integrity and industrial throughput.

AuthForge © 2026. Built for scalability.

About

AuthForge is a production-grade, modular RBAC starter kit built on Laravel 12. To ensure high maintainability, it avoids the standard Laravel directory bloat by segregating logic into the app/Modules/RBAC namespace. This kit provides a complete dashboard for managing Users, Roles, and Permissions with real-time UI interactions powered by Alpine.js.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages