yii2-extensions / app-inertia-react
Yii2 application template with Inertia.js and React 19
Package info
github.com/yii2-extensions/app-inertia-react
Type:project
pkg:composer/yii2-extensions/app-inertia-react
Requires
- php: >=8.3
- ext-filter: *
- php-forge/foxy: ^0.2
- php-forge/inertia: ^0.1
- php-forge/vite: ^0.1
- yii2-extensions/inertia: ^0.2
- yiisoft/yii2: ^22.0@dev
- yiisoft/yii2-symfonymailer: ^22.0@dev
Requires (Dev)
- codeception/c3: ^2.9
- codeception/codeception: ^5.3
- codeception/lib-innerbrowser: ^4.1
- codeception/module-asserts: ^3.3
- codeception/module-filesystem: ^3.0
- codeception/module-phpbrowser: ^4.0
- codeception/module-yii2: ^2.0
- codeception/verify: ^3.4
- maglnet/composer-require-checker: ^4.1
- php-forge/baseline: ^0.1
- php-forge/coding-standard: ^0.3
- phpstan/extension-installer: ^1.4
- phpstan/phpstan-strict-rules: ^2.0.3
- yii2-extensions/debug: ^0.2@dev
- yii2-extensions/phpstan: ^0.5@dev
- yii2-extensions/scaffold: ^0.2
This package is auto-updated.
Last update: 2026-08-24 17:31:56 UTC
README
Inertia.js + React 19 Application Template
Skeleton Yii2 application with Inertia.js + React 19 integration
Server-driven SPA with Tailwind CSS v4, shadcn/ui, dark mode, live Inertia infinite scroll, and Codeception tests
Use the "Use this template" button on GitHub to create your own repository from this template.
Features
Quick start
# create a new Yii2 application using the Inertia.js + React 19 template composer create-project --prefer-dist yii2-extensions/app-inertia-react:^0.1@dev app-react # navigate to the application directory cd app-react # run database migrations ./yii migrate/up # build production assets (one-shot; for live editing see the HMR workflow below) npm run build # start the development server ./yii serve
Development workflow with HMR
npm run build produces production assets once and exits. To edit .jsx
files and see changes in the browser without rebuilding, run two processes
side by side:
# Terminal 1 โ Vite dev server (HMR for .jsx and Tailwind CSS) npm run dev # Terminal 2 โ Yii2 in dev mode YII_ENV=dev ./yii serve
How the pieces connect:
public/index.phpreads theYII_ENVenvironment variable. When it equalsdev, Yii's service locator lazily constructs the framework-agnostic Vite facade withDevelopmentConfiguration, and the root view emits<script>tags pointing athttp://localhost:5173instead of the built manifest.- React Fast Refresh is supplied through the application-owned
app\vite\ReactRefreshPreambleProvider. Edits to.jsxfiles and CSS update in place without a full page reload. - Before deploying, stop the Vite dev server, run
npm run build, unsetYII_ENV(or set it toprod), and servepublic/.ProductionConfigurationreads hashed assets frompublic/build/via the Vite manifest.
For manifest options, development-server behavior, and CORS configuration, see the
php-forge/vite documentation.
Docker
docker compose up -d
Documentation
- ๐ Installation Guide
- โ๏ธ Configuration Reference
- ๐ก Usage Examples
- ๐งช Testing Guide