Posts

Introducing NertiaKit: A Modern Laravel SaaS Starter Kit

February 22, 2025
QR Ticketify logo
Today, I'm excited to share a project that I've been working on — NertiaKit, a modern starter kit designed to streamline the development of SaaS applications using Laravel and Inertia.js. This project emerged from my experiences building multiple SaaS applications and recognizing common patterns and challenges that developers face. Every SaaS project starts with the same foundational requirements: authentication, user management, role-based access control, and a solid frontend architecture. I found myself repeatedly setting up these components, and I thought, "There must be a better way." That's how NertiaKit was born — a solution to help developers jump straight into building their unique features instead of spending weeks on boilerplate code. While there are many starter kits available, NertiaKit focuses on providing a clean, minimalistic foundation with modern tools and best practices. Here's what makes it special:
  • Laravel 11 for a robust backend
  • Inertia.js + React for seamless SPA experience
  • TypeScript for better type safety
  • ShadcnUI for beautiful, accessible components
  • TailwindCSS for responsive styling
The real magic of NertiaKit lies in its developer experience. I've included features that I wish I had when starting my SaaS projects:
  • Pre-configured layouts for authenticated and guest views
  • Type-safe data sharing between Laravel and React
  • Role-based navigation system
  • Organized route and controller structure
  • Comprehensive type definitions
  • Hot module replacement in development
Here's a quick look at how NertiaKit handles shared data between backend and frontend:
const { auth, app } = usePage<PageProps>().props;

return (
    <div>
        <h1>{app.name}</h1>
        {auth.user && <p>Welcome, {auth.user.name}</p>}
    </div>
);
The type system ensures that you'll catch errors early:
export type PageProps<T = {}> = T & {
    auth: { user: User };
    app: {
        name: string;
        tagline: string;
    };
    flash: {
        success?: string;
        error?: string;
    };
};
NertiaKit implements role-based access control using Spatie's Laravel Permission package. This provides a flexible way to manage user permissions:
// database/seeders/RoleSeeder.php
public function run(): void
{
    Role::create(['name' => 'admin']);
    Role::create(['name' => 'user']);
}

// Assigning roles on registration
$user->assignRole('user');
The navigation system is built with role-based access in mind:
const navigation = [
    {
        title: 'Dashboard',
        url: route('dashboard'),
        icon: LayoutDashboard,
        isActive: route().current('dashboard')
    },
    {
        title: 'Users',
        url: route('admin.users.index'),
        icon: Users,
        isActive: route().current('admin.users.*'),
        viewBy: 'admin'
    }
];
Routes are organized by access level for better maintainability:
// routes/admin.php
Route::middleware(['auth', 'role:admin'])
    ->prefix('admin')
    ->name('admin.')
    ->group(function () {
        Route::resource('users', UserController::class);
    });
Using NertiaKit is straightforward. You can either use it as a template or fork and customize:
  1. Click "Use this template" on GitHub
  2. Create your repository
  3. Clone and setup:
git clone https://github.com/your-username/your-project.git
cd your-project

composer install
npm install
npm run dev

cp .env.example .env
php artisan key:generate
php artisan migrate --seed
Fork the repository and follow the same setup steps. The default admin credentials are:
  • Email: admin@example.com
  • Password: password
NertiaKit is actively maintained and new features are being added regularly. Planned enhancements include:
  • API authentication setup
  • More UI components and layouts
  • Enhanced testing setup
  • Additional role presets
  • Improved documentation
I hope NertiaKit helps you build your next SaaS project faster and with better practices. Feel free to contribute or raise issues on GitHub! View Project on GitHub