yii3 / app-inertia-vue
A Yii 3 application template powered by Inertia 3 and Vue 3.
Package info
github.com/yii3/app-inertia-vue
Language:CSS
Type:project
pkg:composer/yii3/app-inertia-vue
Requires
- php: >=8.3
- ext-filter: *
- httpsoft/http-message: ^1.1.6
- php-forge/foxy: ^0.3
- php-forge/inertia: ^0.2
- php-forge/vite: ^0.2.1
- psr/container: ^2.0.2
- psr/http-factory: ^1.1
- psr/http-message: ^2.0
- psr/http-server-handler: ^1.0.2
- psr/log: ^3.0.2
- vlucas/phpdotenv: ^5.7.0
- yii3/inertia: ^0.1
- yiisoft/aliases: ^3.1.1
- yiisoft/config: ^1.6.2
- yiisoft/csrf: ^2.2.3
- yiisoft/definitions: ^3.4.1
- yiisoft/di: ^1.4.1
- yiisoft/error-handler: ^4.3.2
- yiisoft/html: ^4.2
- yiisoft/http: ^1.3
- yiisoft/log: ^2.2.1
- yiisoft/middleware-dispatcher: ^5.4
- yiisoft/request-body-parser: ^1.2.1
- yiisoft/request-provider: ^1.3
- yiisoft/router: ^4.0.2
- yiisoft/router-fastroute: ^4.0.3
- yiisoft/session: ^3.0.2
- yiisoft/yii-http: ^1.1.1
- yiisoft/yii-runner-console: ^2.2.1
- yiisoft/yii-runner-http: ^3.2.1
Requires (Dev)
- codeception/c3: ^2.9
- codeception/codeception: ^5.3.5
- codeception/module-phpbrowser: ^4.1
- maglnet/composer-require-checker: ^4.20
- php-forge/coding-standard: ^0.3.3
- phpstan/extension-installer: ^1.4.3
- phpstan/phpstan: ^2.2.9
- phpstan/phpstan-strict-rules: ^2.0.12
- rector/rector: ^2.6.4
- symfony/process: ^7.4.13 || ^8.1.5
This package is auto-updated.
Last update: 2026-08-28 02:21:18 UTC
README
yii3/app-inertia-vue is a reference application that integrates Yii 3,
Inertia.js 3, Vue 3.5, TypeScript, and Vite 8. Yii owns routing and page data,
Inertia carries page responses and navigation state, and Vue renders the
interactive interface.
Home page
The home page demonstrates the integration with working application behavior:
- Architecture presents a constructor-injected invokable action and the explicit PSR-15 middleware pipeline that handles each request.
- Stack shows the Yii, Inertia, Vue, and Vite responsibilities in one server-driven request flow.
- Partial reloads refresh only the
runtimepage prop while preserving the persistent layout, deferred data, and scroll position. - Deferred props resolve the
ecosystemdiagnostics group after the first response, with an accessible loading state in Vue. - Infinite scroll exposes
requestFeedthroughProp::scroll(). The server provides cursor metadata, Inertia mergesrequestFeed.data, and Vue appends each three-event page inside a contained scroll region. - Explore links to the local debugger when access is allowed, the official Yii 3 guide, the neutral Yii 2 upgrade guide, and the application source.
- A persistent light and dark theme follows the operating-system preference until the visitor chooses a mode, then stores that choice locally.
Requirements
- PHP 8.3 or later.
- Composer 2.
- Node.js 22.12 or later.
Install locally
Install the locked PHP and frontend dependencies, build the production assets, and create the local environment file:
composer install npm ci npm run build cp .env.example .env
Start the application on port 8081:
./yii serve
Open http://localhost:8081.
Vite development server
For hot module replacement, set VITE_DEV_SERVER=true in .env, then run the
Vite and Yii development servers in separate terminals:
npm run dev
./yii serve
The PHP application continues to own routing and the initial HTML response.
Vite serves the Vue entrypoint and hot updates. In production mode,
PHPForge\Vite\Vite reads public/build/.vite/manifest.json; the manifest
modification time also provides the Inertia asset version.
Debugger
yii3/debug is a development dependency. Its toolbar middleware wraps the
Inertia pipeline when the package is installed and exposes local-only request
history and /debug routes. The home page applies the same local-IP policy
before showing its Debugger link.
See the debugger notes for the integration details and reference captures.
Project map
config/routes.php Named Yii 3 routes
config/di/application.php PSR-15 middleware pipeline
config/di/vite.php Vite configuration
config/params.php Application and Inertia parameters
public/index.php Dotenv and HTTP application bootstrap
resources/js/app.ts Typed Inertia and Vue bootstrap
resources/js/composables/ Persistent theme state
resources/js/layouts/ Persistent Vue application shell
resources/js/pages/Home.vue Home page and Inertia demonstrations
resources/js/styles/app.css Application visual system
resources/views/app.php Initial Inertia HTML document
src/Web/Workbench/HomeAction.php Home props and scroll pagination
tests/Web/ Essential browser-level application tests
Yii references
- Official Yii 3 guide
- Moving from Yii 2 explains how to rebuild and verify one application flow at a time. Keeping a mature Yii 2 application running can also be a valid choice.
- Yii 3 release announcement
- Official Yii packages
Quality checks
npm run typecheck npm run build composer tests composer static composer check-dependencies vendor/bin/ecs check --ansi
PHPStan runs at maximum level. Use composer ecs when you intentionally want
to apply coding-standard fixes. The Web suite covers the home page, its feed
pagination, and the application-owned 404 response without duplicating tests
for framework or tooling packages.
License
The application is released under the BSD 3-Clause License. See LICENSE.