Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
samdark committed Oct 27, 2024
1 parent b1a2e43 commit 342ce87
Showing 1 changed file with 54 additions and 10 deletions.
64 changes: 54 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
[![static analysis](https://github.com/yiisoft/app/workflows/static%20analysis/badge.svg)](https://github.com/yiisoft/app/actions?query=workflow%3A%22static+analysis%22)
[![type-coverage](https://shepherd.dev/github/yiisoft/app/coverage.svg)](https://shepherd.dev/github/yiisoft/app)

Web application template for Yii 3.

<p align="center">
<a href="https://github.com/yiisoft/app" target="_blank">
<img src="docs/images/home.png" alt="Home page" >
Expand All @@ -24,32 +26,57 @@

- PHP 8.1 or higher.

## Installation
## Local installation

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

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

```shell
composer create-project --stability=dev yiisoft/app <your project>
composer create-project --stability=dev yiisoft/app myproject
cd myproject
```

In order to launch development web server run:
To run the app:

```shell
composer run serve
```
./yii serve
```

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

## Installation with Docker

Fork the repository, clone it, then:

```shell
cd myproject
make composer update
```

To run the app:

```shell
make up
```

To stop the app:

```shell
make down
```

The application is available at `https://localhost`.

## Directory structure

The application template has the following structure:

```
config/ Configuration files.
docker/ Docker-specific files.
docs/ Documentation.
public/ Files publically accessible from the Internet.
assets/ Published assets.
Expand All @@ -69,6 +96,7 @@ src/ Application source code.
ViewInjection/
tests/ A set of Codeception tests for the application.
vendor/ Installed Composer packages.
Makefile Config for make command.
```

## Configuration
Expand Down Expand Up @@ -130,7 +158,7 @@ use Psr\Log\LogLevel;
],
],
'file-rotator' => [
// maximum file size, in kilo-bytes. Defaults to 10240, meaning 10MB.
// maximum file size, in kilobytes. Defaults to 10240, meaning 10MB.
'maxfilesize' => 10,
// number of files used for rotation. Defaults to 5.
'maxfiles' => 5,
Expand Down Expand Up @@ -199,11 +227,21 @@ See ["Logging"](https://github.com/yiisoft/docs/blob/master/guide/en/runtime/log
## Testing

The template comes with ready to use [Codeception](https://codeception.com/) configuration.
In order to execute tests run:
To execute tests, in local installation run:

```shell
composer run serve > ./runtime/yii.log 2>&1 &
vendor/bin/codecept run
./vendor/bin/codecept build

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

For Docker:

```shell
make codecept build

make codecept run
```

## Static analysis
Expand All @@ -214,6 +252,12 @@ The code is statically analyzed with [Psalm](https://psalm.dev/). To run static
./vendor/bin/psalm
```

or, using Docker:

```shell
make psalm
```

## Support

If you need help or have a question, the [Yii Forum](https://forum.yiiframework.com/c/yii-3-0/63) is a good place for that.
Expand Down

0 comments on commit 342ce87

Please sign in to comment.