Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
generator-bootstrap-backbone-starter
Advanced tools
Yeoman generator for Bootstrap and Backbone starter project: the perfect way to build a Bootstrap BackboneJS project. It uses Bootstrap, Backbone, JSHint, JSCS, Flow and Watch.
Yeoman generator for Bootstrap Starter Template with Backbone.JS. It is the fastest way to start with a Bootstrap project that implements Backbone.JS's Model-View-Router model.
You also get a fully automated document creation from source code, automatic updating of your final webapp name and version in README.md, and an html version of your README.md file.
Install yo
, and generator-bootstrap-backbone-starter
:
npm install -g yo generator-bootstrap-backbone-starter --verbose
Make a new directory, and cd
into it:
mkdir my-new-project && cd $_
Run yo bootstrap-backbone-starter
:
yo bootstrap-backbone-starter
Type:
grunt
This should build your project into dist/ directory. You can type grunt watch
and this will continously build your sources into dist/ directory.
In order to test your web app, you can change to dist/ directory and run a simple http server. For example:
python -m SimpleHTTPServer 8000
You can now find your webapp at http://localhost:8000.
In this section, we describe what each file does in this template and how you can modify them to your needs.
Once everything is installed, you will see a project structure like below:
├── .editorconfig # EditorConfig file for unifying settings across multiple editors.
├── .flowconfig # Config file for flow static type checker.
├── .gitignore # Config file for git to ignore files.
├── .jscsrc # Config file for jscs coding style checker.
├── Gruntfile.js # File of magic. All grunt tasks are in here.
├── HOW_TO_GUIDE.md # This very file.
├── README.md.template # Template file for final README.md.
├── assets # Directory which includes all the Bootstrap assets for edge cases.
│ ├── css
│ │ └── ie10-viewport-bug-workaround.css
│ └── js
│ ├── ie-emulation-modes-warning.js
│ ├── ie10-viewport-bug-workaround.js
│ └── ie8-responsive-file-warning.js
├── jsdoc.conf # Configuration file for jsdoc.
├── package.json # NPM package.json file.
└── src # Source files for your webapp.
| ├── favicon.ico # favicon icon file for your webapp.
| ├── index.html.template # Modified version of index.html from Bootstrap Starter Template.
| ├── models.js # Backbone models.
| ├── router.js # Backbone router.
| ├── starter-template.css # Starter template CSS.
└───└── views.js # Backbone views.
From their website, "EditorConfig is a file format and collection of text editor plugins for maintaining consistent coding styles between different editors and IDEs." This file has a bunch of settings that various editors can read and adjust their behaviour accordingly. You can read more about it on their website
Configuration file for flow type checker. Flow is a static type checker which is helpful in catching null dereferences and unintentional type conversions. You can read more about it on their website.
Configuration file for JSCS coding style checks. We use a modified version of Google JS coding style and full JSDoc3 checks.
This is where all the magic lives. Gruntfile.js describes all the tasks, and how they interact with each other. It can run your tests, create browser version of your tests, run them in the browser, create their coverage reports, create documentation, create your dynamically generated README.md, and README.md.html files and create your final browserified library along with its minimized version.
JSDoc configuration file. You can modify this file to change the behaviour of JSDoc which is used to create documentation from the source code.
NPM package.json file. You describe your webapp in this file. The values for 'name' and 'version' fromthis file are later used in producing README.md file.
Consumed by Gruntfile's 'replace:readmemd' to produce your app's main README.md file.
These three files are the BackboneJS files for our Model-View-Router schema. In the template, they control a button and a simple view to print a simple message when the button is clicked.
Tiny icon file for your web app.
Main CSS file.
Main index.html file for your webapp. This file is a template because replace task in Grunt file will replace template variables with the correct values to produce index.html file in your dist/ directory. These variables include @@name, @@author, @@description (which are read from package.json), and the locations of various JS library dependencies such as jquery, backbone, underscore, etc.
All the files under this directory are Bootstrap dependencies that are referenced in the original Bootstrap Starter Template.
When you run the Grunt tasks, this scaffolding generates a whole bunch of files. They are explained below.
Generated by 'jsdoc' task. All documentation in the src files should follow jsdoc format so that this task can produce all the documentation.
Generated by 'replace', and 'copy'. Your full webapp is under this directory.
Gruntfile.js tasks are closely coupled. Please be careful when you change them.
Deletes docs.
Deletes js, css and html files that are copied as external dependencies.
Deletes js, css and html files created by the project itself.
Copies files from various source directories to dist/ directory. Copies external JS libraries from node_webapps directory to dist/, asset files from assets/ to dist/, and js/css/html files from src/ to dist/.
Runs Flow static type checker.
Runs the code through jscs for coding style checks. This uses a modified version of Google coding style.
Creates documentation from src files using jsdoc.
Runs the code through jshint.
Creates an html version of the README.md file called README.md.html.
Replaces text patterns in index.html.template to produce index.html.
Replaces text patterns in README.md.template to produce README.md.
Runs a continuous task which listens for changes in src/ directory and when there is a change, watch runs the 'default' Grunt task.
Gruntfile.js comes with one custom and one default task.
Runs 'clean', 'jshint', 'jscs', 'flow', 'copy', 'replace' respectively.
Runs 'clean:docs', 'markdown', 'jsdoc' respectively.
This section has all the parameters necessary to run the scaffolding correctly. You can change these parameters according to your project's specifics.
Description of the variables in projectparams:
Apache 2.0 License - © 2015 Baris Yuksel
For bug reports, feature requests and general questions, please feel free to email baris@onehundredyearsofcode.com.
FAQs
Yeoman generator for Bootstrap and Backbone starter project: the perfect way to build a Bootstrap BackboneJS project. It uses Bootstrap, Backbone, JSHint, JSCS, Flow and Watch.
The npm package generator-bootstrap-backbone-starter receives a total of 7 weekly downloads. As such, generator-bootstrap-backbone-starter popularity was classified as not popular.
We found that generator-bootstrap-backbone-starter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.