Skip to content

yiisoft/app-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ecef1f1 · Apr 13, 2025
May 22, 2024
Apr 13, 2025
Oct 27, 2024
Oct 29, 2024
Nov 2, 2020
Feb 19, 2024
Feb 11, 2024
Oct 27, 2024
Oct 8, 2023
Nov 3, 2022
Nov 3, 2022
Jul 1, 2024
Oct 27, 2024
Nov 29, 2020
Mar 31, 2023
May 19, 2024
Nov 13, 2020
Oct 27, 2024
Apr 13, 2025
Oct 18, 2023
Nov 3, 2022
Feb 11, 2024
Jul 9, 2024
Oct 17, 2023
Jan 11, 2022
Feb 11, 2024
Feb 11, 2024
Feb 11, 2024
Feb 19, 2023
Aug 15, 2021

Yii

Yii API template


Latest Stable Version Total Downloads build codecov static analysis

API application template for Yii 3.

Requirements

  • PHP 8.1 or higher.

Local installation

If you do not have Composer, you may install it by following the instructions at getcomposer.org.

Create a project:

composer create-project yiisoft/app-api --stability=dev myproject
cd myproject

To run the app:

./yii serve

Now you should be able to access the application through the URL printed to console. Usually it is https://127.0.0.1:8080.

Authorization is performed via the X-Api-Key header.

Installation with Docker

Fork the repository, clone it, then:

cd myproject
make composer update

To run the app:

make up

To stop the app:

make down

The application is available at https://localhost. Authorization is performed via the X-Api-Key header.

API Documentation

API documentation is available at /docs. It is built from OpenAPI annotations (@OA).

See Swagger-PHP documentation for details on how to annotate your code.

Getting help

If you need help or have a question, the Yii Forum is a good place for that. You may also check out other Yii Community Resources.

Codeception testing

The template comes with ready to use Codeception configuration. To execute tests, in local installation run:

./vendor/bin/codecept build

./yii serve > ./runtime/yii.log 2>&1 &
./vendor/bin/codecept run

For Docker:

make codecept build

make codecept run

Static analysis

The code is statically analyzed with Psalm. To run static analysis:

./vendor/bin/psalm

or, using Docker:

make psalm

License

The Yii API template is free software. It is released under the terms of the BSD License. Please see LICENSE for more information.

Maintained by Yii Software.

Support the project

Open Collective

Follow updates

Official website Twitter Telegram Facebook Slack