hunt

High level nodejs framework build on top of expressjs, mongoose, sequilize, socketio and passportjs

npm install hunt
14 downloads in the last day
24 downloads in the last week
47 downloads in the last month

HuntJS

NPM version Build Status Build Status

"Hello, world!" Example

This is short, basic, "hello, world!" example, to start http server on 3000 port.


    var hunt = require('./../index.js'),
      Hunt = hunt({
        'port':3000
      });

    Hunt.extendRoutes(function(core){
      core.app.get('/', function(req,res){
        res.send('Hello, world!');
      });
    });

    Hunt.startWebServer();

Documentation and live example

https://huntjs.herokuapp.com/

More examples

https://github.com/vodolaz095/hunt/tree/master/examples/

Shameless advertisement

You can hire the author of this package by Odesk - https://www.odesk.com/users/~0120ba573d09c66c51

What do you get from the box?

Just run npm install hunt and you get ready to use high level nodejs framework, that links together many preconfigured and working perfectly together modules. This is it. Hunt...

  • works on latest versions of NodeJS >=0.10.26

  • is a real event driven (by pattern Observer) framework build on top of ExpressJS, suitable not only for creating HTTP-based web applications, but background services, binary protocol applications, websockets or even xmpp based applications.

  • Mongo database and Mongoose ORM support from the box

  • sequelizejs ORM for MySQL, PostgreSQL, sqlite and MariaDB from the box.

  • The best sides of express.js framework are supported: routing, middlewares, controllers. And this is done in clever way - expressjs application can be easily converted to Hunt application.

  • Popular templating engines are supported - Mustache, Swig, jade.

  • Powerful users model to use at your application, with customizable profile, groups, and compatibility with majority of passport.js strategies, custom profile data and build up with Active Record and Observer patterns

  • Redis database support from the box, with default use of it as session storage.

  • Hunt applications are easy to run on Heroku hosting - many config values (mongo/redis database access URLs, etc...) are populated automatically

  • Clustering by the means of nodejs build in load balancer

  • Websocket, Htmlfile, xhr-polling, jsonp-polling for real time push messages are supported by the means of socket.io and works from the box, even with websockets working on nginx and heroku

  • socket.io is perfectly linked with user model and passportjs authorization system, so you can send realtime notifications to users online just like this


    Hunt.model.User.findOne({'email':'somebody@example.org'},
      function(err, userFound){
        //notify on user
        userFound.notifyBySocketIo({
          'priority':'high',
          'message':'You are being hunted!'
        });
        //notify all online users by means of socket.io broadcast
        Hunt.emit('broadcast', {
          'priority':'high',
          'message':'Everybody hunts Somebody at example dot org!'
        })
      });
  • Possibility to run HuntJs as Telnet - server with TLS support, authentication and expendable commands' list, created with help of RAI server

System requirements

  • Linux (this is your problem, if you want to build this package on other operating systems)
  • NodeJS >= 0.10.26 (version build from source is preferable, because hunt builds some dependencies from source)
  • Redis >= 2.6.16
  • Mongo >= 2.4.6 (optional)
  • MySQL >= 5.6.16 (optional)
  • PostgreSQL >= 9.2 (optional)

Important!

Without understanding how express.js framework operates, including

this module is hard to understand. Please, read this information above before processing with this framework.

Deploying the HuntJS application for production

We will post some advices on server configuration here: https://github.com/vodolaz095/hunt/tree/master/examples/serverConfigsExamples

License

The MIT License (MIT)

Copyright (c) 2013 Ostroumov Anatolij et al.

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.

npm loves you