Ultra fast fullstack angular generator, using gulp.
« Perfection is achieved not when there is nothing more to add, but when there is nothing left to take away. » — Antoine De Saint-Exupéry
service, and plenty others...
npm install -g generator-bangular yo bangular
Default task, run the server. Build
sassfiles, inject all scripts and styles to the project, watch them and open your default browser.
Wipe old generated
distdirectory while keeping the
.gitto preserve your remotes configuration. Concat all the scripts and vendors in one minified
.jsfile, same thing for your styles. Rev all resources for caching purposes; copy the server part.
gulp buildprocess and serve the
gulp test [--client || --server]
Launch client and server tests, using Karma and Mocha, both by default.
gulp bump [--major || --minor || --patch]
Bump versions of
bower.jsonfiles using Semantic Versioning and commit them. Default to patch.
Launch your server and then run protractor tests. See protractor howtos.
This is the main generator of Bangular, that will scaffold entierely your project based on your needs.
yo bangular || yo bangular
Backend type: MongoDB / Restock / Json
Modules : angular-cookies || angular-resource || angular-sanitize || angular-animate
Socket.IO : Do you want to integrate sockets in your app?
The name parameter is required. Directives will be generated at
client/directives/. You can specify if your directive needs an html template or not.
The name parameter is required. Filters will be generated at
The name parameter is required. Fonts will generate a new folder in
.scssfile importing all of these fonts in your app. It will be imported in your
app.scssfile either on top of the file or after the
// importsmark if specified.
Url: Client url to access the route.
The name parameter is required. This will create in
name ├ name.js ├ name.controller.js ├ name.spec.js ├ name.e2e.js └ name.html
yo bangular:service yo bangular:factory
The name parameter is required. The service / factory and its spec file will be generated at
Inject: If true, an
@importwill be added to the main app.scss file to add the style to your app. You can specify the location of your new imports by adding a
// importsin the file.
The name parameter is required. This will create a new
.scssfile in he
Creates an angular animation file in
client/animations/. You can choose which event(s) you want to capture, including
You need to have
Url: Route that will be exposed on your server to access this ressource.
Socket: If you want to emit socket event on model changes (only with mongo & sockets).
Resource: If you want to scaffold a basic
$resourcefor this route (only with ngResource).
The name parameter is required. A name folder will be created at
First, you will have to run the
gulp e2e:updatecommand to update the chromedriver and the selenium jar. Since the path to the jar is hardcoded in the
protractor.conf.jsfile and the version is susceptible to change, you will potentially have to update the version number. For people which have multiple Chrome installed, you can specify the path to the binary in the configuration. You can now run
gulp e2e, remember to stop your server since it will automatically create a new one.
To use the sockets, you have to confirm the option on project generation. Yet, it's only when you've selected the mongo backend that you can be prompted by this config.
This will initialize all the server part and create a
Socketfactory in the client. On each new
apiyou create, you can choose to load the sockets for this model. It will then emit socket events on update and remove of documents of this model.
The sockets can be quickly usable in your controllers, here is an example with a simple item.
On project generation, you can integrate passport authentification in your app. It will create default views for the signup and login. You can easily protect your routes for a connected user by adding the
isAuthenticatedmiddleware on it.
client ├ animations/ ├ assets │ ├ images/ │ └ fonts/ ├ bower_components/ ├ directives/ ├ filters/ ├ services/ ├ styles/ ├ views/ ├ app.js ├ index.html └ .jshintrc server ├ api/ ├ config/ ├ routes.js ├ server.js └ .jshintrc tasks ├ config/ └ *.js bower.json gulpfile.js karma.conf.js package.json protractor.conf.js .editorconfig .gitignore .jscsrc .jshintrc .travis.yml .yo-rc.json