#clone original repository
git clone git@gitlab.com:oprudkyi/laravel-bootstrap-adminlte-starter-kit.git my_project
#cd to projectcd my_project
#delete origin
git remote rm origin
#use your new repository as main source
git remote add origin git@gitlab.com:oprudkyi/web-site.git
#keep original source for updates
git remote add starter-kit git@gitlab.com:oprudkyi/laravel-bootstrap-adminlte-starter-kit.git
#push to your repository
git push -u origin master
If you are building from the first time out of the source repository, you will
need to generate the configure scripts. From the top directory, do:
./bootstrap.sh
Once the configure scripts are generated, 'make' system can be configured.
From the top directory, do:
./configure
Run ./configure --help to see other configuration options
Install configured dependencies - tools like composer/bower and
components as defined in composer.json, bower.json, package.json :
make download-dependencies
Testing
There are a large number of tests that can all be run
from the top-level directory.
make -k check
make -k check-functional
make -k check-acceptance
This will make all of the libraries (as necessary), and run through
the unit tests defined in each of the client libraries. If a single
language fails, the make check will continue on and provide a synopsis
at the end.
Boostraping development environment
cp .env.example .env
vim .env
#for sqlite db
touch storage/database/play.sqlite
./artisan migrate
#generate key
./artisan key:generate -v
Update dependencies
make update-downloaded-dependencies
or
make update-downloaded-dependencies-production
it will search for updated packages for composer/npm/bower and install them as well will update lock/json files
Mailcatcher integration
Mailcatcher is configured in the .env.example for port 1025,
tests use different port (11031) so tests can be run while development instance of maicatcher is running
Run:
Intergration is based on Laravel Elixir and
Bower as package system (packages installed into vendor/bower_components).
To call bower use something like
The building script is gulpfile.js. System is configured to generate
single js file from all packages provided (as well single css file)
if you add/remove packages, you may also need to edit resources/assets/sass/app.scss as well for adding/removing css/scss/js
use 'make gulp' or 'make gulp-watch' to compile resources
custom css rules you can add to resources/assets/sass/starterkit/starter-kit-customize.scss
it's applied after any other css, so it's possible to change any css behavior here
Manual Deployment Initialization
This isn't adivsed , just for info:
First, clone your repository to production/staging server
configure production environment
./bootstrap.sh
./configure --enable-tests=no
make download-dependencies-production
chmod 777 -R storage
create db (in case of mysql)
sudo mysql
CREATEDATABASEIF NOT EXISTS starterkit_db CHARSET=utf8;
CREATEUSER 'starterkit_user'@'%' IDENTIFIED BY 'starterkit_password';
GRANT ALL PRIVILEGES ON starterkit_db.* TO 'starterkit_user'@'%';
forgot to check browser's console log for errors ?
got complaints from users 'I click but nothing happens' ?
ever taught end-users how to look at browser's console ?
There is small and simple library to avoid or at least reduce
possibility of such problems, specially in case if code isn't covered by
tests.
It catches normally invisible JavaScript errors and exceptions and provides simple way to show them to developer/tester/user.
Simple errors are caught via window.onerror handler.
Errors
inside jQuery callbacks (ajax, onclick etc) are hidden from
window.onerror(), so jQuery is patched in way to call error handler.
You can create own JSEH_showUncaughtException(message) function and replace default one,
place it at the top of the page (before window_error_handler.js)
In case you need to dynamically enable/disable handler (by example if merging/minifying tools are used) you can
set JSEH_enabled variable to true/false.
var JSEH_enabled =false;
//in Laravel/layout.blade.php
var JSEH_enabled =@if(env('JS_ERROR_ALERTER_ENABLED', false)) true @else false @endif ;
After some use of Laravel's throttle feature (api/logins throttle) it started to return 'Too many attempts' when memcached cache is used (as well it is possible to have more issues, in case you depend on lifetime of cached data).
For me it happens after waking up PC from hibernation
short fix:
- just restart memcached
possible explanation:
It seems like issue is related to the way how memcached uses expiration time of values and probably some bug in it. There are two modes possible - one, just number of seconds of how long memcached should keep value, second is Unix timestamp.
while it works great all the time, after some sort of time de-synchronization (by example after suspending/hibernating of PC) Laravel might send expiration time in the past (because php/memcached are caching current timestamp) and memcached might (unchecked) just decide to keep item forever and break any functionality which depends on auto-deletion of values (like throttling 'lockout' key https://github.com/illuminate/cache/blob/master/RateLimiter.php )