From 06bae31d4d9b8cc1da045ed3bca51e350d760048 Mon Sep 17 00:00:00 2001 From: tarex Date: Fri, 22 May 2015 13:40:41 +0600 Subject: [PATCH] updated doc --- .travis.yml | 1 + README.md | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 110 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9fb9e07..c519ae3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,4 +19,5 @@ notifications: branches: only: - master + - dev diff --git a/README.md b/README.md index 4cae725..405b386 100644 --- a/README.md +++ b/README.md @@ -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