17 Nov, 2016

Codeigniter 3 project via Composer with Bower and Gulp

Setup Codeiginiter


Please make sure that you have properly configured composer on your machine before following the steps in this tutorial. More info here:

https://getcomposer.org/doc/00-intro.md

Assumptions made in the commands:

  • Your projects folder is called “Code”;
  • The project we use is called “our_new_project”;

Steps to follow:

  1. cd Code
  2. composer create-project kenjis/codeigniter-composer-installer our_new_project
  3. cd our_new_project
  4. php bin/install.php translations 3.1.0
  5. composer update
  6. composer require kenjis/codeigniter-cli --dev
  7. php vendor/kenjis/codeigniter-cli/install.php
  8. Move the contents of the public folder to the root of the project and edit the content of the index.php file to match the change (paths in $system_path and $application_folder);
  9. php cli

Using:

Setup bower, gulp and minimal packages


Please make sure that bower and npm are globally installed on your machine.

Steps to follow:

  1. cd Code
  2. cd our_new_project
  3. bower init
  4. bower install bootstrap --save-dev
  5. npm install --save-dev gulp
  6. npm install --save-dev main-bower-files
  7. npm install --save-dev gulp-uglify
  8. npm install --save-dev gulp-minify
  9. npm install --save-dev gulp-concat
  10. npm install --save-dev gulp-filter
  11. npm install --save-dev gulp-flatten
  12. npm install --save-dev gulp-replace

Create a file named gulpFile.js and edit its content to:

More steps:

  1. gulp
  2. Please remember to run the gulp command after adding any new library;
  3. Include the generated files in your project’s header file:

Using: