All Projects → marcoturi → Ionic Boilerplate

marcoturi / Ionic Boilerplate

Licence: mit
✨ An Ionic Starter kit featuring Tests, E2E, Karma, Protractor, Jasmine, Istanbul, Gitlab CI, Automatic IPA and APK, TypeScript 2, TsLint, Codelyzer, Typedoc, Yarn, Rollup, and Webpack 2

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Ionic Boilerplate

ionic-modal-custom-transitions
Add Custom Transitions to Ionic Modals.
Stars: ✭ 22 (-92.88%)
Mutual labels:  ionic, ionic2, ionic3, angular5
angular-progress-bar
This component allow you to easy incorporate progress-bar to angular/ionic project, providing binding and color options
Stars: ✭ 26 (-91.59%)
Mutual labels:  ionic, ionic2, ionic3, angular5
ionic-hockeyapp
Need HockeyApp in your Ionic application, add this package!
Stars: ✭ 19 (-93.85%)
Mutual labels:  ionic, ionic2, ionic3
ionic3-start-theme
Ionic 3 Start Theme with 10 Pages, mock data, providers samples, Storage, Http and more...
Stars: ✭ 130 (-57.93%)
Mutual labels:  ionic, ionic3, angular5
ionicfirebaseauth
Exemplo de alguns tipos de autenticação com Ionic 2 e Firebase
Stars: ✭ 18 (-94.17%)
Mutual labels:  ionic, ionic2, ionic3
ionic-parallax
Parallax Module for Ionic Framework 2+
Stars: ✭ 10 (-96.76%)
Mutual labels:  ionic, ionic2, ionic3
ionic-login-component
Free sample of Premium Ionic Login Component
Stars: ✭ 17 (-94.5%)
Mutual labels:  ionic, ionic3, angular5
ionic3-awesome
😃 ionic3自定义组件及常用例子 演示地址
Stars: ✭ 95 (-69.26%)
Mutual labels:  ionic, ionic2, ionic3
ionic3-image-handling
In this ionic tutorial you will learn how to access the image gallery and take pictures from an ionic app. Also we will show you how to add a image cropper. This ionic tutorial includes a working ionic app example you can reuse for your needs.
Stars: ✭ 35 (-88.67%)
Mutual labels:  ionic, ionic2, ionic3
ionic-uber-clone
Ionic 4 Taxi Booking script
Stars: ✭ 34 (-89%)
Mutual labels:  ionic, ionic2, ionic3
ionic-uuchat
基于ionic3,angular4的实时聊天app,兼容web端。该项目只是前端部分,所有数据需要请求后端服务器,需要配套express-uuchat-api使用。
Stars: ✭ 14 (-95.47%)
Mutual labels:  ionic, ionic2, ionic3
fireblogger
Ionic 2 social media microblogging platform built with firebase 3 as backend
Stars: ✭ 54 (-82.52%)
Mutual labels:  ionic, ionic2, ionic3
ionic-socialsharing-with-deeplinking-example
Ionic Social Sharing and Deep Linking example app. Complete Ionic Tutorial with free example app! Built for Ionic 3.
Stars: ✭ 16 (-94.82%)
Mutual labels:  ionic, ionic2, ionic3
Vue Electron Template
An Electron & Vue.js template with Hot-reloading enabled and common Vue plugins, dev, debug and build scripts configured.
Stars: ✭ 260 (-15.86%)
Mutual labels:  webpack, rollup, boilerplate
sm-coal-app
这是一个使用Ionic2开发的集数据展示,交易,交流于一体的APP
Stars: ✭ 21 (-93.2%)
Mutual labels:  ionic, ionic2, ionic3
ionicfirebasecrud
An example of crud with Firebase and Ionic
Stars: ✭ 15 (-95.15%)
Mutual labels:  ionic, ionic2, ionic3
Dianoia-app
Mobile (Ionic 3 - Angular 4) app about non-pharmaceutical activities and information for people with dementia.
Stars: ✭ 13 (-95.79%)
Mutual labels:  ionic, ionic2, ionic3
docker-ionic-android-sdk
Docker image include android sdk for building ionic framework application
Stars: ✭ 40 (-87.06%)
Mutual labels:  ionic, gitlab-ci, ionic3
ionic-3-video-calling-using-webrtc
This is demo code of how to implement video calling in ionic 3 using webrtc
Stars: ✭ 58 (-81.23%)
Mutual labels:  ionic, ionic2, ionic3
todo-list
TodoList using Ionic2/3 & Firebase: * PWA * SSO Google plus. * Share list via QRcode. * Upload image from Camera or Storage. * Speech Recognition.
Stars: ✭ 18 (-94.17%)
Mutual labels:  ionic, ionic2, ionic3

IONIC Boilerplate

MIT license Dependency Status devDependencies Status build status coverage report Join the chat at https://gitter.im/marcoturi/ionic2-boilerplate
A ionic boilerplate for starting new projects. This boilerplate will follow the best practices for angular and ionic development.

NOTE: I moved Unit tests from running through Rollup to Webpack with release 0.10.0. If you are looking to the old configuration see the rollup branch.

Table of Contents

Features

  • Ionic 3
  • Es-Lodash instead of Lodash to reduce final bundle size.
  • NVM to manage multiple active node.js versions
  • Yarn for fast, reliable, and secure dependency management.
  • BetterScripts for better NPM scripts.
  • ENV variables from package.json injected automatically.
  • Documentation with Typedoc.
  • Continuous Integration with Gitlab CI see here for info.
    • Automatic apk only when pushing to release branch.
    • Automatic ipa through ionic package only when pushing to release branch.
    • A Docker image.
  • Tests
    • Unit tests with Karma.
    • E2E tests with Protractor.
    • Screenshot reporter for Protractor.
    • Code coverage with Istanbul.
    • Gitlab badge see here for info
    • Headless Chrome support for testing
  • Linting
  • GIT
    • Workflow with Commitizen.
    • Automatic changelog.
    • Automatic alignment of app version in config.xml from package.json through cordova hook.

Roadmap

  • Automatic download .ipa in gitlab artificts.

Installation & Configuration

Quick Start

# Required dependecies (on Mac Os also install ios-sim and ios-deploy)
npm i -g cordova ionic yarn
gem install scss_lint

# Clone the repo --depth 1 removes all but one .git commit history
git clone --depth 1 https://github.com/marcoturi/ionic2-boilerplate.git

# Change directory
cd ionic2-boilerplate

# Install project dependencies
yarn --ignore-engines
npm run post-install

# Launch ionic serve
npm run dev

TO RUN IONIC: Make sure you have Node version >= 6.X and NPM >= 3
TO RUN SCSS-LINT: Make sure you have Ruby >= 2

NPM scripts commands

Task Description
dev Run ionic serve
build Full production build. Use --dev flag for dev build.
release Generate changelog based on commits
push Shortcut for git push origin master --follow-tags
lint Lint with tslint
scss-lint Lint scss
test Runs Karma test
test:watch Runs Karma test watching for edits (TDD style)
e2e Runs e2e protractor tests
e2e:interactive Runs e2e protractor tests in interactive mode
docs Generate code documentation through Typedoc
outdated Search npm packages for outdated dependencies
post-install Update web-driver to be able to run e2e tests.
ios:dev Build .ipa using dev environment vars
ios:release Build .ipa with production environment vars
android:dev Build .apk using dev environment vars
android:release Build .apk with production environment vars

Gitlab CI Configuration

  • To get code coverage percentage badge use the following regexp: Lines\s*:\s*(\d*\.?\d+)% in Gitlab CI/CD pipelines.
  • To get the automatic .ipa from ionic package first setup a ionic.io profile with certificates for ios. Secondly add the following Secret variables in Gitlab. N.B. Be sure to don't show Build results (edit project settings) for your repo otherwise those vars could be exposed.
Key Description
IONIC_EMAIL Your ionic.io email
IONIC_PASSWORD Your ionic.io password
IONIC_PACKAGE_BUILD_RELEASE (Optional) Indicate whether this is a release build. Possible values are true or false. Defaults to false.
IONIC_PACKAGE_BUILD_PROFILE Security profile to use for the build, as defined in Ionic.io console.

Tips

Optional Libraries

If you want everything to just work nicely with rollup, use es2015 libraries like lodash-es instead of lodash. In the case of lodash-es try to do: import map from 'lodash-es/map' rather than import { map } from 'lodash-es'. See here for further info. To find examples on how to import 3rd party libs with ionic and rollup see here and here

  • Error logging: Sentry
  • Database: PouchDB or Ionic-storage. Don't use localstorage as it can be deleted by OS to free memory.
  • Time and Dates: MomentJs
  • NGRX pattern/library if you plan to make a big app.

Git Workflow

  • Optionally you can use Git flow
  • If you want to bump the changelog, run "npm run release"
  • This repo has a mirror repo in gitlab for CI after every push on master you will get automatically all tests and lints run. To get .ipa and .apk build you need to push to the release git branch. The reason is to avoid unnecessary builds (free limit is 100/month) for ios.
  • You should consider to write a shortcut in .bashrc for the following commands
    Workflow:
git add .
npm run commit // this will run tslint + scss lint + commit
npm run push // this will run unit tests + push to master
// now check on GITLAB if there are no errors, than if you want push your commits to the release branch to get automatic ipa and apk

Useful Links

Ionic & Cordova

  • Avoid the use of ionic state commands and also ionic plugin/platform. Use directly cordova prepare (or cordova plugin/platform). Also save your plugin/platform only inside config.xml, not package.json to avoid confusion. See this for further informations.

Webstorm

  • Set code style for typescript:
    • {import} -> { import }
    • import * from "lodash" -> import * from 'lodash'
  • Set typescript settings to be used with the version inside node_modules instead of the bundled one
  • Don't activate typescript compiler.
  • Enable tslint in settings
  • Download scss lint plugin and enable it

Windows

  • You should avoid Windows. I tried a lot of times and at the end found myself switching to a Mac VM or Hackintosh or Linux distro. The following tips are not resolutive but can help you set up a nice environment.
  • Instead of windows terminal I used cmder.
  • If you use Webstorm. Set terminal settings as follow -> "cmd.exe" /k ""%CMDER_ROOT%\vendor\init.bat""
  • Remember to re-start webstorm every time you make a change to the terminal.
  • npm install --global --production windows-build-tools //node-gyp fix
  • Set webstorm to write with line endingds LF (mac os or unix)
  • To avoid git warnings: git config core.autocrlf false

License

Copyright (c) 2016 Marco Turi
Source code is open source and released under the MIT license.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].