Which libraries to choose. Reading up and node and especially the stream-handbook has biased my choices quite heavily.
- https://github.com/substack/bouncy - Initially liked bouncy, but have heard reports of it being sloww. There are other equitable options:
- https://github.com/creationix/node-router
Hit:
This creates a RESTful API inside your network you can use to keep track of active sessions.
Just create one cookie to reference the soid
.
Oauth/openid etc.
- Use passport http://passportjs.org/
- https://github.com/bnoguchi/everyauth
- https://gist.github.com/jaredhanson/2559730 - passport with restify
Everyauth and passport are both reasonable.
It's best to use express
if you are going to manipulate cookies. If you use restify
, you'll have a hard time manipulating cookies with cookie
to manage cookie jars. It's ok to have multiple daemons running on multiple ports.
-
https://github.com/kyriesent/mongoose-social-user/blob/master/src/mongoose-social-user.coffee
-
https://github.com/kyriesent/mongoose-social-user/blob/master/src/mongoose-social-user.coffee
-
https://github.com/pcimino/nodejs-restify-mongodb - restify some user schemas!
-
Use https://github.com/gett/mongojs to develop schemas instead of mongoose.
-
http://substack.net/bounce_http_requests_with_bouncy Eg, run services locally. You can also issue
nginx
'sX-ACCEL-REDIRECT
header or lighttpd'sx-rewrite
header -
http://stackoverflow.com/questions/14221345/abstracting-mongoose-w-restify Run a server abstracting basic CRUD access. Augment with plugins for various things as needed.
Use proper HTML, avoid string concat and regexp in browser to create views. Use js to add behavior to re-usable patterns of HTML.
- jekyll example: ** https://github.com/bewest/literatewebfont ** http://medevice-users.github.io/diabetes/
- I still like middleman, but it doesn't work great with github pages. http://middlemanapp.com/
Docpad is node js version of same thing, with all the right features. After trying about a dozen frameworks, I now recommend docpad.
Plays nice with both gh-pages, static-hosting, dynamic hosting, s3, rsync, and with prose.io. Also very easy to share notes/documents etc in private repo dedicated for that purpose.
Avoid templating, try to transform smart style guides. Easily testable, modular components, which can be composed to create UI. Here's my personal take, using underscore and backbone (see other examples for jquery only): https://github.com/bewest/field_descriptor.js (the trick is to use DOM.clone(true) to clone "semantic POSH", ends up working similar to bootstrap, which requires valid HTML as input.
Here are other takes on the same thing (similar approach mapping selectors to behavior, basically):
- https://github.com/substack/hyperglue
- https://github.com/substack/hyperstream
- https://github.com/substack/hyperspace
- https://github.com/substack/node-trumpet
Note unlike some data-bindings, these do not inject new control structures into DOM. Control is left to the procedural script (js). This allows for sane code base.
I would like to separete schemas from data store. I really like https://github.com/akidee/schema.js for schemas and my favorite mongo lib is one i wrote with a friend a while, its somewhat popular https://github.com/gett/mongojs