Yeoman Generator for MEAN-seed - MongoDB, Express.js, AngularJS, Node.js + Yeoman (Grunt, Bower, Yo) + Jasmine, Karma, Protractor (for automated testing)
- MEAN-seed Website/App after Yeoman build
- Continuous Integration / Tests
- This automatically deploys and tests the yeoman generated mean-seed website on each Github push (from local development)
- Test Coverage Reports (currently ~90% frontend coverage, ~60% backend coverage)
- Backend API Interactive Docs
- i.e. Auth API
- Github Repo with Generated Code
Install Yeoman Yo, Bower, Grunt and other global node modules we'll need, if you don't have them already:
$ npm install -g yo bower grunt-cli jasmine-node karma yuidocjs forever less
Install this generator:
$ npm install -g generator-mean-seed
Naviagate to a (new) directory where you want to create your AngularJS and node.js app and initiate the generator then follow the prompts:
$ yo mean-seed
NOTE: you can also (first) create a
yo-configsfolder with .json files for the prompts so you don't have to type them all out. This is useful for storing multiple different configurations for different projects - just tell the generator which config to use and you're all set! See the yo_configs folder for examples.
NOTE: if you get errors (i.e. npm or bower install failures or timeouts, which aren't uncommon), just re-run the command
yo mean-seedOR re-run just the problematic parts, i.e.
bower update && bower installand/or
npm install. Once everything has installed properly, just make sure to run grunt:
NOTE: if you get an EACCESS / permission denied error during the npm install, find the folder that had permissions issues (from the log output) and run
sudo chown -R $USER [path to problematic folder].
See here for more/full info and steps.
- See the generated README.md file in your new mean-seed app!
You CAN and SHOULD keep your project up to date with the core (seed) generator you used as it goes through version upgrades. Just re-run:
Ensure the generator is up to date:
npm install -g generator-mean-seed
Pull in updates to your project (core/seed - make sure to select the same core you used originally). Just type 'a' (for overwrite all) if you get prompted about file conflicts - we'll handle those with Git merge later so it's safe to overwrite everything in the generator branch.
Then if you push, make SURE to ALSO push the/any
yo branches (i.e.
git push origin yo-core-default) so other developers get that branch and stay up to date.
See updating.md for more info.
See the docs/generators folder for more info.
More generators coming - feel free to create one and submit a pull request!
See the generated README.md file and the
docs folder for all documentation. Each (sub)folder typically has an
overview.md file - start there. Some key docs (roughly in order of priority) listed below:
- setup-running folder
- tools-dependencies folder
- files folder
- testing-automation folder
- while you can fork on Github, we're actually trying a new approach of leveraging Yeoman for different 'core' builds to avoid all the forks. The reason for 'forking' a project is to change it and add functionality that conflicts with or would add too much code bloat to the original repository. However, with Yeoman, we can add EVERYTHING into this ONE project and by using generators, the end user/developer can take ONLY what (s)he wants. So there's no code bloat or worry of this becoming a "kitchen sink" seed with too many features. That's the beauty of Yeoman! So, to contribute, build another subgenerator - either a 'core' generator or a 'module' generator. All the 'core' generators essentially become like the typical 'forks' - a user will decide what core (s)he wants to use and THEN what modules to include with that core.
- core: see the
core-defaultfolder/generator for an example
- module: see the
ng-routefolder/generator for an example
- core: see the
- NOTE: You will still have to fork the project to develop / contribute; but the point is that we should be able to pull-request all forks into the main fork (assuming code quality of course) so shouldn't need any forks that aren't just being used for development. With ONE source of truth and ONE 'production' fork, we should be able to keep everything in sync and up to date rather than changes in one fork not being supported in all other forks.
- NOTE: this is still a new idea/approach to contributing and is a work in progress - suggestions welcome! Or if you just think this is a stupid idea feel free to let us know that too - though constructive criticism is always appreciated ;)