PHPackages                             yii2-extensions/app-base - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. yii2-extensions/app-base

ActiveYii2-scaffold[CLI &amp; Console](/categories/cli)

yii2-extensions/app-base
========================

Shared Yii2 backend scaffold: models, controllers, migrations, RBAC, mail templates, and CLI.

133PHPCI passing

Since May 27Pushed 1w agoCompare

[ Source](https://github.com/yii2-extensions/app-base)[ Packagist](https://packagist.org/packages/yii2-extensions/app-base)[ RSS](/packages/yii2-extensions-app-base/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependenciesVersions (3)Used By (0)

    ![Yii Framework](https://camo.githubusercontent.com/f390171a839a7620dea19acb5fc1fb87f9226e65910c577f99803347ce48336a/68747470733a2f2f7777772e7969696672616d65776f726b2e636f6d2f696d6167652f64657369676e2f6c6f676f2f796969335f66756c6c5f666f725f6c696768742e737667)

App Base
========

[](#app-base)

 [ ![Build](https://camo.githubusercontent.com/2a94ab553487d4abf3cbdd7d3dbac95fa7111a373be5d5a8329c100f6982142c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f796969322d657874656e73696f6e732f6170702d626173652f6275696c642e796d6c3f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6162656c3d4275696c64) ](https://github.com/yii2-extensions/app-base/actions/workflows/build.yml) [ ![Codecov](https://camo.githubusercontent.com/cba28d703a0be887f294f58d7e647d0530832e3663570f3417ba2446fb3ba781/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f796969322d657874656e73696f6e732f6170702d626173652e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d636f6465636f76266c6f676f436f6c6f723d7768697465266c6162656c3d436f6465636f76) ](https://codecov.io/gh/yii2-extensions/app-base) [ ![PHPStan](https://camo.githubusercontent.com/e275f821d86732f366adce42123b09bc180706fdb10b6d572f2a4b436f280787/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f796969322d657874656e73696f6e732f6170702d626173652f7374617469632e796d6c3f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6162656c3d5048505374616e) ](https://github.com/yii2-extensions/app-base/actions/workflows/static.yml)

 **Shared Yii2 backend distributed as a `yii2-extensions/scaffold` provider
 User model, auth, RBAC, migrations, mail, console, web entrypoints.**

Features
--------

[](#features)

  ![Feature Overview](./docs/svgs/features.svg)What is a scaffold provider?
----------------------------

[](#what-is-a-scaffold-provider)

`app-base` is not a runtime library; there is no class to extend or service to register.

It is a [`yii2-extensions/scaffold`](https://github.com/yii2-extensions/scaffold) **provider** ; a package that declares a set of files to copy into a consumer project.

On `composer install`, the scaffold plugin reads `scaffold.json` from this package and copies `src/`, `config/`, `rbac/`, `resources/`, `public/` and `yii` into the consumer root. Files that are marked as `preserve` (configs, RBAC, runtime assets) are only written once, so your edits survive subsequent installs.

See [docs/scaffold.md](docs/scaffold.md) for the detailed walkthrough.

Requirements
------------

[](#requirements)

- PHP `>=8.3`
- `yiisoft/yii2` `^22.0@dev`
- `yii2-extensions/scaffold` `^0.1@dev`
- A frontend overlay provider for views, CSS, and JS ; see [docs/frontend-overlays.md](docs/frontend-overlays.md).

Quick start
-----------

[](#quick-start)

Create a new directory for your app, drop in this `composer.json`, then run `composer install`:

```
{
    "name": "my-company/my-app",
    "type": "project",
    "minimum-stability": "dev",
    "prefer-stable": true,
    "require": {
        "php": ">=8.3",
        "yii2-extensions/app-base": "^22.0@dev",
        "yii2-extensions/app-jquery": "^22.0@dev"
    },
    "require-dev": {
        "yii2-extensions/scaffold": "^0.1@dev"
    },
    "extra": {
        "scaffold": {
            "allowed-packages": [
                "yii2-extensions/app-base",
                "yii2-extensions/app-jquery"
            ]
        },
        "yii\\composer\\Installer::postCreateProject": {
            "setPermission": [
                {
                    "runtime": "0775",
                    "public/assets": "0775",
                    "yii": "0755"
                }
            ]
        },
        "yii\\composer\\Installer::postInstall": {
            "generateCookieValidationKey": [
                "config/web.php"
            ]
        }
    },
    "config": {
        "allow-plugins": {
            "yii2-extensions/scaffold": true,
            "yiisoft/yii2-composer": true
        }
    },
    "scripts": {
        "post-create-project-cmd": [
            "yii\\composer\\Installer::postCreateProject",
            "yii\\composer\\Installer::postInstall"
        ],
        "post-install-cmd": [
            "yii\\composer\\Installer::postInstall"
        ]
    }
}
```

Then:

```
composer install                                    # scaffold copies the tree in + autogenerates cookieValidationKey
./yii migrate                                       # creates the user table + admin user
php -S localhost:8080 -t public public/router.php   # start the dev server
```

Full walkthrough: [docs/installation.md](docs/installation.md).

What ships
----------

[](#what-ships)

After `composer install`, the consumer project tree looks like this:

```
your-app/
├── src/
│   ├── controllers/       SiteController, UserController
│   ├── models/            User ActiveRecord + 8 form models + UserSearch
│   ├── migrations/        CreateUserTable, CreateAdminUser
│   └── commands/          HelloController (console entry-point example)
├── config/                [preserve] web.php, console.php, db.php, params.php, test.php, test_db.php
├── rbac/                  [preserve] items.php, rules.php, assignments.php
├── resources/
│   ├── mail/              HTML + text templates (emailVerify, passwordResetToken) + layouts
│   └── views/             layouts/main, site/*, user/* ; rendered by the frontend overlay
├── public/                index.php, index-test.php, router.php (built-in server), assets/, images/
├── runtime/               [preserve] .gitignore (cache, logs, db.sqlite land here)
├── yii                    Console entry point
└── scaffold.json          Provider manifest (copy paths, per-file modes)

```

`[preserve]` = scaffold writes the file once and never overwrites it on subsequent `composer install` runs. All other paths are refreshed from the provider stubs unless you explicitly `scaffold eject` them.

Not included (by design)
------------------------

[](#not-included-by-design)

- CSS, JS, widgets, and asset bundles ; owned by frontend overlays such as [`yii2-extensions/app-jquery`](https://github.com/yii2-extensions/app-jquery).
- Server configuration (`.htaccess`, `nginx.conf`, `Caddyfile`, `.rr.yaml`); lives in dedicated `yii2-extensions/server-*` providers.

Documentation
-------------

[](#documentation)

For detailed configuration, scaffold internals, and consumer setup.

- 📚 [Installation Guide](docs/installation.md)
- 📦 [Scaffold Workflow](docs/scaffold.md)
- ⚙️ [Configuration Reference](docs/configuration.md)
- 🎨 [Frontend Overlays](docs/frontend-overlays.md)
- 🧪 [Testing Guide](docs/testing.md)

Package information
-------------------

[](#package-information)

[![PHP](https://camo.githubusercontent.com/f04357fef9ebcd99ed76d5414552bcd1ce849df0ee1d4faf8e991f54c966d508/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f253345253344382e332d3737374242342e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d706870266c6f676f436f6c6f723d7768697465)](https://www.php.net/releases/8.3/en.php)[![Yii 22.0.x](https://camo.githubusercontent.com/6419cb138fb08a8fcb971e8e780bed42fdb74f683a39b22ca0cd2059f246ce43/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f32322e302e782d3030373341412e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d796969266c6f676f436f6c6f723d7768697465)](https://github.com/yiisoft/yii2/tree/22.0)[![Latest Stable Version](https://camo.githubusercontent.com/f673a92863568c6906ee6bcaa86a676e30e8201544c5bde47949c426aa2b12c5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f796969322d657874656e73696f6e732f6170702d626173652e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d7061636b6167697374266c6f676f436f6c6f723d7768697465266c6162656c3d537461626c65)](https://packagist.org/packages/yii2-extensions/app-base)[![Total Downloads](https://camo.githubusercontent.com/6adeaaf949e5d5dfee658afccd2823a7ffa5b0aa682d9100911848bcb002748e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f796969322d657874656e73696f6e732f6170702d626173652e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d636f6d706f736572266c6f676f436f6c6f723d7768697465266c6162656c3d446f776e6c6f616473)](https://packagist.org/packages/yii2-extensions/app-base)

Quality code
------------

[](#quality-code)

[![PHPStan Level Max](https://camo.githubusercontent.com/b1aeb44257ce46737d1787123b534aab9dded28219f828e4ae13a1e3b460f53c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048505374616e2d4c6576656c2532304d61782d3446354439352e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465)](https://github.com/yii2-extensions/app-base/actions/workflows/static.yml)[![Super-Linter](https://camo.githubusercontent.com/017ac5194c28deff8924a7892b1d3ec5774d5032f844bb94949987b195e2d452/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f796969322d657874656e73696f6e732f6170702d626173652f6c696e7465722e796d6c3f7374796c653d666f722d7468652d6261646765266c6162656c3d53757065722d4c696e746572266c6f676f3d676974687562)](https://github.com/yii2-extensions/app-base/actions/workflows/linter.yml)[![StyleCI](https://camo.githubusercontent.com/2e44ba381d6c9ab95b548566772bd17337dc56f8a6a646974bf7277720e5be9d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5374796c6543492d5061737365642d3434434331312e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d676974687562266c6f676f436f6c6f723d7768697465)](https://github.styleci.io/repos/1216396624?branch=main)

Our social networks
-------------------

[](#our-social-networks)

[![Follow on X](https://camo.githubusercontent.com/332c1b1e043dfb940b95825f7863dc473f6924ddacdd6738cbbbba08f49e1862/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f2d466f6c6c6f772532306f6e253230582d3144413146322e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d78266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d303030303030)](https://x.com/Terabytesoftw)

License
-------

[](#license)

[![License](https://camo.githubusercontent.com/680c8d62ba2d5a71d7099b6e81114fb0b22d99086c121fd178e1149afc669d44/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4253442d2d332d2d436c617573652d627269676874677265656e2e7376673f7374796c653d666f722d7468652d6261646765266c6f676f3d6f70656e736f75726365696e6974696174697665266c6f676f436f6c6f723d7768697465266c6162656c436f6c6f723d353535353535)](LICENSE)

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance64

Regular maintenance activity

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/524d2b46690f41fce7188d369488a35e7624e6c5a264d82aacd08548bfd156ab?d=identicon)[terabytesoftw](/maintainers/terabytesoftw)

---

Top Contributors

[![terabytesoftw](https://avatars.githubusercontent.com/u/42547589?v=4)](https://github.com/terabytesoftw "terabytesoftw (8 commits)")

---

Tags

application-templateconsolemailmigrationsphprbacscaffoldscaffold-provideruser-authenticationyii2yii2-extensions

### Embed Badge

![Health badge](/badges/yii2-extensions-app-base/health.svg)

```
[![Health](https://phpackages.com/badges/yii2-extensions-app-base/health.svg)](https://phpackages.com/packages/yii2-extensions-app-base)
```

###  Alternatives

[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24726.4M22](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

13045.3M6.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

596920.8k12](/packages/php-tui-php-tui)[styleci/cli

The CLI tool for StyleCI

70464.1k9](/packages/styleci-cli)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
