Warning!: There are major changes to v1.0.0+, before using it please backup or commit your application changes
$ npm install -g grunt-cli yo generator-mvp
- Make a new directory, and
$ mkdir mvp && cd $_
yo mvpto generate application skeleton
$ yo mvp
grunt devto launch your application and watch for codes changes
generator-mvp provide a set of
grunt tasks for use during development and testing.
To run in development mode use
$ grunt dev
To run in test mode use
$ grunt test
To run in production mode use
$ grunt prod
To run all tests or specifications use
$ grunt spec
For targeted spec or test runner see project
And more to come based on what we daily need in our
mongoose development workflows.
Sets up a new
mongoose app, generating all the boilerplate you need to get started.
Example of generating an application:
$ yo mvp
Set up new mongoose
router and their
spec/test boilerplates. To generate a new api invoke
yo mvp:api followed with model definition
Example of generating simple api
$ yo mvp:api user name:String dob:Date
Example of generating api with multi name
$ yo mvp:api item_category name:String dob:Date
Set up new mongoose
Schema with its
spec/test boilerplate and register it to mongoose. To generate new model invoke
yo mvp:model with model name and its attributes separated by space.
Note!: Only mongoose schema types are supported as attributes
Example of generating simple model
$ yo mvp:model user name:String dob:Date
Example of generating model with multi name
$ yo mvp:model item_category name:String dob:Date
Example of generating model including
refs to other model
$ yo mvp:model post content:String author:ObjectId:User
Set up new
actions and an
express router. To generate a new controller invoke
yo mvp:controller giving its name and actions separated by space.
Example of generating controller including frontend
$ yo mvp:controller index create edit
Set up new express
middleware with it
test/spec boilerplate. To generate a new express middleware invoke
yo mvp:middleware and giving its name.
Example of generating middleware
$ yo mvp:middleware guard
Set up new
nodejs module with it
test/spec boilerplate. To generate a new nodejs module invoke
yo mvp:lib and giving its name.
Example of generating library
$ yo mvp:lib scanner
angular frontend for the provided model definition.
It will generate the following:
angular controllersrequired to manage model
ui-routerstates configuration to manage model
crud viewsto manage model
yo mvp:angular sub-generator make sure:
- You have generate your front-end application using generator-angular
$ yo angular
- Install all required dependencies to your application:
$ bower install --save angular-ui-router angular-resource angular-bootstrap
- Add all required dependencies to your application
apiEndpointangular constant into your application main module that will point to the
root urlof your api.
Then, you can continue using it as bellow:
$ yo mvp:angular User name:String dob:Date
Fork this repo and push in your ideas. Do not forget to add a bit of test(s) of what value you adding.
Clone this repository
$ npm install
- Then run test
$ npm test
The MIT License (MIT)
Copyright (c) 2015 lykmapipo & Contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.