Skip to content

Commit

Permalink
updated doc
Browse files Browse the repository at this point in the history
  • Loading branch information
tarex committed May 22, 2015
1 parent 5102850 commit 06bae31
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 3 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ notifications:
branches:
only:
- master
- dev

112 changes: 109 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,113 @@ WolverineJS

Simple MVC framework based on Node JS

installation
installation
===========

npm install wolverinejs --save

npm install wolverinejs --save


It uses ExpressJS and Nunjucks templating engine . You need to follow this folder structure to make it work .




.
├── README.md
├── app
│   ├── controllers (folder)
│   │   ├── Auth
│   │   │   └── AuthController.js
│   │   ├── userController.js 
│   ├── models (folder)
│   │   ├── article.js
│   │   ├── product
│   │   │   └── products.js
│   │   ├── book.js
│   │   └── user.js
│   └── views (folder)
│   ├── base.html
│   ├── home.html
├── app.js
├── config (folder)
| ├── routes.js
├── package.json
└── public (folder)
| ├── css
| ├── img
| └── js










into the `app.js` file you need to include this , it will handle rest of the thing automatically .

var wolverine = require('wolverinejs');


It will boostrap your application and all models , controller , routes will be included .


##Routes

you can set your routes into `app/config/routes.js` , the format will be like this


module.exports = function(router , controller){

// controller.great.index means , it will be into the app/controllers
// folder and the name of the controller is AuthController and
// index method will be executed

router.get('/', controller.AuthController.index );

router.get('/test',function(rep , res , next){
res.send('hello world');
});

return router;
}


##Views

By default it uses `Nunjucks` [ http://nunjucks.jlongster.com/ ] . Your view files will be loaded from `app/views` folder . Its possible to extend template , it has many option , you can read form here http://mozilla.github.io/nunjucks/templating.html



#Controllers

Controller will be into `app/controllers` directory and it follows

exports.index = function(req , res){
// index.html is nunjucks templating file and it
// will be loaded from app/views/ folder

res.render('index.html',{title:'Please Sign up'});
}


#Models
models will be into `app/models` folder





#Todo

- ORM support for major database engines .
- Configuration override
- App environment settings
- Error & Event Handling
- SockJS
- Test

# Note :
Its a very simple framework that follows MVC patterns , very light weighted , still in heavy development

0 comments on commit 06bae31

Please sign in to comment.