Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Yii Framework

Inertia.js + React 19 Application Template


Build Codecov PHPStan

Skeleton Yii2 application with Inertia.js + React 19 integration
Server-driven SPA with Tailwind CSS v4, shadcn/ui, dark mode, Cloudflare Turnstile, and Codeception tests

Use the "Use this template" button on GitHub to create your own repository from this template.

Features

Feature Overview Inertia.js + React 19 Application Template User Directory with shadcn/ui Table

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.php reads the YII_ENV environment variable. When it equals dev, inertiaReact.devMode evaluates to true in config/web.php, and the root view emits <script> tags pointing at http://localhost:5173 instead of the built manifest.
  • React Fast Refresh is wired automatically through \yii\inertia\react\Bootstrap::reactRefreshPreambleProvider(). Edits to .jsx files and CSS update in place without a full page reload.
  • Before deploying, stop the Vite dev server, run npm run build, unset YII_ENV (or set it to prod), and serve public/. Production mode reads hashed assets from public/build/ via the Vite manifest.

For CORS guidance on non-localhost setups (Docker, tunnels, reverse proxies), troubleshooting, and the full production-switch procedure, see the adapter's Development Notes.

Docker

Apache

docker compose up -d

Documentation

Package information

PHP Yii 22.0.x Latest Stable Version Total Downloads

Quality code

PHPStan Level Max Super-Linter StyleCI

Our social networks

Follow on X

License

License

About

Reference Yii2 + Inertia.js + React 19 application: shadcn/ui, Radix, Tailwind CSS v4, Vite, and full auth flow.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages