yii3/app-inertia-vue

A Yii 3 application template powered by Inertia 3 and Vue 3.

Maintainers

Package info

github.com/yii3/app-inertia-vue

Language:CSS

Type:project

pkg:composer/yii3/app-inertia-vue

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

dev-main / 0.1.x-dev 2026-08-28 02:20 UTC

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 runtime page prop while preserving the persistent layout, deferred data, and scroll position.
  • Deferred props resolve the ecosystem diagnostics group after the first response, with an accessible loading state in Vue.
  • Infinite scroll exposes requestFeed through Prop::scroll(). The server provides cursor metadata, Inertia merges requestFeed.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

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.