Coder Social home page Coder Social logo

cordovaboilerplate's Introduction

Cordova Boilerplate

An extremely simple Apache Cordova app that can be used as boilerplate for apps developed with modularity and performance in mind.

The proposed boilerplate has been developed with MODULARITY and PERFORMANCE in mind, it should be totally memory leaks free and ready-to-be-used in production.

As a reference, give a look at the following features:

  • configuration map for keeping all the used libraries organized and easily interchangeable
  • support for Backbone
  • support for SASS
  • integrated with the Ratchet 2.0.2 UI framework for mobile
  • integrated with Leaflet 0.7.7, the mobile-friendly JavaScript library for embedding maps in your web app
  • integrated with the Underscore 1.8.3 utility JavaScript library
  • support for the following gestures: tap, double tap, long tap, swipe (in alle directions), pinch in, pinch out. Gestures are managed via the -touch- and -gesture- extensions of Zepto.js
  • automatic precompilation of HTML5 templates, which are organized into a super simple map
  • automatic preloading of static images, so that they do not flicker when being loaded the first time (via Dimitar Christoff's pre-loader)
  • an emulate.sh script for automatically building the project in Sublime (see here)
  • all Require dependencies are organized using the comfortable Require syntactic sugar
  • minimal responsive grid system for quickly organizing contents in a 12-columns grid via IceCream
  • overridden the Backbone extend so that its objects can now be easily spotted in the Chrome heap profiler
  • included the concept of Page, it extends Backbone.View and represents a full screen of the mobile application, it can be used for customly manage in the future the navigation between pages of the app
  • a close method for closing each view and managing all its inner views and bound events
  • a changePage method for the Backbone Router that manages to switch between mobile app pages in a generic and reusable manner
  • generic function to show a web page within a Cordova application and checking if the user has an Internet connection
  • other useful functions are spread within the boilerplate, such as mobile-friendly CSS3 stylesheet, organization of the project in semantic directories (like: templates, js, img), etc.
  • other convenience JavaScript functions, such as the one for stripping XML-based strings, checking if a JS object is empty, String.startsWith, String.endsWith, and so on.

Please, if you find some bugs or aspects to be enhanced, drop be a line!

Used frameworks

  • Cordova 6.x: the platform for building native mobile applications using HTML5, CSS3 and JavaScript
  • Backbone 1.3.3: a JavaScript MVC framework for giving structure to (mobile) web apps
  • RequireJS 2.2.0: a JavaScript file and module loader for keeping your JavaScript codebase modular and well organized
  • Handlebars 4.0.5: a minimal templating engine based on Mustache
  • Zepto 1.1.3: minimalist JavaScript library for DOM traversing, event handling, animations, gestures, etc.

App description

Basically, the web app is composed of two simple views (represented as different Handlebars templates), backed by a JavaScript module defined using Require JS. Zepto (or jQuery) is used as a convenience library.

The web app is purposefully super-simple, it shows:

  • a structural view containing the two basic views (it is supposed to be used as navigation hub)
  • the first view contains a string that can be filled dynamically by the Backbone model behind it
  • the second view shows a Leaflet map centered on L'Aquila, the city I currently live in

Screenshots

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.