crenspire / yii3-react-starter
Yii3 starter kit with Inertia.js 3, React 19, shadcn/ui and Tailwind CSS 4
Package info
github.com/crenspire/yii3-react-starter
Type:project
pkg:composer/crenspire/yii3-react-starter
Requires
- php: ^8.2
- ext-filter: *
- crenspire/yii3-inertia: ^2.0
- httpsoft/http-message: ^1.1.6
- psr/container: ^2.0.2
- psr/http-factory: ^1.1
- psr/http-message: ^2.0
- psr/http-server-handler: ^1.0.2
- psr/http-server-middleware: ^1.0.2
- psr/log: ^3.0.2
- symfony/console: ^7.3.2
- yiisoft/aliases: ^3.1
- yiisoft/config: ^1.6
- yiisoft/csrf: ^2.2.2
- yiisoft/data-response: ^2.1.1
- yiisoft/definitions: ^3.4
- yiisoft/di: ^1.4
- yiisoft/error-handler: ^4.2
- yiisoft/html: ^3.11
- yiisoft/http: ^1.2
- yiisoft/input-http: ^1.0
- yiisoft/log: ^2.1.1
- yiisoft/log-target-file: ^3.0
- yiisoft/middleware-dispatcher: ^5.3
- yiisoft/request-provider: ^1.2
- yiisoft/router: ^4
- yiisoft/router-fastroute: ^4.0.1
- yiisoft/session: ^3.0
- yiisoft/validator: ^2.6
- yiisoft/yii-console: ^2.3
- yiisoft/yii-http: ^1.0.4
- yiisoft/yii-runner-console: ^2.2
- yiisoft/yii-runner-http: ^3.2
Requires (Dev)
- ext-session: *
- codeception/c3: ^2.9
- codeception/codeception: ^5.3.2
- codeception/module-asserts: ^3.2
- codeception/module-cli: ^2.0.1
- codeception/module-phpbrowser: ^3.0.1
- friendsofphp/php-cs-fixer: ^3.86.0
- phpunit/phpunit: ^11.5.56
- rector/rector: ^2.1.4
- roave/infection-static-analysis-plugin: ^1.40
- roave/security-advisories: dev-latest
- shipmonk/composer-dependency-analyser: ^1.8.3
- vimeo/psalm: ^6.13.1
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-17 05:04:37 UTC
README
A starter kit for building single-page applications with Yii3, Inertia.js, React and shadcn/ui, while keeping routing, controllers and validation in PHP.
Screenshots
| Users | Edit user (dark theme) |
|---|---|
![]() |
![]() |
| Login | Dashboard (dark theme) |
|---|---|
![]() |
![]() |
| Settings | Landing page |
|---|---|
![]() |
![]() |
What's included
- Yii3 + Inertia.js 3 through
crenspire/yii3-inertia: partial reloads, deferred props, validation errors, flash data and asset versioning - Admin dashboard built on the shadcn/ui
dashboard-01block: collapsible sidebar, KPI cards, an interactive chart, a users table with search, sorting, selection and bulk delete, and forms with server-side validation and toasts - Login page built on the shadcn/ui
login-02block - React 19 and shadcn/ui with light, dark and system themes
- Tailwind CSS 4 and Vite 8 with hot module replacement
- CSRF protection for Inertia requests through the
XSRF-TOKENcookie - Docker: FrankenPHP images for development, testing and production, and a Docker Swarm stack for deploys
- Code quality: Psalm (level 1), PHP CS Fixer, Rector and Composer Dependency Analyser
- Tests: Codeception unit, functional, console and browser suites, with helpers for testing Inertia pages
Demo sign-in. The kit has no user storage yet. Any email with a password of at least 8 characters signs you in, and admin users are kept in your session. Replace both before production, see Admin area and authentication.
Quick start
Requirements: PHP 8.2+, Composer 2, Node.js 20.19+ or 22.12+.
git clone https://github.com/crenspire/yii3-react-starter.git cd yii3-react-starter composer install npm install # In two terminals APP_ENV=dev APP_DEBUG=true composer serve # http://localhost:8080 npm run dev
Open http://localhost:8080, then go to /login to see the admin area.
With Docker: make build && make up, then run npm run dev on the host. See
Getting started for details.
Documentation
| Guide | What it covers |
|---|---|
| Getting started | Installation, running locally and in Docker |
| Architecture | Request flow, middleware, configuration, environment variables, project layout |
| Pages, forms and validation | Adding pages, props, forms, validation errors, redirects and toasts |
| Admin area and authentication | The admin shell, users, settings, and replacing the demo sign-in |
| Frontend | shadcn/ui, theming, dark mode, Tailwind CSS 4 and Vite |
| Testing and code quality | Test suites, testing Inertia pages, Psalm, PHP CS Fixer, Rector |
| Deployment | Production image, Docker Swarm, production checklist, workers |
Tech stack
| Backend | Frontend | Tooling |
|---|---|---|
| PHP 8.2+ | React 19 | Psalm 6 |
| Yii3 | Inertia.js 3 | PHP CS Fixer |
| crenspire/yii3-inertia | shadcn/ui (Radix UI) | Rector |
| yiisoft/validator | Tailwind CSS 4 | Codeception 5 |
| FrankenPHP (Docker) | TanStack Table, Recharts | Vite 8 |
Common commands
| Command | Description |
|---|---|
composer serve |
PHP development server on port 8080 (set APP_ENV) |
npm run dev / npm run build |
Vite dev server / production build |
APP_ENV=test composer test |
Run all test suites (run npm run build first) |
composer psalm |
Static analysis |
composer cs-check / composer cs-fix |
Check / fix code style |
composer rector |
Automated refactoring |
make help |
Docker targets for development, tests and deployment |
Roadmap
Planned, and not part of the kit yet:
- Authentication: real user accounts with password hashing, sign up, social login and roles
- Database integration, so admin data is stored in a database instead of the session
- Payments: subscription billing
- REST API with generated documentation
- AI integration structure
Contributing
Issues and pull requests are welcome at
github.com/crenspire/yii3-react-starter. Please run the tests and
composer psalm and composer cs-check before opening a pull request.
License
This project is licensed under the BSD-3-Clause license. See composer.json.






