The Laravel Shadcn Starter Kit with Inertia.js is a powerful boilerplate for building modern web applications. It combines the robust Laravel backend with a React-based frontend, utilizing Inertia.js for seamless client-side navigation. This kit provides a solid foundation for developers to create dynamic, single-page applications with ease, including full CRUD operations for user management and role-based access control.
- Laravel Framework: Utilizes the latest version of Laravel for a solid backend.
- React with TypeScript: Frontend built with React and TypeScript for type-safe development.
- Inertia.js Integration: Enables single-page application (SPA) behavior without the complexity of a full frontend framework.
- Shadcn UI Components: A collection of customizable UI components for a modern user interface.
- User Authentication: Built-in user authentication system.
- User Management: Full CRUD (Create, Read, Update, Delete) operations for user accounts.
- Role-Based Access Control: Integrated Spatie Laravel Permission package for flexible role and permission management.
- Responsive Design: Mobile-friendly layout that adapts to different screen sizes.
- Dark Mode Support: Built-in theme toggling between light and dark modes.
- API Support: Ready-to-use API routes for building RESTful services.
- Backend: Laravel (PHP)
- Frontend: React with TypeScript
- Styling: Tailwind CSS
- UI Components: Shadcn UI
- Build Tool: Vite
- Database: MySQL (configurable)
- Authentication: Laravel Breeze
- Role & Permissions: Spatie Laravel Permission
-
Clone the repository:
git clone https://github.com/yourusername/laravel-shadcn-inertia-starter-kit.git
-
Navigate to the project directory:
cd laravel-shadcn-inertia-starter-kit
-
Install PHP dependencies:
composer install
-
Install JavaScript dependencies:
npm install
-
Copy the
.env.example
file to.env
and configure your environment variables:cp .env.example .env
-
Generate an application key:
php artisan key:generate
-
Run database migrations and seed initial data:
php artisan migrate --seed
-
Build frontend assets:
npm run dev
-
Start the development server:
php artisan serve
This starter kit comes with a complete user management system, including:
- User registration and authentication
- User profile management
- CRUD operations for managing users
- Role-based access control using Spatie Laravel Permission
- Admin: Full access to all features
- Manager: Can manage users and content
- User: Basic access to the application
To assign roles and permissions, use the Spatie Laravel Permission methods in your controllers or seeders.
- Create new React components in
resources/js/Components
- Use Shadcn UI components or create custom ones as needed
- Import and use your components in pages located in
resources/js/Pages
- Tailwind CSS classes can be customized in
tailwind.config.js
- Global styles are defined in
resources/css/app.css
- Define new roles in your database seeder or through the application interface
- Assign permissions to roles using the Spatie Laravel Permission API
- Use middleware to protect routes based on roles and permissions
The starter kit includes a basic API structure. Endpoints for user management are located in routes/api.php
. Extend this file to add more API routes as needed.
- Run PHP tests:
php artisan test
- Run JavaScript tests:
npm run test
- Set up your production environment
- Configure your
.env
file for production - Run
npm run build
to compile and minify assets - Follow Laravel's deployment best practices
Contributions are welcome! Please feel free to submit a Pull Request.
This project is open-sourced software licensed under the MIT license.