3rd GreeceJS
Meetup

NODE.JS

a pragmatic approach
Kostas Karolemeas
http://gr.linkedin.com/in/kostaskarolemeas
3rd GreeceJS Meetup

Kostas Karolemeas
3rd GreeceJS Meetup

WHAT IS NODE.JS?
Evented I/O for v8 javascript
Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses
an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time
applications that run across distributed devices.

Kostas Karolemeas
3rd GreeceJS Meetup

WHY NODE.JS?
•

Performance and Scalability
•

•

BUT: you need to respect the asynchronous model otherwise node cannot fix late
responses…

End-to-end javascript / reusable code / no need to switch contexts
•

BUT: a good web developer is not by default a good server-side developer

•

AND: you will not be able to write in the same way both sides (e.g. different
frameworks)

•

Strong, responsive and enthusiastic community

•

Many hosting options (IaaS to PaaS)

•

Mature development tools

Kostas Karolemeas
3rd GreeceJS Meetup

NODE.JS SERVICES
URI routing
URI routing
(e.g. REST API)
(e.g. REST API)

Jade
Jade
Ham
Ham
ll

Views (templates)
Views (templates)

Express
Express
(web dev.
(web dev.
framework)
framework)

Sessions
Sessions

EJS
EJS

Error Handling
Error Handling
Configuration
Configuration

Logging
Logging
Cookies
Cookies

Connect
Connect
(middleware)
(middleware)

Auth
Auth
Session
Session
Stores
Stores

Kostas Karolemeas
3rd GreeceJS Meetup

NODE.JS APP STACK
Express // Connect
Express Connect
Async.js
Async.js

(asynchronous call
(asynchronous call
management)
management)

Mongoose
Mongoose

(async object modeling
(async object modeling
for MongoDB)
for MongoDB)

Winston
Winston

(multi-transport async logging)
(multi-transport async logging)

node-mongodb-native
node-mongodb-native

Kostas Karolemeas
3rd GreeceJS Meetup

DEPLOYING NODE.JS
FREE
Blitz
Blitz

Release
Release
Management
Management

Dynos
Dynos

Logging
Logging

Redis To Go
Redis To Go

Kostas Karolemeas
3rd GreeceJS Meetup

NODE.JS TOOLS
•

npm - package/dependency manager

•

Mocha - test framework
•
•

Alternative Reporters for results

•

•

Alternative DSL (interfaces) for describing tests

Runs either from a shell or in a browser

WebStorm - Javascript IDE
•

Integrated Node.js launcher / debugger

•

Excellent javascript editor

•

Very good integration with task management and version control tools
Kostas Karolemeas
3rd GreeceJS Meetup

WHAT’S NEXT?
•

Give it a spin!
•

Install Node.JS and NPM

•

Install WebStorm

•

Install Git

•

Create an account in Heroku and install tools

•

Follow Heroku instructions to create a Node.js application
•

•

Use heroku-buildpack-nodejs to install latest Node.js

Install Heroku add-ons: MongoLab, Redis To Go, Logging, Release
Management
Kostas Karolemeas
3rd GreeceJS Meetup

THANK YOU!

Kostas Karolemeas

Node.js - Greece JS Meetup 2012

  • 1.
    3rd GreeceJS Meetup NODE.JS a pragmaticapproach Kostas Karolemeas http://gr.linkedin.com/in/kostaskarolemeas
  • 2.
  • 3.
    3rd GreeceJS Meetup WHATIS NODE.JS? Evented I/O for v8 javascript Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices. Kostas Karolemeas
  • 4.
    3rd GreeceJS Meetup WHYNODE.JS? • Performance and Scalability • • BUT: you need to respect the asynchronous model otherwise node cannot fix late responses… End-to-end javascript / reusable code / no need to switch contexts • BUT: a good web developer is not by default a good server-side developer • AND: you will not be able to write in the same way both sides (e.g. different frameworks) • Strong, responsive and enthusiastic community • Many hosting options (IaaS to PaaS) • Mature development tools Kostas Karolemeas
  • 5.
    3rd GreeceJS Meetup NODE.JSSERVICES URI routing URI routing (e.g. REST API) (e.g. REST API) Jade Jade Ham Ham ll Views (templates) Views (templates) Express Express (web dev. (web dev. framework) framework) Sessions Sessions EJS EJS Error Handling Error Handling Configuration Configuration Logging Logging Cookies Cookies Connect Connect (middleware) (middleware) Auth Auth Session Session Stores Stores Kostas Karolemeas
  • 6.
    3rd GreeceJS Meetup NODE.JSAPP STACK Express // Connect Express Connect Async.js Async.js (asynchronous call (asynchronous call management) management) Mongoose Mongoose (async object modeling (async object modeling for MongoDB) for MongoDB) Winston Winston (multi-transport async logging) (multi-transport async logging) node-mongodb-native node-mongodb-native Kostas Karolemeas
  • 7.
    3rd GreeceJS Meetup DEPLOYINGNODE.JS FREE Blitz Blitz Release Release Management Management Dynos Dynos Logging Logging Redis To Go Redis To Go Kostas Karolemeas
  • 8.
    3rd GreeceJS Meetup NODE.JSTOOLS • npm - package/dependency manager • Mocha - test framework • • Alternative Reporters for results • • Alternative DSL (interfaces) for describing tests Runs either from a shell or in a browser WebStorm - Javascript IDE • Integrated Node.js launcher / debugger • Excellent javascript editor • Very good integration with task management and version control tools Kostas Karolemeas
  • 9.
    3rd GreeceJS Meetup WHAT’SNEXT? • Give it a spin! • Install Node.JS and NPM • Install WebStorm • Install Git • Create an account in Heroku and install tools • Follow Heroku instructions to create a Node.js application • • Use heroku-buildpack-nodejs to install latest Node.js Install Heroku add-ons: MongoLab, Redis To Go, Logging, Release Management Kostas Karolemeas
  • 10.
    3rd GreeceJS Meetup THANKYOU! Kostas Karolemeas