Skip to content
Project on YII2 framework for create short url (url shortener)
Branch: master
Clone or download
Latest commit c1dfb6d Feb 26, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
assets add localization Mar 5, 2017
components
config fix footerJS error Feb 18, 2018
controllers
mail/layouts
messages grammar mistake Oct 8, 2017
migrations
models * add url search Feb 25, 2018
rbac add rules and fix code column Mar 19, 2017
runtime
tests * fix test Feb 25, 2018
views
web little fix Jul 1, 2017
.bowerrc Init Jan 21, 2016
.gitignore init new tests settings Mar 9, 2017
.htaccess
README.md Update README Feb 23, 2018
codeception.yml init new tests settings Mar 9, 2017
composer.json
yii
yii.bat Init Jan 21, 2016

README.md

Yii 2 Minify-URL Project (Shortener)

Codacy Badge

Project on Yii2 framework for create your short business url with analytics (geo position (country), browser, platform, referal url)

You can see demo

What can you do

  • Input your long url and get 'public' short link with analytics information
  • For registration you can use any popular social networks (VK, FB, Google+, etc)
  • After registration, you can input your long url and get 'private' shortlink. In 'private' url, analytic information hidden from other users

For example:

Example

Install via Composer


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

You can then install the application using the following command:

git clone https://github.com/gaalferov/yii2-minify-url.git .
composer global update fxp/composer-asset-plugin --no-plugins
composer install

GETTING STARTED

After you install the application, you have to conduct the following steps to initialize the installed application. You only need to do these once for all.

  • Create a new database
  • Add and edit the file config/db-local.php with real data, for example:
<?php
return [
    'class' => 'yii\db\Connection',
    'dsn' => 'mysql:host=localhost;dbname=yii2',
    'username' => 'yourUsername',
    'password' => 'yourPassword',
    'charset' => 'utf8',
    'tablePrefix' => 'nix_',
];
  • Add to file config/web-local.php your oauth data, for example:
<?php
return  [
  'components' => [
    'authClientCollection' => [
      'clients' => [
        'vkontakte' => [
          'class' => 'budyaga\users\components\oauth\VKontakte',
          'clientId' => 'XXX',
          'clientSecret' => 'XXX',
          'scope' => 'email'
        ],
        'google' => [
          'class' => 'budyaga\users\components\oauth\Google',
          'clientId' => 'XXX',
          'clientSecret' => 'XXX',
        ],
        'facebook' => [
          'class' => 'budyaga\users\components\oauth\Facebook',
          'clientId' => 'XXX',
          'clientSecret' => 'XXX',
        ],
        'github' => [
          'class' => 'budyaga\users\components\oauth\GitHub',
          'clientId' => 'XXX',
          'clientSecret' => 'XXX',
          'scope' => 'user:email, user'
        ],
        'linkedin' => [
          'class' => 'budyaga\users\components\oauth\LinkedIn',
          'clientId' => 'XXX',
          'clientSecret' => 'XXX',
        ],
        'live' => [
          'class' => 'budyaga\users\components\oauth\Live',
          'clientId' => 'XXX',
          'clientSecret' => 'XXX',
        ],
        'yandex' => [
          'class' => 'budyaga\users\components\oauth\Yandex',
          'clientId' => 'XXX',
          'clientSecret' => 'XXX',
        ],
        'twitter' => [
          'class' => 'budyaga\users\components\oauth\Twitter',
          'consumerKey' => 'XXX',
          'consumerSecret' => 'XXX',
        ],
      ],
    ],
  ],
];
  • Apply migrations with console command:
php yii migrate

Now, you can use the application:

Admin user: admin@burl.pro
Admin password: adminpassword

http://localhost/
https://localhost/user/admin (Manage all users)
https://localhost/url (Manage all urls)
https://localhost/user/rbac (Role-Based Access Control)
https://localhost/profile (Your profile)

TESTS

You can use any platforms for run tests:

Phantomj:

phantomjs --webdriver=4444 --ignore-ssl-errors=yes --ssl-protocol=TLSv1

Selenium:

java -jar selenium-server-standalone-2.xx.xxx.jar

Docker container

...
selenium:
  image: jesg/selenium:standalone
  ports:
   - 4444:4444
   - 5910:5910
...

Instruction:

  • Init codeception files:
php vendor/bin/codecept bootstrap
  • Change url to your project in file /tests/acceptance.suite.yml
config:
...
            url: 'http://you_url.loc'
  • Run tests:
php vendor/bin/codecept run
php vendor/bin/codecept run --env phantom
php vendor/bin/codecept run --env firefox
You can’t perform that action at this time.