Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eldar34/yii2-api-user
https://github.com/eldar34/yii2-api-user
composer yii
Last synced: 26 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/eldar34/yii2-api-user
- Owner: eldar34
- License: bsd-3-clause
- Created: 2020-12-13T19:07:12.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-02-14T21:32:38.000Z (over 3 years ago)
- Last Synced: 2024-09-30T22:12:50.962Z (about 1 month ago)
- Topics: composer, yii
- Language: PHP
- Homepage: https://back.test2task.ru/documentation/
- Size: 3.17 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
INSTALLATION WITH DOCKER
------------### Prepare settings for DB connection
Create file .env in project base directory. Copy the .env.example file to a local .env
Add your application configuration to a .env or use default congiguration for docker-containers.
### Build application with docker-compose
Run docker-compose command:
~~~
docker-compose up --build
~~~Connect to the docker-service (php) and run command to intall composer:
~~~
docker-compose exec php composer install
~~~Connect to the docker-service (php) and run command to create DB tables:
~~~
docker-compose exec php php yii migrate --interactive=0
~~~Now you should be able to access the application through the following URL:
~~~
http://localhost:9010/
~~~Swagger for testing api endpoints through the following URL:
~~~
http://localhost:9010/documentation/
~~~Adminer for management database through the following URL:
~~~
http://localhost:9020/
~~~### Populating the database
If you want to populate your database with test information, run command:
~~~
docker-compose exec php php yii fixture "*" --interactive=0
~~~After testing you can clear database with command:
~~~
docker-compose exec php php yii fixture/unload "*" --interactive=0
~~~To generate new test data, run command:
~~~
docker-compose exec php php yii fixture/generate-all --count=10 --interactive=0
~~~INSTALLATION
------------### 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 install
~~~### File permissions
If composer don't run script postCreateProject:
~~~
chmod 0777 runtime
chmod 0777 web/assets
chmod 0755 yii
~~~### Prepare settings for DB connection
Create file .env in project base directory. Copy the .env.example file to a local .env
Add your application configuration(recommended) to a .env or use default congiguration for docker-containers.
### Populating the database
If you want to populate your database with test information, run command:
~~~
php yii fixture "*" --interactive=0
~~~After testing you can clear database with command:
~~~
php yii fixture/unload "*" --interactive=0
~~~To generate new test data, run command:
~~~
php yii fixture/generate-all --count=10 --interactive=0
~~~### Swagger
If you want to update swagger documentation run command:
~~~
./vendor/bin/openapi modules/api/controllers -o web/documentation/swagger.json
~~~