Getting Started MEAN Stack 

Baskin Tapkan

VP of Software Development - Composit Group, Inc

March 21, 2015

http://slides.com/baskint/devfestmn-mean#/

  • Full stack software developer using MVC frameworks (e.g. AngularJS, ASP.NET, Rails)
  • Open source software, community and user groups
  • Attend local user groups:
    • GDG Twin Cities (Code42 & Macalester)
    • Angular.MN (Virtuwell)
    • JavaScript-MN (coco - uptown)
    • Ruby.MN (DayBlock Brewery)
    • Arduino.MN (Code 42)
    • Node-MN (SportNgine)
    • MongoDB local meetup?
  • Part-time cloud developer & integrator (Azure & AWS)
  • IEEE Senior Member - Computer Society
  • Master of Science in EE - Signal Processing

About me

March 21, 2015

Just a bit more about me...

March 21, 2015

first DevFestMN - 2014

Windsurf & Kiteboard/Snowkite

Once a year pilgramage to :
  • Hood River, OR
  • South Padre Island, TX

March 21, 2015

What is "MEAN" Stack? 

March 21, 2015

Why "MEAN"?

March 21, 2015

OS Independence

Single-page-application (SPA)

One language on every stack 

No discrete technologies

Tons of support - Node Modules

JSON for data transfer

Derived from the word humongous, MongoDB is a scalable and high-performance open source database designed to handle document-oriented storage
Stores data in JSON (internally BSON), providing a rich data model which maps to native programming language type with a dynamic schema
No ACID transactions, instead uses dynamic queries, sorting, rich updates, upserts, and aggregation

Interacting:

  • Mongo shell
  • Robomongo
  • Mongoose module

March 21, 2015

MongoDB CRUD Operations

March 21, 2015

MongoDB Resources

March 21, 2015

docs.mongodb.org

university.mongodb.com

Books

  • MongoDB in Action
     
  • MongoDB
    The Definitive Guide

     
  • MongoDB Applied Design Patterns

March 21, 2015

Event driven: EventEmitter

Callbacks

Async, non-blocking I/O

Streams & Buffer

(x) Callback Hell

Google V8 to execute code

Modules

March 21, 2015

NodeJS Resources

Course: "Building Web Apps with Node.js" 

Books

  • Node.JS in Action
     
  • Node.JS in Practice
     
  • Node Up & Runing

March 21, 2015

A series of middleware calls

Middleware: function with access to request and response objects, and the next in middleware in line request-response lifecycle

Events

Properties

Methods

Request

Response

Router

March 21, 2015

  app.get('/games/example/auth', auth.requiresLogin, function(req, res, next) {
    res.send('Only authenticated users can access this');
  });

Middleware

Executed in the order from left to right

Can be used to set a cookie, user's log status, etc.

Template Engines

  • Jade - Haml inspired
  • Haml.js - Haml
  • EJS - Embedded JavaScript template engine
  • hbs - handlebards and moustache template engine
  • swig - fast template engine
  • ... 10+ more

Resources: 

March 21, 2015

dependecy injection

controllers

directives

factories

services

modules

animations

scopes

expressions

testing

March 21, 2015

Task Runners

Focuses on configuration

Focuses on code

March 21, 2015

Testing

March 21, 2015

Demo-I

March 21, 2015

Demo-II

Stale - but Yeoman for generators which does CRUD out of the box

March 21, 2015

Alternatives

MongoDB => CouchDB, RavenDB, Riak, Redis

AngularJS => React, EmberJS, Backbone, KnockoutJS, Drundal

Express => Hapi, Koa, Restify

NodeJS => I/O.JS

March 21, 2015

Conclusions

  • Frameworks are evolving, but JavaScript is here to stay. Keep investing - ES6 and beyond)
  • Make a judgement call:
    • Write from scratch - hard work, struggle, fail, learn
    • Start with a boilerplate framework - relatively easy to start, yet there are limitations
  • Participate in online communities
  • Have a side personal project
  • Stay on top of best practices - user groups, online forms and conferences are great for that
  • Practice and attend hackathons, hack nights as possible
  • Try out new things, innovate

Text

Made with Slides.com