Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cadyrov/yiiapi
https://github.com/cadyrov/yiiapi
lib yii
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cadyrov/yiiapi
- Owner: cadyrov
- License: bsd-3-clause
- Created: 2020-02-09T07:10:35.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-09-18T15:02:19.000Z (over 4 years ago)
- Last Synced: 2024-10-11T21:41:54.747Z (2 months ago)
- Topics: lib, yii
- Language: PHP
- Size: 654 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
Yii 2 rest api
#base template to rest api
Installation
instal dockerCe
```
sudo dpkg --configure -a
sudo apt update
sudo apt install docker.io
sudo systemctl enable --now docker
apt install -y docker-compose
```install git
```
apt install git
```
install postgresql (only on server)
```
sudo apt install postgresql postgresql-contrib
sudo systemctl start postgresql
sudo systemctl enable postgresql
sudo -i -u postgres
createuser -S -d -r -P -E user
createdb --owner user --encoding utf8 user
exit
```config postgress
```
mcedit /etc/postgresql/XX/main/postgresql.conf
listen_addresses = '*'
mcedit /etc/postgresql/XX/main/pg_hba.conf
host base user 0.0.0.0/0 md5
host base user ::0/0 md5
service postgresql restart
```install project
```
cd /var/www
git clone https://github.com/cadyrov/yiiapi.git
cd ./cadyrov
set project db config like pgsql:host=serveAdress;port=5432;dbname=dbname
```
up docker
```
docker-compose up -d
#first time update depends
docker exec -it yiiapi_php_1 /bin/bash
php composer.phar self-update
php composer.phar update
create token on github if it is necessary
exit
```fist time up only on server
```
create migrations
php yii migrate --migrationPath=@yii/rbac/migrations/
php yii migrate
create init(remove all users and rights and create default - [email protected]/[email protected])
php yii rbac/init
```