├── .gitignore
├── .travis.yml
├── CNAME
├── README.md
├── build
├── .requirejs_version
├── build.js
├── build.sh
├── output
│ ├── css
│ │ └── styles.css
│ ├── index.html
│ └── js
│ │ └── main.js
├── r.js
├── server
└── update_requirejs.sh
├── css
├── 960.css
├── bootstrap.css
├── normalize.css
├── styles.css
└── theme.css
├── images
├── backboneboilerplate_logo.png
├── favicon.png
└── page_bg.png
├── img
├── glyphicons-halflings-white.png
└── glyphicons-halflings.png
├── index.html
├── js
├── boilerplate.js
├── collections
│ └── projects.js
├── events.js
├── libs
│ ├── backbone
│ │ ├── backbone-min.js
│ │ └── backbone-optamd3-min.js
│ ├── bootstrap
│ │ └── bootstrap.js
│ ├── jquery
│ │ └── jquery-min.js
│ ├── lodash
│ │ └── lodash.js
│ ├── require
│ │ ├── require.js
│ │ └── text.js
│ ├── springy
│ │ ├── springy.js
│ │ └── springyui.js
│ └── underscore
│ │ └── underscore-min.js
├── main.js
├── models
│ └── projects.js
├── router.js
├── views
│ ├── app.js
│ ├── backbone
│ │ ├── page.js
│ │ ├── section.js
│ │ └── sidemenu.js
│ ├── dashboard
│ │ └── page.js
│ ├── footer
│ │ └── footer.js
│ ├── header
│ │ └── menu.js
│ ├── manager
│ │ └── page.js
│ ├── modules
│ │ └── page.js
│ └── optimize
│ │ └── page.js
└── vm.js
├── package.json
└── templates
├── backbone
├── page.html
└── sidemenu.html
├── dashboard
└── page.html
├── footer
└── footer.html
├── header
└── menu.html
├── home
└── main.html
├── layout.html
├── manager
└── page.html
├── modules
├── modules.html
├── page.html
└── untitled
└── optimize
└── page.html
/.gitignore:
--------------------------------------------------------------------------------
1 | *.swp
2 | node_modules
3 |
--------------------------------------------------------------------------------
/.travis.yml:
--------------------------------------------------------------------------------
1 | language: node_js
2 |
3 | # test on two node.js versions: 0.4 and 0.6
4 | node_js:
5 | - 0.4
6 | - 0.6
7 | - 0.7
8 |
9 |
--------------------------------------------------------------------------------
/CNAME:
--------------------------------------------------------------------------------
1 | backboneboilerplate.com
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Backbone boilerplate
2 | [http://backboneboilerplate.com](http://backboneboilerplate.com) is a community driven effort to help developers learn and rapidly deploy single page web applications.
3 |
4 | ## Philosophy
5 | Coming soon
6 |
7 |
8 | ## Other resources
9 |
10 | [http://backbonetutorials.com](http://backbonetutorials.com) - As single page apps and large scale javascript applications become more prominent on the web, useful resources for those developers who are jumping the ship are crucial.
11 |
12 | ## About the author
13 |
14 | **Contact:**
15 |
16 | * [@neutralthoughts](http://twitter.com/neutralthoughts) on twitter
17 | * Github - https://github.com/thomasdavis
18 | * thomasalwyndavis@gmail.com
19 |
20 | **Projects:**
21 |
22 | * Javascript Library CDN - http://cdnjs.com
23 | * Backbone.js Tutorials - http://backbonetutorials.com
24 | * Proposal Generation Start up - http://protosal.com
25 | * Technical Blog - http://thomasdavis.github.com
26 | * Quora - http://www.quora.com/Thomas-Davis
27 | * StackOverflow - http://stackoverflow.com/users/580675/thomas-davis
28 |
29 | Love you mum!
30 |
31 |
--------------------------------------------------------------------------------
/build/.requirejs_version:
--------------------------------------------------------------------------------
1 | 2.1.5
2 |
--------------------------------------------------------------------------------
/build/build.js:
--------------------------------------------------------------------------------
1 | ({
2 | name: '../js/main',
3 | baseUrl: '../js',
4 | out: 'output/js/main.js',
5 | findNestedDependencies: true,
6 | mainConfigFile: '../js/main.js'
7 | })
8 |
--------------------------------------------------------------------------------
/build/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rm -rf output
4 | node r.js -o build.js
5 | node r.js -o cssIn=../css/styles.css out=output/css/styles.css
6 |
7 | cp ../index.html output/index.html
8 | REQUIRE_VERSION='2.1.5'
9 | SEDCMD='sed -i'
10 | if [[ $OSTYPE == *"darwin"* ]]; then
11 | SEDCMD=$SEDCMD' .tmp'
12 | fi
13 | SEDCMD=$SEDCMD' s/js\/libs\/require\/require.js/http:\/\/requirejs.org\/docs\/release\/'$REQUIRE_VERSION'\/minified\/require.js/g output/index.html'
14 | $SEDCMD
15 | rm -f output/*.tmp
16 |
--------------------------------------------------------------------------------
/build/output/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
This is a self-documenting example app useful for quick developer and/or learning backbone.js.
4 |There are many boiler plates for Backbone.js boilerplates popping up over the place with different philosophies. 5 | This solution aims to be absolutely light-weight and robust keeping the following points in mind;
6 |The project aims at being a modular backbone environment with as little authority on development as possible such that developers can innovate and contribute in an attempt to mimic the success of backbone.js ambiguous nature.
16 | 17 |Simply clone the repo and serve the files on a http server (nginx, apache)
19 |git clone https://github.com/thomasdavis/backboneboilerplate.git
20 | Alternatively run
21 |node build/server22 |
You may need to install Express
23 |npm install express24 | -------------------------------------------------------------------------------- /templates/footer/footer.html: -------------------------------------------------------------------------------- 1 |
Thomas Davis - Front End Web Developer
6 | Follow @neutralthoughts 7 |Jason Ormand - Front End Web Developer
10 | Follow @okor 11 |This page talks about vm.js(View Manager) which is included in this boilerplate. Vm.js helps control the life cycle of views and assist in areas such as;
4 |The View Manager can also be used for producing cool charts such as in the proof of concept in footer of the page. 12 | I'd love to plot the Event bus on top of this graph in the future to see how your applications events are tied up
13 |Test: Add View
-------------------------------------------------------------------------------- /templates/modules/modules.html: -------------------------------------------------------------------------------- 1 | a 2 | a 3 | -------------------------------------------------------------------------------- /templates/modules/page.html: -------------------------------------------------------------------------------- 1 |3 | Javascript currently lacks a native way to organized your code into modules unlike other languages. 4 | This has lead to developers writing spaghetti code or using global variable namespaces which both end 5 | diastrously when scaling. 6 |
7 |I'm sure most people understand the benefits of 'modularized' code. But due to the nature of front-end development 8 | it has been quite disregarded up until now.
9 | 10 |Asynchronous Module Definitions designed to load modular code asynchronously in the browser and server. It is actually a fork of the Common.js specification. Many script loaders have built their implementations around AMD, seeing it as the future of modular Javascript development.
12 | 13 |Backboneboilerplate.com supports Require.js the default AMD loader. It has a vibrant open-source ecology.
14 | 15 |Compare backboneboilerplate.com to others here
-------------------------------------------------------------------------------- /templates/modules/untitled: -------------------------------------------------------------------------------- 1 | a 2 | a 3 | -------------------------------------------------------------------------------- /templates/optimize/page.html: -------------------------------------------------------------------------------- 1 |The boilerplate project contains a `build` folder and is designed to be a one line execution optimization process.
3 | 4 |./build.sh
from inside the build folder12 | The build process uses the require.js optimizer called r.js, it traverses through the dependency list and compiles and minifies them intelligently. 13 |
14 |15 | Using r.js once again it runs over styles.css and inlines all the style sheets into one and then minifies the file. 16 |
17 |18 | Finally it creates a directory for your output and replaces the relative path to require.js with the latest version hosted on cdnjs.com 19 |
20 |21 | You should now have one Javascript file, one CSS file and the index.html 22 |
23 |24 | A demo of the outputted code can be found at http://backboneboilerplate.com/build/output/, make sure you check out the network request tab! (ignore the twitter assets)
25 | 26 | 27 | --------------------------------------------------------------------------------