Coder Social home page Coder Social logo

coffee-bone's Introduction

Coffee-bone

Boilerplate for single page app built on CoffeeScript, Backbone, Sass, Gulp, Browserify, amongst other things...

Although it technically works "out of the box" (-ish), really requires some configuration, and probably contains a lot of extra crap you don't need.

Install using NPM

  1. $ cd [YOUR PROJECT FOLDER]
  2. $ npm install coffeebone
  3. $ node node_modules/coffeebone/clean.js
  4. $ node install.js [APP NAMESPACE] optional - just namespaces app in all coffee files
  5. $ npm install
  6. $ gulp

Install

  1. Clone repo into [DIR NAME]
  2. $ cd [DIR NAME]
  3. $ npm install
  4. $ node install.js [APP NAMESPACE] optional - just namespaces app in all coffee files
  5. $ gulp

Gulp tasks

  • $ gulp - development mode

    • Watchify (browserify)
    • Compile Sass
    • Autoprefix CSS
    • Minify XML templates
    • Optimise images
    • BrowserSync (local server)
      • watch for changes in .coffee, .scss, templates.xml and images, trigger repeat
  • $ gulp build - pre-deploy build

    • Browserify
    • Remove console.logs
    • Compile Sass
    • Autoprefix CSS
    • Combine media queries
    • Minify CSS
    • Minify XML templates
    • Concatenate vendor JS
    • Uglify JS (vendor + main application JS)
    • Custom modernizr build based on refs used through app -- TO DO
    • Iconizr -- TO DO
  • Others:

    • Check /gulp/tasks - each file corresponds to an individual gulp task

General FE app structure notes

  • Router.coffee - capture / modify URL hashChange events
  • Nav.coffee - list all available site routes, handle / delegate URL hashChange events
  • AppView.coffee - Core view, all UI bound here. Anything with a deeplink in Wrapper, any modal-only content in ModalManager
  • Wrapper.coffee
    • mapping for all site deeplinked views
    • each view may be an AbstractViewPage or AbstractViewModal
    • handle management of deeplinked pages / modals based on view 'type' and history state
    • trigger sub-route event changing
  • AbstractViewPage / AbstractViewModal - URL based pages, built in methods for page transitions
  • _ModalManager.coffee - custom modal management (non URL-based popups)

Important FE utils / data management

  • API.coffee - use to retrieve all endpoints
  • UserData.coffee - holds all user data, convenience methods to integrate with assumed user API endpoints (login / logout etc)
  • Templates.coffee - all application HTML is loaded via single XML file, this templates wrapper allows getter based on ID
  • Locale.coffee - all localised copy is expected in JSON file format, based on predefined (or detected) ISO-compatible locale code. This class offers wrapper to get localised string based on unique ID.
  • Analytics.coffee - Google Analytics custom event firing, requires custom JSON containing ID / event string mappings.
  • Share.coffee - Wrapper for sharing to various social networks in popup windows (except FB, this should be done via Facebook.coffee class)
  • Others - just look around :)

Included SDKs

These come packaged in wrapper classes that load the SDKs asynchronously and have some helper methods for API interaction

  • Facebook (Facebook.coffee)
  • Google+ (GooglePlus.coffee)

Included JS libs

  • Backbone (+ jQuery + Underscore + Backbone DeepModel)
  • TweenLite.js (+ CSSPlugin + EasePack)

Sass

  • Normalise
  • Custom easing
  • Various helpers + mixins

coffee-bone's People

Contributors

naso avatar neilcarpenter avatar silviopaganini avatar

Watchers

 avatar

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.