ghostcompiler/laravel-react-jsx 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ghostcompiler/laravel-react-jsx

最新稳定版本:v1.0.0

Composer 安装命令:

composer create-project ghostcompiler/laravel-react-jsx

包简介

Starter kit for Laravel 13 with React (JSX), Vite, and modern frontend tooling.

README 文档

README

Ghost Compiler Logo

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:

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:

  1. Open the live URL and confirm the page loads without a client-only flash on first paint.
  2. Inspect the page source and verify the landing page content is already in the HTML response.
  3. Check the deployment logs for Starting Inertia SSR... and make sure there is no SSR startup error.
  4. If the SSR bundle is missing, confirm bootstrap/ssr/app.js exists 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

ghostcompiler/laravel-react-jsx 适用场景与选型建议

ghostcompiler/laravel-react-jsx 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 411 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 04 月 17 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「react」 「starter-kit」 「jsx」 「laravel-react」 「vite」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 ghostcompiler/laravel-react-jsx 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 ghostcompiler/laravel-react-jsx 我们能提供哪些服务?
定制开发 / 二次开发

基于 ghostcompiler/laravel-react-jsx 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 411
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 34
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-04-17