Skip to content

A starter kit based on Laravel Breeze which includes Inertia, React, Typescript, Tailwindcss, Shadcn/ui and Spatie.

Notifications You must be signed in to change notification settings

yudayahya/laravel-inertia-react-shadcn-spatie

Repository files navigation

Laravel Logo

Build Status Total Downloads Latest Stable Version License

A starter kit based on Laravel Breeze which includes Inertia, React, Typescript, Tailwindcss, Shadcn/ui and Spatie.

The starter kit also implement basic usage of spatie (roles & permissions) and provide a web for client/user/customer and console/portal/dashboard for admin (CMS). The routes system is modified to implement domain (for client) & subdomain (for console) routing include authentication middleware for console routes.

Note: check this app\Providers\RouteServiceProvider.php file for details and see the complete installation instructions to ensure you can run the starter kit correctly.

Complete Installations

  1. Clone this repository.
git clone https://github.com/yudayahya/laravel-inertia-react-shadcn-spatie.git
  1. Change to file directory.
cd laravel-inertia-react-shadcn-spatie
  1. Install the dependencies.
composer install
npm install
  1. Create .env file from .env.example
cp .env.example .env
  1. Configure .env variables according to your needs and fill APP_URL with domain (ex: https://laravel-inertia-react-shadcn-spatie.test) to make sure the domain & subdomain routing works well. If you're using Windows OS and Laragon you can enable Auto-create Virtual Hosts (refer to https://laragon.org/docs/pretty-urls.html for the details). After you're able to use the Laragon Pretty URL create an empty folder with the folder name same as your project name and add subdomain prefix (ex: console.laravel-inertia-react-shadcn-spatie) inside laragon\www and restart your laragon, laragon will ask a prompt to add the folder name (subdomain like) to your C:\Windows\System32\drivers\etc\hosts file and create Apache/Nginx .conf file automatically, after that remove your new folder and restart laragon, laragon will remove the Apache/Nginx .conf file (we don't need this .conf file, we only need laragon to add your folder name to hosts file). And now you should able to access your domain and subdomain from your browser. But our laravel application is not ready yet, proceed to the next installation instructions.

    Note: To setup (domain & subdomain availability) anything other than Windows with Laragon, you need to find and do it yourself.

  2. Migrate the table

php artisan migrate
  1. Running db seed
php artisan db:seed
  1. Build the frontend bundle
npm run build
  1. It's done, navigate to your domain URL in your browser (make sure your server/laragon is running). Use the super admin credentials to access the console page, you can find in database\seeders\SuperAdminSeeder.php seeder file.

References

License

The Starter Kit is open-sourced under the MIT license.