laravel-react-jsx maintained by ghostcompiler
Ghost Compiler — Laravel React JSX Starter Kit
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
- Vite 8
- TailwindCSS v4
- SSR (Server Side Rendering)
- Custom Artisan generators
Features
Frontend
- React JSX architecture
- Inertia routing
- TailwindCSS v4
- SSR enabled
- Layout system support
- Hook-based logic structure
Backend
- Laravel 13
- Clean routing structure
- Inertia integration
- SSR rendering support
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
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
- SSR renderer
Run only Vite:
npm run dev
Build production assets:
npm run build
Start SSR renderer manually:
php artisan inertia:start-ssr
SSR Support
SSR entry file:
resources/js/ssr.jsx
Build SSR bundle:
npm run build
Output:
public/build/
bootstrap/ssr/ssr.js
Run SSR renderer:
php artisan inertia:start-ssr
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
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 start
| Script | Purpose |
|---|---|
| dev | Run Vite |
| build | Build client + SSR bundles |
| start | Laravel + Vite + SSR |
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