SlideShare a Scribd company logo
It’s time to get
After the
About Jeff Fox (@jfox015)
Assoc.Dir.,DigitalExperienceTechLead
StarwoodHotelsandResorts
• Nineteen year web development veteran
• (Almost) entirely self-taught in programming, web
and related technologies
• Front end specialist with full stack skills/experience,
main core capability used to be Flash 
• Background in Graphic Design and art, music
production & engineering and “entertainment
services”
• Experience working for fortune 100 companies
down to creative agencies with as few as 10 people
Agenda
•Quickie LAMP Review
•Four Components of the MEAN stack
(and a fifth bonus item too)
•Wrap-up (with use cases)
•Questions
•Shatner
We all know
LAMP is a combination of four of the most popular open
source technologies that form one of the most popular
and ubiquitous platform stacks used on the web. It’s
estimated that 82% of web sites run on some version of
PHP [1]
[1] Source: http://www.w3techs.com/technologies/details/pl-php/all/all
LAMP is popular
Some popular sites using PHP:
LAMP is popular
Wordpress hosted blogs
and sites alone account
for some 4.5% of all web
sites [1]
[1] http://www.codeinwp.com/blog/mesmerizing-wordpress-stats/
[2] http://expandedramblings.com/index.php/wordpress-statistics/
[3] https://www.hostt.com/wordpress-stats-for-2015/
[4] https://managewp.com/14-surprising-statistics-about-wordpress-usage
• 74.6 Million Sites Depend on WordPress [2]
• 22% of New U.S. Registered Domains Run on
WordPress [3]
• WordPress.com Gets More Unique US Visitors
(126M) per month Than Amazon (96M) [4]
What is M.E.A.N?
Mean is a combination of four technologies that also
form a single platform stack. The common element
between them is JavaScript.
NODE JS
About…
About NodeJS
“Node's goal is to provide an easy
way to build scalable network
programs.”
-- nodejs.org
Components of NodeJs
• NodeJs runs on the V-8 Engine.
• The V-8 Engine is an open source JavaScript engine created
and developer by Google which also powers the Chrome
browser.
• V8 compiles JavaScript to native machine code (IA-32, x86-64,
ARM, or MIPS ISAs) before executing it, instead of more
traditional techniques such as executing byte code or
interpreting it.
• Node uses CommonJS specifications for common modular
package management format
• Uses NPM (Node Package Manager) to manage dependencies
How does Node work?
• Node.js uses an event-driven, non-blocking I/O model, which
makes it lightweight
• It makes use of event-loops via JavaScript’s callback
functionality to implement a non- blocking I/O
• While time consuming file and disk operations block script
execution in PHP, Node JS commands execute in parallel, and
use callbacks to signal completion or failure)
Event Driven Example
Node in the Wild
How is Node being used?
API Servers
Mobile backends and full-stack
JavaScript hybrid apps
Internet of things (IoT)
Web – HTTP servers
and single page apps
Node Pros and Cons
Pros
Fast – Execution speed
Faster to market –
development speed
Less lines of code
Great community
Proven with high volume
systems
Most suited for
networking, I/O
intensive applications
Cons
Writing a large business
logic centric system is
cumbersome
Callback hell
Exception handling is
not straight forward
Writing event driven
code is complex
compared to
synchronous code
Source: NodeJS - Server Side JS
Node vs Java
• 20+ years development
testing making a rock solid
foundation
• Not as fast and Node, but
absolutely a more
trustworthy environment
• Well know coding and
debugging support in all
major IDEs
• True multi-threaded server
support
• No, XML used for Ant and
Maven builds for example
MATURITY
SPEED
TOOLS
THREADING
UNIFIED
LANGUAGE
• Younger player (launched in
2009) with less real world
battle testing
• Blazing fast execution, but
sacrifices overall server
safety for it
• Modern IDE tools support via
add-ons for code-completion
and some debugging
• Node simulated multi-
threading via an event loop
• Node uses JavaScript in all
aspects of the development
Source: Java vs. Node.js: An epic battle for developer mind share
EXPRESS
About…
About Express
• Popular NodeJS Server framework library
• Inspired by the Sinatra framework for Ruby
• Minimal and flexible application design
• Handles many operations through HTTP helper
utilities and the use of middleware
• Easy to set up a working Express server in just
few lines of code
• Supports single page, multi-page and hybrid web
applications
A basic Express app
Express Middleware
Middleware is any number of functions that are invoked by the
Express.js routing layer before the final request handler is called
• Express Middleware is simply a function with three arguments
• req – The HTTP Request
• res – HTTP Response
• next – Another Middleware to forward to after the function
completes
• Middleware is always invoked in the order added.
• You can have multiple middleware for the same path.
• Middleware has full access to the request and response objects.
• Be mindful of middleware overriding fields of other middleware.
• Middleware can be skipped by using the next function.
Express Middleware
Components of Express
• Runs using NodeJs
• App is the web application runtime
• Middleware modules handle many routine operations:
• Connect is a set of middleware that includes many helper
modules
• logger
• csrf Cross-site request forgery
protection
• compress Gzip compression
basicAuth http authentication
• bodyParser extensible request
body parser
• json application/json parser
• multipart multipart/form-data
parser
• timeout request timeouts
• cookieParser cookie parser
• session session management support
with bundled MemoryStore
• cookieSession cookie-based session
support
• methodOverride faux HTTP method
support
• favicon efficient favicon server (with
default icon)
• query automatic querystring parser,
populating req.query
• errorHandler flexible error handler
Express Routing
• Handles HTTP and RESTful calls over HTTP
• Can direct to Middleware, MVC controllers, use templates or
return files
JADE TEMPLATES
About…
Soon to be re-
released as PUG
About Jade
• High performance template engine heavily influenced by
Haml and implemented with JavaScript for Node
• No need to worry about closing tags
• Significant white space enforces clear coding convention
between team members
• Layout Inheritance
• Allows for full JavaScript expressions but makes it just
awkward enough to discourage full blown logic in the
views
• Support for inline Markdown and CoffeeScript
Source: Comparing JavaScript Templating Engines: Jade, Mustache, Dust and More
Jade Example
Jade vs other Node templates
Jade Mustache Dust NunJucks EJS
No Closing
Tags
Async
Layout
Inheritance
Streaming
Custom tags
High Learning
Curve
White Space
Significance
Easy Includes/
Partials
Source: Comparing JavaScript Templating Engines: Jade, Mustache, Dust and More
MONGODB
About…
Not that Mongo
About MongoDB
• An open source, cross platform database
• Stores data in JSON like documents with dynamic
schemas (called BSON)
• Fourth most popular database system worldwide
as of Jan 2016 [1]
• A “no sql” database
without relational
connections, search
an API
[1] http://db-engines.com/en/ranking
Data Design Comparison
Traditional Data Design
• Static, uniform, scalar
data
• Data “looks” like
rectangles
• Low level physical
representation
Document Data Design
• Flexible and capable of
rich shapes
• Based on objects
• High level business
representation
Advantages of No-SQL Design
• Agility
• Start developing without an extremely long ER (entry-
relationship) model design
• Flexible for schema changes as you go without penalty
• Polymorphic schema models variable structure with ease
• Scalability
• Shared-nothing architecture vs centrally controlled system
(eliminates any single point of failure, allows self-healing
capabilities and non-disruptive upgrades)
• Scales horizontally, linearly
• Sharding and load balancing
• Auto-balance ensures a balances cluster
Source: MongoDB and the Internet of Things
Mongo and Relational DB
Major Use Cases…
…and Major Users
• Big Data (Github)
• Internet of Things (Bosch)
• Complex Data Management (Cushman & Wakefield)
• Mobile Apps (Twitter, Foursquare)
• Customer Data Management (Intuit)
• Social Networking and Collaboration (Cisco, Eventbright)
• Content Management (New York Times, Adobe AEM,
eBay)
• Embedded (Sitecore)
Oracle vs MongoDB
• Oranges
• Created in 2009
• Document SQL-Less Model
• Supports Replication,
Horizontal scale and
Sharding
• Queries using JavaScript
• MIT License
• Free for commercial use
• JSON (with BSON)
• Supported by multiple
cloud platforms
• Apples
• Created in 1936
• Relational Model
• Supports Replication and
Horizontal scale
• Queries using SQL
• Proprietary License
• Large Price tag
• Multiple data Types
• Cloud Ready on Oracle
Cloud Platform
ANGULARJS
About…
About AngularJS
• “Super heroic” framework created and
developed by Google
• Highly suited to single page front end web
applications
• Version 1.x attempted to solve many web
application shortcomings in HTML 5 and
JavaScript
• Version 2.x tightly incorporates the latest
improvements in JavaScript and modular front
end design methodologies
Anatomy of Angular 1.x
Anatomy of an Angular 1.x App
Index
html
App.js
Angular
BootstrapJquery
Plugins
CSS
CSS
CSS
CSS
HTML
Partial
REST API
HTML
Partial
HTML
Partial
$http
Controller
Routing
Controller Controller
ServicesServicesServices/
Providers
Directives
Filters
Angular Module
$rootScopeJquery
About Angular 2
• Angular 2 went final on 9/15!
• Version 2 sheds the non-standard 1.x conventions and
embraces forward looking web standards like
ECMAScript 6, Web Components as well as JS supersets
like TypeScript
• Component based architectural style
• Highly Improved routing
• Carries forward the ideology of Angular 1.x though the
code will look very different
• Focus on performance, transparency of Angular
“internals” Change Detection and Rendering
• Angular 2 has a simplified API for injecting dependencies
into components via ES6 Modules
Anatomy of an Angular 2 App
Angular 1 vs 2 Components
Big Changes in Angular 2
• Embraces ES6 Modules/Component Design
• Goodbye $scope (we hardly knew you) and DDO
• Ultra-Fast Change detection
• Changes in state managed through new Zones concept instead of
“dirty checking”
• Uses the new Object.observe property
• Major Routing Improvements
• Uni-Directional data flow (Similar to Facebook’s React)
• Angular 1.x’s popular 2-way data binding is removed
• ng-model replaced by new Form Directives
• Improved Template syntax with Property and Event bindings
instead of overuse of directives
$scope no more
One Framework, many langs
• Angular 2 supports multiple variants of vanilla JavaScript
Including:
• TypeScript
• Dart
• ES6
• ES5
• TypeScript is a strongly typed superset of JavaScript
currently in development at Microsoft. Angular 2 uses it
after an agreement between Google and Microsoft
• Pros
• Strong typed for larger codebases/teams
• Cons
• Learning curve over traditional JavaScript
• Must be compiled
• Complicated to setup (requires definition files)
So can we use it in
production yet?
• Angular 2 went gold YESTERDAY so yes
• Consider, however, that supporting technologies like
ECMAScript 6, TypeScript and Web Components will
require compilers and polyfills until
native support is universally
achieved
WRAP UP
Tying it all together
Summary
• The MEAN stack is comprised of four JavaScript based
technologies
• It can provide a flexible and powerful web development
environment to quickly build fast and scalable web apps
• Leverages a single language allowing for development using
resources with a similar coding toolset
• Node is a powerful platform for real-time, I/O web
applications and APIs
• Express is a flexible server platform capable of complex MVC
development
• Mongo is a SQL-less document driven database technology
• Angular is a front end framework that allows development of
dynamic single page web application front-ends
MEAN at work
• Best case scenarios for using Node:
• Backend for RESTful data APIs
• Streaming or real time app servers, like chat or
associate communication servers
• Apps/sites with small budget and tight timelines
• Internal dynamic web based tools (Call Centers,
Employee Support, Knowledge bases, etc.)
• Monitoring Dashboards
• Avoid for:
• Business logic centric systems (Java outperforms)
• Heavy server side computation
Want a more thorough look?
• Take a hands on deep dive into the design of a simple
MEAN based CRUD app
• Github/jfox015 – Coming soon!
QUESTIONS?
Anyone? Bueller?!?
Recommended Resources
• NodeJS - Server Side JS
• Best practices for Express app structure
• Express.js Middleware Demystified
• How to test your MongoDB models under Node & Express
• Unit Testing Express Middleware
• Unit Testing Express Middleware / TDD with Express and
Mocha
• Test driven Development of Web Apps in Node.Js
• Node.js frameworks
• Oracle vs. MongoDB
• Angular 2 vs Angular 1
Connect with or stalk me
(Entirelyuptoyou)
•Web Site: jfox015.com
•Twitter: @jfox015
•Github: Github.com/jfox015
•Slideshare: Slideshare.net/jfox015
•LinkedIn: Linkedin.com/in/jfox015
Thank you!

More Related Content

PDF
MEAN Stack Warm-up
PDF
ES2015 / ES6: Basics of modern Javascript
PPTX
React Native
PDF
Ionic framework one day training
PPTX
Angular.js in XPages
PDF
Modern javascript
PPTX
Mobile Applications with Angular 4 and Ionic 3
PPTX
Iconus 2016
MEAN Stack Warm-up
ES2015 / ES6: Basics of modern Javascript
React Native
Ionic framework one day training
Angular.js in XPages
Modern javascript
Mobile Applications with Angular 4 and Ionic 3
Iconus 2016

What's hot (20)

PDF
Why You Should Use MERN Stack for Startup Apps?
PDF
Алексей Волков "Введение в React Native"
PPTX
React Native
PDF
Creating an hybrid app in minutes with Ionic Framework
PDF
Ionic Framework
PPT
Ionic Framework
PPTX
Building Cross Platform Mobile Apps
PDF
React native-meetup-talk
PPTX
Building an Ionic hybrid mobile app with TypeScript
PPTX
PDF
Introduction to React Native
PDF
React.js and Flux in details
PPTX
Introduction to Ionic framework
PPTX
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
PDF
Getting Started with React Native (and should I use it at all?)
PDF
Testing Mobile JavaScript (Fall 2010
PDF
Hybrid Apps with Angular & Ionic Framework
PDF
Introduction To Single Page Application
PPTX
React native - React(ive) Way To Build Native Mobile Apps
PPTX
A Minimalist’s Attempt at Building a Distributed Application
Why You Should Use MERN Stack for Startup Apps?
Алексей Волков "Введение в React Native"
React Native
Creating an hybrid app in minutes with Ionic Framework
Ionic Framework
Ionic Framework
Building Cross Platform Mobile Apps
React native-meetup-talk
Building an Ionic hybrid mobile app with TypeScript
Introduction to React Native
React.js and Flux in details
Introduction to Ionic framework
AngularJS + NancyFx + MongoDB = The best trio for ultimate SPA by Bojan Velja...
Getting Started with React Native (and should I use it at all?)
Testing Mobile JavaScript (Fall 2010
Hybrid Apps with Angular & Ionic Framework
Introduction To Single Page Application
React native - React(ive) Way To Build Native Mobile Apps
A Minimalist’s Attempt at Building a Distributed Application
Ad

Viewers also liked (10)

PDF
Desbancando mitos sobre PHP e o futuro da linguagem
PDF
Beginning MEAN Stack
PPTX
Node.js - Devo adotar na minha empresa?
PDF
Introdução à MEAN Stack
PDF
Building an E-commerce website in MEAN stack
PDF
MEAN Stack
PPTX
Starting from Scratch with the MEAN Stack
PPTX
Mean full stack development
PDF
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
PDF
The MEAN stack - SoCalCodeCamp - june 29th 2014
Desbancando mitos sobre PHP e o futuro da linguagem
Beginning MEAN Stack
Node.js - Devo adotar na minha empresa?
Introdução à MEAN Stack
Building an E-commerce website in MEAN stack
MEAN Stack
Starting from Scratch with the MEAN Stack
Mean full stack development
เรียนรู้ Node JS แบบสบายๆ สำหรับผู้เริ่มต้น
The MEAN stack - SoCalCodeCamp - june 29th 2014
Ad

Similar to After the LAMP, it's time to get MEAN (20)

PPTX
Be faster then rabbits
PDF
Meetup. Technologies Intro for Non-Tech People
PDF
Node.js
PPTX
Web Applications Development with MEAN Stack
PDF
An introduction to Node.js
PPTX
Web technologies lesson 1
PPTX
Top 10 frameworks of node js
PPTX
Beginners Node.js
KEY
20120306 dublin js
PPTX
Introduction to MERN Stack
PPTX
web development with mern stack in power point
PPTX
Final year presentation topicssssss in 1
PPTX
Full-Stack-Presentation-Slide(Longsaar_Francis).pptx
PPTX
"Python web development combines the simplicity of the language with powerful...
PPTX
Cloud patterns
PDF
Meanstack Introduction by Kishore Chandra
PPTX
Introduction To Web Development & The New Digital Workplace
PPTX
What is Mean Stack Development ?
PPSX
Node.js In The Enterprise - A Primer
PPTX
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx
Be faster then rabbits
Meetup. Technologies Intro for Non-Tech People
Node.js
Web Applications Development with MEAN Stack
An introduction to Node.js
Web technologies lesson 1
Top 10 frameworks of node js
Beginners Node.js
20120306 dublin js
Introduction to MERN Stack
web development with mern stack in power point
Final year presentation topicssssss in 1
Full-Stack-Presentation-Slide(Longsaar_Francis).pptx
"Python web development combines the simplicity of the language with powerful...
Cloud patterns
Meanstack Introduction by Kishore Chandra
Introduction To Web Development & The New Digital Workplace
What is Mean Stack Development ?
Node.js In The Enterprise - A Primer
8 Node.js Frameworks Every Developer Should Know [UPDATED].pptx

Recently uploaded (20)

PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Encapsulation_ Review paper, used for researhc scholars
PPT
Teaching material agriculture food technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Electronic commerce courselecture one. Pdf
PDF
Approach and Philosophy of On baking technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PPTX
A Presentation on Artificial Intelligence
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Per capita expenditure prediction using model stacking based on satellite ima...
Encapsulation_ Review paper, used for researhc scholars
Teaching material agriculture food technology
Unlocking AI with Model Context Protocol (MCP)
NewMind AI Monthly Chronicles - July 2025
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Electronic commerce courselecture one. Pdf
Approach and Philosophy of On baking technology
Chapter 3 Spatial Domain Image Processing.pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
The AUB Centre for AI in Media Proposal.docx
Network Security Unit 5.pdf for BCA BBA.
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Reach Out and Touch Someone: Haptics and Empathic Computing
A Presentation on Artificial Intelligence

After the LAMP, it's time to get MEAN

  • 1. It’s time to get After the
  • 2. About Jeff Fox (@jfox015) Assoc.Dir.,DigitalExperienceTechLead StarwoodHotelsandResorts • Nineteen year web development veteran • (Almost) entirely self-taught in programming, web and related technologies • Front end specialist with full stack skills/experience, main core capability used to be Flash  • Background in Graphic Design and art, music production & engineering and “entertainment services” • Experience working for fortune 100 companies down to creative agencies with as few as 10 people
  • 3. Agenda •Quickie LAMP Review •Four Components of the MEAN stack (and a fifth bonus item too) •Wrap-up (with use cases) •Questions •Shatner
  • 4. We all know LAMP is a combination of four of the most popular open source technologies that form one of the most popular and ubiquitous platform stacks used on the web. It’s estimated that 82% of web sites run on some version of PHP [1] [1] Source: http://www.w3techs.com/technologies/details/pl-php/all/all
  • 5. LAMP is popular Some popular sites using PHP:
  • 6. LAMP is popular Wordpress hosted blogs and sites alone account for some 4.5% of all web sites [1] [1] http://www.codeinwp.com/blog/mesmerizing-wordpress-stats/ [2] http://expandedramblings.com/index.php/wordpress-statistics/ [3] https://www.hostt.com/wordpress-stats-for-2015/ [4] https://managewp.com/14-surprising-statistics-about-wordpress-usage • 74.6 Million Sites Depend on WordPress [2] • 22% of New U.S. Registered Domains Run on WordPress [3] • WordPress.com Gets More Unique US Visitors (126M) per month Than Amazon (96M) [4]
  • 7. What is M.E.A.N? Mean is a combination of four technologies that also form a single platform stack. The common element between them is JavaScript.
  • 9. About NodeJS “Node's goal is to provide an easy way to build scalable network programs.” -- nodejs.org
  • 10. Components of NodeJs • NodeJs runs on the V-8 Engine. • The V-8 Engine is an open source JavaScript engine created and developer by Google which also powers the Chrome browser. • V8 compiles JavaScript to native machine code (IA-32, x86-64, ARM, or MIPS ISAs) before executing it, instead of more traditional techniques such as executing byte code or interpreting it. • Node uses CommonJS specifications for common modular package management format • Uses NPM (Node Package Manager) to manage dependencies
  • 11. How does Node work? • Node.js uses an event-driven, non-blocking I/O model, which makes it lightweight • It makes use of event-loops via JavaScript’s callback functionality to implement a non- blocking I/O • While time consuming file and disk operations block script execution in PHP, Node JS commands execute in parallel, and use callbacks to signal completion or failure)
  • 13. Node in the Wild How is Node being used? API Servers Mobile backends and full-stack JavaScript hybrid apps Internet of things (IoT) Web – HTTP servers and single page apps
  • 14. Node Pros and Cons Pros Fast – Execution speed Faster to market – development speed Less lines of code Great community Proven with high volume systems Most suited for networking, I/O intensive applications Cons Writing a large business logic centric system is cumbersome Callback hell Exception handling is not straight forward Writing event driven code is complex compared to synchronous code Source: NodeJS - Server Side JS
  • 15. Node vs Java • 20+ years development testing making a rock solid foundation • Not as fast and Node, but absolutely a more trustworthy environment • Well know coding and debugging support in all major IDEs • True multi-threaded server support • No, XML used for Ant and Maven builds for example MATURITY SPEED TOOLS THREADING UNIFIED LANGUAGE • Younger player (launched in 2009) with less real world battle testing • Blazing fast execution, but sacrifices overall server safety for it • Modern IDE tools support via add-ons for code-completion and some debugging • Node simulated multi- threading via an event loop • Node uses JavaScript in all aspects of the development Source: Java vs. Node.js: An epic battle for developer mind share
  • 17. About Express • Popular NodeJS Server framework library • Inspired by the Sinatra framework for Ruby • Minimal and flexible application design • Handles many operations through HTTP helper utilities and the use of middleware • Easy to set up a working Express server in just few lines of code • Supports single page, multi-page and hybrid web applications
  • 19. Express Middleware Middleware is any number of functions that are invoked by the Express.js routing layer before the final request handler is called • Express Middleware is simply a function with three arguments • req – The HTTP Request • res – HTTP Response • next – Another Middleware to forward to after the function completes • Middleware is always invoked in the order added. • You can have multiple middleware for the same path. • Middleware has full access to the request and response objects. • Be mindful of middleware overriding fields of other middleware. • Middleware can be skipped by using the next function.
  • 21. Components of Express • Runs using NodeJs • App is the web application runtime • Middleware modules handle many routine operations: • Connect is a set of middleware that includes many helper modules • logger • csrf Cross-site request forgery protection • compress Gzip compression basicAuth http authentication • bodyParser extensible request body parser • json application/json parser • multipart multipart/form-data parser • timeout request timeouts • cookieParser cookie parser • session session management support with bundled MemoryStore • cookieSession cookie-based session support • methodOverride faux HTTP method support • favicon efficient favicon server (with default icon) • query automatic querystring parser, populating req.query • errorHandler flexible error handler
  • 22. Express Routing • Handles HTTP and RESTful calls over HTTP • Can direct to Middleware, MVC controllers, use templates or return files
  • 23. JADE TEMPLATES About… Soon to be re- released as PUG
  • 24. About Jade • High performance template engine heavily influenced by Haml and implemented with JavaScript for Node • No need to worry about closing tags • Significant white space enforces clear coding convention between team members • Layout Inheritance • Allows for full JavaScript expressions but makes it just awkward enough to discourage full blown logic in the views • Support for inline Markdown and CoffeeScript Source: Comparing JavaScript Templating Engines: Jade, Mustache, Dust and More
  • 26. Jade vs other Node templates Jade Mustache Dust NunJucks EJS No Closing Tags Async Layout Inheritance Streaming Custom tags High Learning Curve White Space Significance Easy Includes/ Partials Source: Comparing JavaScript Templating Engines: Jade, Mustache, Dust and More
  • 29. About MongoDB • An open source, cross platform database • Stores data in JSON like documents with dynamic schemas (called BSON) • Fourth most popular database system worldwide as of Jan 2016 [1] • A “no sql” database without relational connections, search an API [1] http://db-engines.com/en/ranking
  • 30. Data Design Comparison Traditional Data Design • Static, uniform, scalar data • Data “looks” like rectangles • Low level physical representation Document Data Design • Flexible and capable of rich shapes • Based on objects • High level business representation
  • 31. Advantages of No-SQL Design • Agility • Start developing without an extremely long ER (entry- relationship) model design • Flexible for schema changes as you go without penalty • Polymorphic schema models variable structure with ease • Scalability • Shared-nothing architecture vs centrally controlled system (eliminates any single point of failure, allows self-healing capabilities and non-disruptive upgrades) • Scales horizontally, linearly • Sharding and load balancing • Auto-balance ensures a balances cluster Source: MongoDB and the Internet of Things
  • 33. Major Use Cases… …and Major Users • Big Data (Github) • Internet of Things (Bosch) • Complex Data Management (Cushman & Wakefield) • Mobile Apps (Twitter, Foursquare) • Customer Data Management (Intuit) • Social Networking and Collaboration (Cisco, Eventbright) • Content Management (New York Times, Adobe AEM, eBay) • Embedded (Sitecore)
  • 34. Oracle vs MongoDB • Oranges • Created in 2009 • Document SQL-Less Model • Supports Replication, Horizontal scale and Sharding • Queries using JavaScript • MIT License • Free for commercial use • JSON (with BSON) • Supported by multiple cloud platforms • Apples • Created in 1936 • Relational Model • Supports Replication and Horizontal scale • Queries using SQL • Proprietary License • Large Price tag • Multiple data Types • Cloud Ready on Oracle Cloud Platform
  • 36. About AngularJS • “Super heroic” framework created and developed by Google • Highly suited to single page front end web applications • Version 1.x attempted to solve many web application shortcomings in HTML 5 and JavaScript • Version 2.x tightly incorporates the latest improvements in JavaScript and modular front end design methodologies
  • 38. Anatomy of an Angular 1.x App Index html App.js Angular BootstrapJquery Plugins CSS CSS CSS CSS HTML Partial REST API HTML Partial HTML Partial $http Controller Routing Controller Controller ServicesServicesServices/ Providers Directives Filters Angular Module $rootScopeJquery
  • 39. About Angular 2 • Angular 2 went final on 9/15! • Version 2 sheds the non-standard 1.x conventions and embraces forward looking web standards like ECMAScript 6, Web Components as well as JS supersets like TypeScript • Component based architectural style • Highly Improved routing • Carries forward the ideology of Angular 1.x though the code will look very different • Focus on performance, transparency of Angular “internals” Change Detection and Rendering • Angular 2 has a simplified API for injecting dependencies into components via ES6 Modules
  • 40. Anatomy of an Angular 2 App
  • 41. Angular 1 vs 2 Components
  • 42. Big Changes in Angular 2 • Embraces ES6 Modules/Component Design • Goodbye $scope (we hardly knew you) and DDO • Ultra-Fast Change detection • Changes in state managed through new Zones concept instead of “dirty checking” • Uses the new Object.observe property • Major Routing Improvements • Uni-Directional data flow (Similar to Facebook’s React) • Angular 1.x’s popular 2-way data binding is removed • ng-model replaced by new Form Directives • Improved Template syntax with Property and Event bindings instead of overuse of directives
  • 44. One Framework, many langs • Angular 2 supports multiple variants of vanilla JavaScript Including: • TypeScript • Dart • ES6 • ES5 • TypeScript is a strongly typed superset of JavaScript currently in development at Microsoft. Angular 2 uses it after an agreement between Google and Microsoft • Pros • Strong typed for larger codebases/teams • Cons • Learning curve over traditional JavaScript • Must be compiled • Complicated to setup (requires definition files)
  • 45. So can we use it in production yet? • Angular 2 went gold YESTERDAY so yes • Consider, however, that supporting technologies like ECMAScript 6, TypeScript and Web Components will require compilers and polyfills until native support is universally achieved
  • 46. WRAP UP Tying it all together
  • 47. Summary • The MEAN stack is comprised of four JavaScript based technologies • It can provide a flexible and powerful web development environment to quickly build fast and scalable web apps • Leverages a single language allowing for development using resources with a similar coding toolset • Node is a powerful platform for real-time, I/O web applications and APIs • Express is a flexible server platform capable of complex MVC development • Mongo is a SQL-less document driven database technology • Angular is a front end framework that allows development of dynamic single page web application front-ends
  • 48. MEAN at work • Best case scenarios for using Node: • Backend for RESTful data APIs • Streaming or real time app servers, like chat or associate communication servers • Apps/sites with small budget and tight timelines • Internal dynamic web based tools (Call Centers, Employee Support, Knowledge bases, etc.) • Monitoring Dashboards • Avoid for: • Business logic centric systems (Java outperforms) • Heavy server side computation
  • 49. Want a more thorough look? • Take a hands on deep dive into the design of a simple MEAN based CRUD app • Github/jfox015 – Coming soon!
  • 51. Recommended Resources • NodeJS - Server Side JS • Best practices for Express app structure • Express.js Middleware Demystified • How to test your MongoDB models under Node & Express • Unit Testing Express Middleware • Unit Testing Express Middleware / TDD with Express and Mocha • Test driven Development of Web Apps in Node.Js • Node.js frameworks • Oracle vs. MongoDB • Angular 2 vs Angular 1
  • 52. Connect with or stalk me (Entirelyuptoyou) •Web Site: jfox015.com •Twitter: @jfox015 •Github: Github.com/jfox015 •Slideshare: Slideshare.net/jfox015 •LinkedIn: Linkedin.com/in/jfox015