Giter VIP home page Giter VIP logo

yii2-start's Introduction

Yii2-start

DEMO:

Frontend: http://yii2-start.find-freelancer.pro
Backend: http://yii2-start.find-freelancer.pro/backend/

Authentication:
Login: demo
Password: demo12345

Installation and getting started:

If you do not have Composer, you may install it by following the instructions at getcomposer.org.

  1. Run the following commands to install Yii2-Start:
php composer.phar global require "fxp/composer-asset-plugin:1.0.0-beta2"
php composer.phar create-project --prefer-dist --stability=dev vova07/yii2-start yii2-start
  1. Run command: cd /my/path/to/yii2-start/ and go to main application directory.
  2. Run command: php requirements.php and check the requirements.
  3. Run command: php init to initialize the application with a specific environment.
  4. Create a new database and adjust it configuration in common/config/db.php accordingly.
  5. Apply migrations with console commands:
    • php yii migrate --migrationPath=@vova07/users/migrations
    • php yii migrate --migrationPath=@vova07/blogs/migrations
    • This will create tables needed for the application to work.
    • You also can use database dump db.sql from my/path/to/yii2-start/common/data, but however I recommend to use migrations.
  6. Set document roots of your Web server:

For Apache:

<VirtualHost *:80>
    ServerName www.yii2-start.domain # You need to change it to your own domain  
    ServerAlias yii2-start.domain # You need to change it to your own domain  
    DocumentRoot /my/path/to/yii2-start # You need to change it to your own path  
    <Directory /my/path/to/yii2-start> # You need to change it to your own path  
  	  AllowOverride All  
    </Directory>  
</VirtualHost>
  • Use the URL http://yii2-start.domain to access application frontend.
  • Use the URL http://yii2-start.domain/backend/ to access application backend.

For Nginx:

___Frontend___

``` 
server {
    charset utf-8;
    client_max_body_size 128M;

    listen 80; ## listen for ipv4
    # listen [::]:80 ipv6only=on; ## listen for ipv6

    set $yii2StartRoot '/my/path/to/yii2-start'; ## You need to change it to your own path

    server_name yii2-start.domain; ## You need to change it to your own domain
    root $yii2StartRoot/frontend/web;
    index index.php;

    #access_log  $yii2StartRoot/log/frontend/access.log;
    #error_log   $yii2StartRoot/log/frontend/error.log;

    location / {
        # Redirect everything that isn't a real file to index.php
        try_files $uri $uri/ /index.php?$args;
    }

    location /statics {
        alias $yii2StartRoot/statics/web/;
    }

    # uncomment to avoid processing of calls to non-existing static files by Yii
    #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
    #    try_files $uri =404;
    #}
    #error_page 404 /404.html;

    location ~ \.php$ {
        #include fastcgi_params;
        include fastcgi.conf;
        fastcgi_pass   127.0.0.1:9000;
        #fastcgi_pass unix:/var/run/php5-fpm.sock;
        try_files $uri =404;
    }

    location ~ /\.(ht|svn|git) {
        deny all;
    }
}
```

__Backend__

```
server {
    charset utf-8;
    client_max_body_size 128M;

    listen 80; ## listen for ipv4
    # listen [::]:80 ipv6only=on; ## listen for ipv6

    set $yii2StartRoot '/my/path/to/yii2-start'; ## You need to change it to your own path
    
    server_name backend.yii2-start.domain; ## You need to change it to your own domain
    root $yii2StartRoot/backend/web;
    index index.php;

    #access_log  $yii2StartRoot/log/backend/access.log;
    #error_log   $yii2StartRoot/log/backend/error.log;

    location / {
        # Redirect everything that isn't a real file to index.php
        try_files $uri $uri/ /index.php?$args;
    }

    location /statics {
        alias $yii2StartRoot/statics/web/;
    }

    # uncomment to avoid processing of calls to non-existing static files by Yii
    #location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
    #    try_files $uri =404;
    #}
    #error_page 404 /404.html;

    location ~ \.php$ {
        #include fastcgi_params;
        include fastcgi.conf;
        fastcgi_pass   127.0.0.1:9000;
        #fastcgi_pass unix:/var/run/php5-fpm.sock;
        try_files $uri =404;
    }

    location ~ /\.(ht|svn|git) {
        deny all;
    }
}
```

**Remove `'baseUrl' => '/backend'` from `/my/path/to/yii2-start/backend/config/main.php`.**

- Use the URL `http://yii2-start.domain` to access application frontend.
- Use the URL `http://backend.yii2-start.domain` to access application backend.

Notes:

By default will be created one super admin user with login admin and password admin12345, you can use this data to sing in application frontend and backend.

Themes:

  • Application backend it's based on "AdminLTE" template. More detail about this nice template you can find here.
  • Application frontend it's based on "Flat Theme". More detail about this nice theme you can find here.

yii2-start's People

Contributors

vova07 avatar asetss avatar tom910 avatar bolmas avatar nikosid avatar

Watchers

Edd Osorio 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.