ghostcompiler / laravel-react-jsx
Starter kit for Laravel 13 with React (JSX), Vite, and modern frontend tooling.
Package info
github.com/ghostcompiler/laravel-react-jsx
Type:project
pkg:composer/ghostcompiler/laravel-react-jsx
Requires
- php: ^8.3
- inertiajs/inertia-laravel: ^3.0
- laravel/framework: ^13.0
- laravel/tinker: ^3.0
Requires (Dev)
- fakerphp/faker: ^1.23
- laravel/pail: ^1.2.5
- laravel/pint: ^1.29
- mockery/mockery: ^1.6
- nunomaduro/collision: ^8.6
- phpunit/phpunit: ^12.5.12
README
Modern Laravel 13 + React 19 + Inertia + Vite starter kit built for scalable dashboards, SaaS panels, and license platforms.
About
Ghost Compiler Laravel React JSX Starter Kit is a clean full-stack foundation that combines Laravel with React (JSX) using Inertia.js and Vite.
It is designed for building:
- Admin dashboards
- SaaS panels
- Multi-tenant systems
- License managers
- API-driven applications
Stack
Core technologies included:
- Laravel 13
- React 19
- Inertia.js v3
- Vite 8
- TailwindCSS v4
- SSR (automatic in development with @inertiajs/vite)
- Custom Artisan generators
Features
Frontend
- React JSX architecture
- Inertia routing
- TailwindCSS v4
- SSR in development handled automatically (Inertia v3)
- Layout system support
- Hook-based logic structure
Backend
- Laravel 13
- Clean routing structure
- Inertia integration
- SSR rendering support for production deployments
Developer Experience
Custom generators included:
php artisan make:page php artisan make:layout php artisan make:component php artisan make:hook php artisan make:lib php artisan make:helper
Nested paths supported automatically.
Example:
php artisan make:page Admin/Dashboard
Creates:
resources/js/pages/Admin/Dashboard.jsx
Installation
Using Composer (Recommended)
Create a new project:
composer create-project ghostcompiler/laravel-react-jsx demo
Using Laravel Installer
If Laravel installer is installed globally:
laravel new demo --using=ghostcompiler/laravel-react-jsx
Manual Installation (Fallback)
Clone repository manually:
git clone https://github.com/ghostcompiler/laravel-react-jsx.git demo
cd demo
composer install
npm install
cp .env.example .env
php artisan key:generate
npm run start
Development Commands
Start full development environment:
npm run start
Runs:
- Laravel server
- Vite dev server
- Inertia SSR automatically in development
Run only Vite:
npm run dev
Build production assets:
npm run build
Build production client + SSR bundles:
npm run build:ssr
Start SSR renderer manually (production):
php artisan inertia:start-ssr
SSR Support
Inertia v3 with @inertiajs/vite enables SSR automatically during development when running:
npm run dev
or:
npm run start
No separate SSR Node process is required in development.
For production SSR, build the SSR bundle:
npm run build:ssr
Production SSR output:
public/build/
bootstrap/ssr/app.js
Then run the SSR renderer:
php artisan inertia:start-ssr
To confirm SSR is working, open the app in a browser and check the page source or the first HTML response. If SSR is active, the initial response will already include rendered page content instead of only a shell div, and the server logs will show the SSR process starting without errors.
Docker Deployment
This project includes a production Dockerfile for platforms like Render and Railway.
Build behavior:
- Installs Composer dependencies with Laravel scripts disabled during image build
- Builds the frontend and SSR bundle with Vite
- Copies the runtime PHP app, vendor directory, built assets, and SSR bundle into the final image
- Starts the Laravel web server on the platform-provided
PORT - Starts Inertia SSR automatically when the SSR bundle is present
Hosted demos:
- Render: https://laravel-react-jsx.onrender.com/
- Railway: https://laravel-react-jsx-production.up.railway.app
How to deploy:
docker build -t ghostcompiler-dashboard .
docker run -p 8080:8080 -e APP_ENV=production -e APP_DEBUG=false ghostcompiler-dashboard
How to check SSR after deploy:
- Open the live URL and confirm the page loads without a client-only flash on first paint.
- Inspect the page source and verify the landing page content is already in the HTML response.
- Check the deployment logs for
Starting Inertia SSR...and make sure there is no SSR startup error. - If the SSR bundle is missing, confirm
bootstrap/ssr/app.jsexists in the container image.
Project Structure
resources/js/
│
├── components/
├── hooks/
├── layouts/
├── lib/
├── pages/
└── app.jsx
Recommended usage:
| Folder | Purpose |
|---|---|
| pages | Inertia route pages |
| layouts | Layout wrappers |
| components | UI components |
| hooks | React hooks |
| lib | Utilities / helpers |
Artisan Generators
Create Page
php artisan make:page Dashboard
Creates:
resources/js/pages/Dashboard.jsx
Create Layout
php artisan make:layout Admin/MainLayout
Creates:
resources/js/layouts/Admin/MainLayout.jsx
Create Component
php artisan make:component UI/Button
Creates:
resources/js/components/UI/Button.jsx
Create Hook
php artisan make:hook useAuth
Creates:
resources/js/hooks/useAuth.js
Create Library File
php artisan make:lib api/client
Creates:
resources/js/lib/api/client.js
Create Helper File
php artisan make:helper format/currency
Creates:
app/Helpers/Format/Currency.php
Example Layout Usage
import DashboardLayout from "@/layouts/Admin/MainLayout"; export default function Dashboard() { return <div>Dashboard</div>; } Dashboard.layout = (page) => <DashboardLayout>{page}</DashboardLayout>;
Example Hook Usage
import useAuth from "@/hooks/useAuth"; const { state } = useAuth();
Example Component Usage
import Button from "@/components/UI/Button"; <Button>Click me</Button>;
Scripts
Available npm scripts:
npm run dev npm run build npm run build:ssr npm run start
| Script | Purpose |
|---|---|
| dev | Run Vite (SSR auto in dev) |
| build | Build client bundle |
| build:ssr | Build client + SSR bundles |
| start | Laravel + Vite |
Requirements
Minimum versions:
| Tool | Version |
|---|---|
| PHP | 8.3+ |
| Node | 20+ |
| Laravel | 13 |
| React | 19 |
Recommended Usage
Ideal for:
- SaaS dashboards
- reseller panels
- licensing systems
- admin portals
- API-first applications
Contributing
Pull requests are welcome.
If you'd like to improve generators or architecture, contributions are appreciated.
License
MIT License © Ghost Compiler