# Online Store Engine !

Online store engine based on [Yii 2](http://www.yiiframework.com/)

## CRON

```
* * * * * root php /var/www/html/yii payment/check-sber-qr-status
* * * * * root php /var/www/html/yii payment/check-form-payment-status
* * * * * root php /var/www/html/yii notice
* * * * * root php /var/www/html/yii notice/contact-form
* * * * * root php /var/www/html/yii notice/payment-form
* * * * * root php /var/www/html/yii notice/payment
* * * * * root php /var/www/html/yii notice/send-to-oms
* * * * * root php /var/www/html/yii notice/admitad
*/30 * * * * root php /var/www/html/yii monitor/domain-status
*/30 * * * * root php /var/www/html/yii monitor/disk
*/30 * * * * root php /var/www/html/yii clean/ppv-price
0 */4 * * * root php /var/www/html/yii backup
0 1 * * * root /var/www/dump/dump.sh
0 9 * * * root php /var/www/html/yii backup/clean
```

## DIRECTORY STRUCTURE

      assets/             contains assets definition
      commands/           contains console commands (controllers)
      components/         contains components
      config/             contains application configurations
      controllers/        contains Web controller classes
      files/              containes some files. Example - *.csv files for import. Ignored by git
      mail/               contains view files for e-mails
      migrations/         migrations for db
      models/             contains model classes
      modules/            contains app modules
      runtime/            contains files generated during runtime
      src/                contains styles and js source files
      tests/              contains various tests for the basic application
      themes/             contains view file for themes
      vendor/             contains dependent 3rd-party packages
      views/              contains view files for the Web application
      web/                contains the entry script and Web resources

## REQUIREMENTS

PHP Version 7.1.8
MySQL Version 5.7
Node Version 14.19.1

## INSTALLATION

Clone project via [git](https://git-scm.com/)

```
$ git clone https://github.com/larek/mebel-network-1.git
$ cd ./mebel-network-1
```

Install [composer](https://getcomposer.org/) dependencies

```
$ composer install
```

Install [npm](https://www.npmjs.com/) dependencies

```
$ npm install
```

## CONFIGURATION

### Config files

Copy config files

```
$ cp ./config/db-example.php ./config/db.php
$ cp ./config/dbDonor-example.php ./config/dbDonor.php
$ cp ./config/params-example.php ./config/params.php
```

Create .env file

```
mode=dev
db=mebel
username=root
password=qwerty
product_randomProductIds=5
category_randomProductIds=5
```

### Database

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

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

Setup migration

```
$ php yii migrate
```

## RUN HTTP SERVER

You can run http server via own tools or yii2 server command

```
$ php yii serve
```

## TO DO

- docker for develop, ci/cd and prod
- test
- typescript
- webpack 5
- docs
- db for develop
- Psalm
