Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

generator-intuit-fullstack

Yeoman generator for creating IPP integrated MEAN stack applications, using MongoDB, Express, AngularJS, and Node

yeoman-generator, intuit, oauth, ipp, mean, mongodb, angularjs, express, scaffold, fullstack, framework, component, front-end, app

readme

Intuit Partner Platform Full Stack App Generator

Yeoman generator for creating MEAN stack IPP applications, using MongoDB, Express, AngularJS, and Node.

Also, uses Passport for QuickBooks API authorization.

Featuring:

  • Express server integrated with grunt tasks
  • Livereload of client and server files
  • Support for Jade and CoffeeScript
  • Easy deployment workflow.
  • Optional MongoDB integration
  • Optional Passport integration for adding user accounts

Example project

Generated by saying yes to all questions: http://fullstack-demo.herokuapp.com/.

Note: Demo is running on heroku free instance, so you will likely have to refresh for it to load.

Have a look at the source code: https://github.com/DaftMonk/fullstack-demo

Usage

Install generator-intuit-fullstack:

npm install -g generator-intuit-fullstack

Make a new directory, and cd into it:

mkdir my-new-project && cd $_

Run yo intuit-fullstack, optionally passing an app name:

yo intuit-fullstack [app-name]

Express

Launch your express server in development mode.

grunt serve

Launch your express server in production mode, uses the minified/optimized production folder.

grunt serve:dist

Livereload

grunt serve will watch client files in app/, and server files inside lib/, restarting the Express server when a change is detected.

Deployment

To generate a dist folder that can easily be deployed use:

grunt

This will run unit tests, jshint, concatenate and minify scripts/css, compress images, add css vendor prefixes, and finally copy all files to a tidy dist folder.

Alternatively to skip tests and jshint, use:

grunt build

Heroku Deployment

We provide an extremely simplifed deployment process for heroku.

yo angular-fullstack:deploy heroku generates a dist folder that is deployment ready for heroku.com.

Create and Deploy an app in 4 steps

  1. mkdir foo && cd foo

  2. yo angular-fullstack

  3. yo angular-fullstack:deploy heroku

  4. cd dist && git push heroku master

  5. Optional (if using mongoDB) heroku addons:add mongohq

That's it! Your app should be live and shareable. Type heroku open to view it.

Setting up Route authorization

If your app uses the Passport boilerplate for accounts, you'll of course want to restrict access to certain client routes/api routes.

For protecting server API routes, we can use the auth middleware, which will send a 401 unauthorized error if a user makes a request without being logged in.

For protecting client routes, we automatically handle 401s sent from the server by redirecting you to the login page.

However, as this will load part of the page before redirecting, it will cause a flicker. So this should only be used as a fallback mechanism. A better way to handle restricted pages is to mark the routes on the client side that you want to require authentication for.

You can easily do this from your app.js by adding the following to any client routes that need protecting.

 authenticate: true

This redirects the user to the login page before attempting to load the new route, avoiding the flicker.

Please keep in mind this client routing is only for improving the user interface. Anyone with chrome developer tools can easily get around it and view pages they're not supposed to see.

This is not a problem as long as you secure your server API routes, ensuring that you don't give any sensitive information unless the user is authenticated or authorized.

How do I only let users authorized access an api route?

Similarly to how the auth middleware checks if a user authenticated before going to the next route, you could easily make an ensureAuthorized middleware that checks the users role, or some other field, before sending them to the protected route, otherwise it sends a 403 error.

Generators

Available Angular generators:

Available Fullstack generators:

Note: Generators are to be run from the root directory of your app.

All of the generator-angular client side generators are available, but aliased using intuit-fullstack.

They are aliased to ensure the files they generate are added to the correct folders and that the index.(html/jade) is updated properly.

Read more on them from the offical generator angular documentation

Fullstack specific generators

Deploy

Initalizes a heroku app and generates a dist folder which is ready to push to heroku.

Example:

yo intuit-fullstack:deploy heroku

After app modifications run:

grunt build

then commit and push the dist folder.

Options

In general, these options can be applied to any generator, though they only affect generators that produce scripts.

Jade

For generators that output views, the --jade option will output Jade instead of HTML.

For example:

yo intuit-fullstack --jade

Changes the rendering engine from EJS to Jade, and generates your views as jade files instead of HTML.

Assets that will be minified or compressed such as scripts, styles, and images, must still use normal html tags so they can be picked up by grunt-usemin and compressed for production builds.

CoffeeScript

For generators that output scripts, the --coffee option will output CoffeeScript instead of JavaScript.

For example:

yo intuit-fullstack:controller user --coffee

Produces app/scripts/controller/user.coffee:

angular.module('myMod')
  .controller 'UserCtrl', ($scope) ->

A project can mix CoffeScript and JavaScript files.

To output JavaScript files, even if CoffeeScript files exist (the default is to output CoffeeScript files if the generator finds any in the project), use --coffee=false.

Minification Safe

Deprecated

Related Issue #452: This option is being removed in future versions of the generator.

By default, generators produce unannotated code. Without annotations, AngularJS's DI system will break when minified. ngMin is used to add these annotations before minification.

Add to Index

By default, new scripts are added to the index file. However, this may not always be suitable. Some use cases:

  • Manually added to the file
  • Auto-added by a 3rd party plugin
  • Using this generator as a subgenerator

To skip adding them to the index, pass in the skip-add argument:

yo intuit-fullstack:service serviceName --skip-add

Bower Components

The following packages are always installed by the app generator:

  • angular
  • angular-mocks
  • angular-scenario

The following additional modules are available as components on bower, and installable via bower install:

  • angular-cookies
  • angular-loader
  • angular-resource
  • angular-sanitize

All of these can be updated with bower update as new versions of AngularJS are released.

Testing

Running grunt test will run the unit tests with karma.

Contribute

See the contributing docs

When submitting an issue, please follow the guidelines. Especially important is to make sure Yeoman is up-to-date, and providing the command or commands that cause the issue.

When submitting a PR, make sure that the commit messages match the AngularJS conventions.

License

BSD license

changelog

v1.2.5 (2014-01-27)

Bug Fixes

  • app:
    • fixed coffee service so it's min-safe (c18c9da4)
    • fixed bootstrap css being imported rather than compass bootstrap (f2739987)
  • server:
    • replaced deprecated bodyparser (788fda04)
    • updated node version dependency (b19a0997)
  • gen: updated generator dependencies (115008d3)

v1.2.4 (2014-01-16)

Bug Fixes

  • grunt: fixed incorrect templating expression (2a59e070)

v1.2.3 (2014-01-16)

Bug Fixes

  • app: fixed jshint warning in user model (f668fdc7)

v1.2.2 (2014-01-16)

Bug Fixes

  • app:
    • replaced bcrypt with crypto for windows users (af20c3ab)
    • added karma dependencies directly to package template (13ea60e7)

v1.2.1 (2014-01-12)

v1.2.0 (2014-01-11)

Features

  • app:
    • restructured project for easier configuration (0a2bf2ab)
    • grunt build now moves all files into dist folder (e6eff5d5)
  • server: added jshint error checking before livereload occurs (7e001d31)
  • gen: added passport question for scaffolding out user account creation (87841064)

Bug Fixes

  • app: removed async dependency (d5636d71)
  • gitignore: fix app/views being ignored by git (7fa82ff9)
  • server:
    • config wasn't added to default project (79c5e027)
    • removed typo and cleaned up extra whitespace (1a132c28)
    • fixed style issues that were tripping up jshint

Breaking Changes

  • grunt heroku is deprecated. Use grunt build instead.

v1.1.1 (2013-12-25)

Bug Fixes

  • views:
    • Replaced deprecated jade tags.

Features

  • app:
    • Updgrade to AngularJS 1.2.6

v1.1.0 (2013-12-22)

Bug Fixes

  • app:
    • only copy CSS if Compass is not installed (7e586745)
    • services use classified names (56a71a83, closes #484)
    • reload JS files in watch (d20f5bd2)
  • build: deselecting ngRoute does remove route stuff (a358c1ae, closes #486)
  • gen:
    • updated all conflicts, and fixed some bugs, from merging with upstream (d07c829d)
    • fix bower install prompt during project gen (706f1336, closes #505)
  • package: fix imagemin for windows users (b3cec228)
  • views:
    • fix ng includes (598c69a5)
    • add compiled views to gitignore (087ede5f)
    • fix incorrect build path for vendor css (0ed2a200)

Features

  • app:
    • add jasmine browser global to test jshintrc (11b6ed42)
    • use lowercase file names (23e5d772, closes #463)
    • use htmlmin for smaller HTML files (2b85a52a, closes #469)
    • use grunt-bower-install for dep management (ba7b5051, closes #497)
    • Enable Node debug mode (83ae4a9e)
  • gen:
    • Added navbar to starting template (b5e94749)
    • additional work for compass support (11cb9943)
    • add Compass support to the initialization process (7fac1194)
    • add welcome message and dep notice for minsafe (f0bb8da2, closes #452)
  • server:
    • Added middleware for development mode that disables caching of script files (c082c81c)
    • Moved express configuration code out of server.js and into config folder to make it a more high level bootstrap.

Breaking Changes

  • Deselecting ngRoute adds controller and ng-include to index.html (a358c1ae)
  • --minsafe flag is now deprecated.
  • grunt server is now deprecated. Use grunt serve instead

v1.0.1 (2013-11-27)

Bug Fixes

  • coffee: updated coffescript templates to point to partials (f98e84ef)

v1.0.0 (2013-11-26)

Bug Fixes

  • build:
    • use test-specifc jshintrc (c00c091b)
    • add webapp upstream features and better coffee (c23acebb)
    • use grunt-newer for styles and jshint (b1eeb68a)
    • standardize comments and comment out uglify:dist (d5d3e458, closes #455)
  • deps: upgrade dependencies (3a57216f)
  • gen:
    • Fixed jshint errors that were breaking grunt task (c6ae81c8)

Features

  • app:
    • Separate client and server watchers (0ff8ffb1)
    • imagemin handles gifs (9341eb9b)
  • gen:
    • added support for jade templates (24a13bfe)
    • Support for server rendering and Angular's HTML5 mode (5ccdeb7a, closes #18, #17)
    • add image file as example (b161c298)
  • build:
    • compile only changed coffeescript files in watch task (4196e379, closes #425)
    • deprecate server in favor of serve (ef056319)

Breaking Changes

  • angular-fullstack:route
  • angular-fullstack:view

Will now generate views and routes in the views/partials folder.

For existing projects:

For generating routes and views, install generator-angular and use it's sub-generators.

They are exactly the same as the generators that you have been using. Example usage: yo angular:route helloworld.

For New projects:

Continue to use angular-fullstack route and view sub-generators.

The reason for this change in folder structure was to support server page rendering.

Closes #18, #17 (5ccdeb7a)

  • grunt server is being deprecated (ef056319)

v0.2.0 (2013-11-13)

Bug Fixes

  • bootstrap: some plugins have ordering dependencies (3da4a130)
  • build: only include sass if sass is selected (597b8b5c, closes #449)
  • css: remove merge conflicts (d558af35)
  • gen:
    • script paths use forward slashes (40aa61dc, closes #410)
    • remove extra "App" from service spec files (4053f11f)
    • options should have descriptions (da001832)
  • styles: update path to icon images (8daad4f2)
  • template: remove redundant closing tag (d1e560e0, closes #441)

Features

  • app:
    • run unit tests when test scripts are changed (94af0b51)
    • update to angular 1.2.0 (77082c6b)
    • reload grunt server when gruntfile is updated (50c6abb9)
    • upgrade to Bootstrap 3.0.1 (59f4b1ba)
  • gen:
    • allow app names to have custom suffix (09f0f7b3)

v0.1.0 (2013-11-12)

Features

  • gen: include MongoDB as an option When selected, sets up database with Mongoose. Repl (280cc84d, closes #2)