UPD 12.10.2023: This is no more actual for a long time and now used just as a backend sample for the https://github.com/qtrest/qtrest library with the other sample repo https://github.com/qtrest/qtrest-example
Skid.KZ - is a sample WebApp to aggregate some data from Kazakhstan discount services.
Skid.KZ - агрегатор данных со скидочных сервисов Республики Казахстан.
Production URL: http://skid.kz
Developers:
-
Petrov Vitaliy, [email protected]
-
Aboimov Alexander
- ssh-keygen -t rsa and add this to bitbucked repo
0.1) sudo tasksel install lamp-server
0.2) sudo apt-get install php5-curl phpmyadmin php-apc tor tor-geoipdb privoxy apache2-mpm-itk
0.3) sudo a2enmod rewrite
-
Install composer
-
Production
2.1) Clone bare repository 'cd /home/admin/; git clone --mirror [email protected]:kafeg/kupon.git' (manual: https://serverpilot.io/community/articles/how-to$
2.2) GIT_WORK_TREE=/home/admin/web/skid.kz/public_html/ git checkout -f master
2.3) cd /home/admin/web/skid.kz/public_html/
- Development
3.1) 'mkdir ~/web; cd ~/web; git clone [email protected]:kafeg/kupon.git; cd ~/web/kupon'
-
composer.phar global require "fxp/composer-asset-plugin:~1.1.3"
-
composer.phar update
-
Setup database with config/db.php
-
php yii migrate
-
Setup apache virtualhost for web and api parts. See example in docs/skid.kz.apacheexample.conf
-
Setup cron job for recieve and update elements (e.g. https://github.com/DenisOgr/yii2-cronjobs):
-
-
-
-
- /home/admin/web/skid.kz/public_html/yii cron
-
-
-
-
Setup mysql wait_timeout=360
-
php max_execution_time to 240 or 360 in /etc/php5/apache2/php.ini
-
Setup tor proxy in config/params.php and configure privoxy as http://help.ubuntu.ru/wiki/tor
-
sudo chmod 777 -R on runitme directory
skid.kz/deploy/bitbucket-hook-skid.kz.php
- Install git, vagrant, composer
- Git clone this project
- "composer install"
- "vagrant up" command from project root
- Wait for Ansible infrastructure provisioning
- "vagrant ssh" start ssh session on virtual machine and connect
- Project files will be mounted in /vagrant folder. Files are syncing automatically
Test service: http://skid.kz/kupon/default/testapi?serviceId=1
Services ids:
- ChocolifeApi
- BlizzardApi
- KupiKuponApi
- MirKuponovApi
- AutoKuponApi
- BeSmartApi
You MUST specify TESTTYPE!!! http://skid.kz/kupon/default/testapi?serviceId=1&testType=2
- cities
- categories
- coupons for Almaty
- coupons for Astana
- advanced coupon for last coupon id
- advanced coupon for last coupon id with call real update coupon
- advanced coupon for first (oooold) coupon id
- advanced coupon for first (oooold) coupon id with call real update coupon
- advanced coupon for specified couponId
Example: http://skid.kz/kupon/default/testapi?serviceId=2&testType=9&couponId=17538
See 'php yii kupon/cron/' section
Base URL: http://api.skid.kz/v1/coupon
API documentation
- Info: https://github.com/yiisoft/yii2/blob/master/docs/guide/rest-quick-start.md, https://github.com/yiisoft/yii2/blob/master/docs/guide-ru/rest-resources.md
- Search: http://stackoverflow.com/questions/25522462/yii2-rest-query#answer-25618361
- Sorting: http://stackoverflow.com/questions/26884449/sorting-data-in-default-rest-api-yii2-framework