davidruisinger / ionic-better-structure

An alternative ionic project skeleton with a cleaner structure
39 stars 12 forks source link

This is an alternative project structure for the Ionic Framework demonstrated with the ionic tabs starter.

How to use this project

To use this starter create a new project folder (e.g. 'myApp') for your app and clone this repository into it.

$ cd mkdir myApp
$ git clone https://github.com/flavordaaave/ionic_better_structure.git

Then run npm and bower to get all needed dependencies:

$ npm install
$ bower install

How this project is structured

All working files are underneath the 'src' folder trying to follow the angular styleguide created by johnpapa.

/src
    /app
    /images
    /lib
    /styles
    index.html

Everything is set up to serve from this src folder using

$ ionic serve

Build process

This project comes with a before_build hook to run the 'gulp build' task before actually building the app with cordova. The 'gulp build' task concatenates, minifies and copies the files into the 'www' folder from where cordova is loading the files. So you can just use the standard ionic build commands:

$ ionic platform add ios
$ ionic build ios
$ ionic emulate ios

Included gulp tasks

A bunch of useful gulp tasks have been copied from the HotTowel yeoman generator created by johnpapa and modified to work with ionic.

Task Listing

Code Analysis

Testing

Cleaning Up

Fonts and Images

Styles

Lib Files

Angular HTML Templates

Serving Development Code

Building Production Code

NOTE: This project contains a before_build hook for cordova which so that the gulp build task is run automatically when building with cordova build [platfrom] or ionic build [platfrom]