PHPackages                             wfcreations/yii2-app-api - 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. [Framework](/categories/framework)
4. /
5. wfcreations/yii2-app-api

ActiveProject[Framework](/categories/framework)

wfcreations/yii2-app-api
========================

Yii 2 Advanced Project Template

1.0.0(6y ago)4556519[2 issues](https://github.com/desenvolvedorindie/yii2-app-api/issues)BSD-3-ClausePHPPHP &gt;=5.4.0

Since Apr 15Pushed 6y ago10 watchersCompare

[ Source](https://github.com/desenvolvedorindie/yii2-app-api)[ Packagist](https://packagist.org/packages/wfcreations/yii2-app-api)[ Docs](http://www.yiiframework.com/)[ RSS](/packages/wfcreations-yii2-app-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (2)Used By (0)

Yii 2 API Project Template
==========================

[](#yii-2-api-project-template)

Yii 2 API Project Template is a skeleton [Yii 2](http://www.yiiframework.com/) application best for developing complex Web applications with multiple tiers.

The template includes four tiers: front end, back end, api, and console, each of which is a separate Yii application.

The template is designed to work in a team development environment. It supports deploying the application in different environments.

[![Latest Stable Version](https://camo.githubusercontent.com/91e521af27a9c198e180ef968ad914df34c6a348b36bf2c9d82397bd09b00e0c/68747470733a2f2f706f7365722e707567782e6f72672f77666372656174696f6e732f796969322d6170702d6170692f762f737461626c65)](https://packagist.org/packages/wfcreations/yii2-app-api) [![Total Downloads](https://camo.githubusercontent.com/9bfa3159070bde81a416e842f89c46b96c180d1d849957bcdab9e225dcc5f318/68747470733a2f2f706f7365722e707567782e6f72672f77666372656174696f6e732f796969322d6170702d6170692f646f776e6c6f616473)](https://packagist.org/packages/wfcreations/yii2-app-api) [![Latest Unstable Version](https://camo.githubusercontent.com/c28cccee0bfd5aa9355f7bdf6e0349b6cf8e8ba6edc45e6c77094321e1e05866/68747470733a2f2f706f7365722e707567782e6f72672f77666372656174696f6e732f796969322d6170702d6170692f762f756e737461626c65)](https://packagist.org/packages/wfcreations/yii2-app-api) [![License](https://camo.githubusercontent.com/87a435cb970f5a330c99fc59363268337c023707199c472008fc47e81758a22e/68747470733a2f2f706f7365722e707567782e6f72672f77666372656174696f6e732f796969322d6170702d6170692f6c6963656e7365)](https://packagist.org/packages/wfcreations/yii2-app-api)

DIRECTORY STRUCTURE
-------------------

[](#directory-structure)

```
api
    config/              contains api configurations
    controllers/         contains Web controller classes
    models/              contains api-specific model classes
    runtime/             contains files generated during runtime
    modules/             contains api versioning
    v1/                  contains module version 1
    web/                 contains the entry script and Web resources
common
    config/              contains shared configurations
    mail/                contains view files for e-mails
    models/              contains model classes used in both backend and frontend
console
    config/              contains console configurations
    controllers/         contains console controllers (commands)
    migrations/          contains database migrations
    models/              contains console-specific model classes
    runtime/             contains files generated during runtime
backend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains backend configurations
    controllers/         contains Web controller classes
    models/              contains backend-specific model classes
    runtime/             contains files generated during runtime
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
frontend
    assets/              contains application assets such as JavaScript and CSS
    config/              contains frontend configurations
    controllers/         contains Web controller classes
    models/              contains frontend-specific model classes
    runtime/             contains files generated during runtime
    views/               contains view files for the Web application
    web/                 contains the entry script and Web resources
    widgets/             contains frontend widgets
vendor/                  contains dependent 3rd-party packages
environments/            contains environment-based overrides
tests                    contains various tests for the advanced application
    codeception/         contains tests developed with Codeception PHP Testing Framework

```

INSTALLATION
------------

[](#installation)

### Install via Composer

[](#install-via-composer)

If you do not have [Composer](http://getcomposer.org/), you may install it by following the instructions at [getcomposer.org](http://getcomposer.org/doc/00-intro.md#installation-nix).

You can then install this project template using the following command:

```
composer global require "fxp/composer-asset-plugin:~1.0.0"
composer create-project --prefer-dist --stability=dev wfcreations/yii2-app-api app

```

Now you should be able to access the application through the following URL, assuming `app` is the directory directly under the Web root.

```
http://localhost/app/api/web/
http://localhost/app/backend/web/
http://localhost/app/frontend/web/

```

CONFIGURATION
-------------

[](#configuration)

### Database

[](#database)

Edit the file `common/config/db.php` with real data, for example:

```
return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=yii2app',
    'username' => 'root',
    'password' => '1234',
    'charset' => 'utf8',
];
```

**NOTE:** Yii won't create the database for you, this has to be done manually before you can access it.

### Enabling JSON Input

[](#enabling-json-input)

To let the API accept input data in JSON format, configure the \[\[yii\\web\\Request::$parsers\]\] property of the `request` [application component](http://www.yiiframework.com/doc-2.0/guide-structure-application-components.html)to use the \[\[yii\\web\\JsonParser\]\] for JSON input:

```
'request' => [
    'parsers' => [
        'application/json' => 'yii\web\JsonParser',
    ]
]
```

> Info: The above configuration is optional. Without the above configuration, the API would only recognize `application/x-www-form-urlencoded` and `multipart/form-data` input formats.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community28

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2225d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a56c00862d725ca2dc582cf92b90cb0fad3400f6a88e71189ec18f6c11a30c8e?d=identicon)[wfcreations](/maintainers/wfcreations)

---

Top Contributors

[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (184 commits)")[![qiangxue](https://avatars.githubusercontent.com/u/993322?v=4)](https://github.com/qiangxue "qiangxue (113 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (40 commits)")[![Ragazzo](https://avatars.githubusercontent.com/u/1748844?v=4)](https://github.com/Ragazzo "Ragazzo (25 commits)")[![desenvolvedorindie](https://avatars.githubusercontent.com/u/1456279?v=4)](https://github.com/desenvolvedorindie "desenvolvedorindie (23 commits)")[![creocoder](https://avatars.githubusercontent.com/u/896494?v=4)](https://github.com/creocoder "creocoder (22 commits)")[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (11 commits)")[![softark](https://avatars.githubusercontent.com/u/342857?v=4)](https://github.com/softark "softark (6 commits)")[![githubjeka](https://avatars.githubusercontent.com/u/874234?v=4)](https://github.com/githubjeka "githubjeka (5 commits)")[![slavcodev](https://avatars.githubusercontent.com/u/757721?v=4)](https://github.com/slavcodev "slavcodev (5 commits)")[![Jasrags](https://avatars.githubusercontent.com/u/131606?v=4)](https://github.com/Jasrags "Jasrags (5 commits)")[![mohorev](https://avatars.githubusercontent.com/u/4974062?v=4)](https://github.com/mohorev "mohorev (5 commits)")[![schmunk42](https://avatars.githubusercontent.com/u/649031?v=4)](https://github.com/schmunk42 "schmunk42 (4 commits)")[![thiagotalma](https://avatars.githubusercontent.com/u/612578?v=4)](https://github.com/thiagotalma "thiagotalma (4 commits)")[![klimov-paul](https://avatars.githubusercontent.com/u/1482054?v=4)](https://github.com/klimov-paul "klimov-paul (4 commits)")[![TriAnMan](https://avatars.githubusercontent.com/u/2266882?v=4)](https://github.com/TriAnMan "TriAnMan (4 commits)")[![resurtm](https://avatars.githubusercontent.com/u/100198?v=4)](https://github.com/resurtm "resurtm (4 commits)")[![kumorig](https://avatars.githubusercontent.com/u/5523938?v=4)](https://github.com/kumorig "kumorig (3 commits)")[![SDKiller](https://avatars.githubusercontent.com/u/2150916?v=4)](https://github.com/SDKiller "SDKiller (3 commits)")[![gonimar](https://avatars.githubusercontent.com/u/756571?v=4)](https://github.com/gonimar "gonimar (3 commits)")

---

Tags

frameworkyii2advancedproject template

### Embed Badge

![Health badge](/badges/wfcreations-yii2-app-api/health.svg)

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

###  Alternatives

[izyue/yii2-app-advanced

Yii 2 Advanced Project Template

1281.9k](/packages/izyue-yii2-app-advanced)[beaten-sect0r/yii2-core

Yii2 Core project template

771.1k](/packages/beaten-sect0r-yii2-core)[razonyang/yii2-app-template

Yii2 App Project Template

262.8k](/packages/razonyang-yii2-app-template)

PHPackages © 2026

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