Code Monkey home page Code Monkey logo

yiiapi's Introduction

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

yiiapi's People

Contributors

cadyrov avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.