Intro to the MEAN Stack
Valeri Karpov
Kernel Tools Engineer, MongoDB
thecodebarbarian.com
github.com/vkarpov15
@code_barbarian
Who is this guy?
- CTO of SCVNGR (LevelUp) ‘08
- AngularJS user since v.0.9.4
- Google intern under Misko Hevery
in ‘09
- Ascot Project ‘12 - ’13
- MongoDB ‘13 - Present
What is this talk about?
- Why we started using MEAN and ditched
Rails
- Why the MEAN stack is exceptional for
prototyping
- How the MEAN stack makes automated
testing super easy
What is the MEAN Stack?
MongoDB - document database
ExpressJS - web framework for NodeJS
AngularJS - client-side sorcery
NodeJS - event-driven IO in Javascript
MEAN Stack Origins
- TonightLife, TigerLabs summer ‘12
- AngularJS, iOS, Android clients
- Rails backend wasn’t ideal
- Too many testing tools
- HTTP concurrency
- Debugging database interactions
- 2.5 devs, 5 languages
MEAN Stack Origins
- Ascot Project, AngelHack DC ‘12
- Only one language
- Very simple data model
- Parallelization
- Originally no AngularJS
- Tagger in jQuery, bad idea
MEAN Stack Philosophy
Ideally, a web-dev stack should help you:
Prototype. Build a usable product fast
Test. Automate testing using CI
Adapt. Iterate on feedback
Scale. Utilize server resources efficiently
MEAN Stack Philosophy
What we’re going to talk about:
Prototype. Build a usable product fast
Test. Automate testing using CI
Build fast and don’t break things
Build fast
- Super easy setup on Windows, OSX, Linux
- Just install NodeJS and MongoDB
- Guide on my blog at http://bit.ly/17y8QaI
Build fast
- Same language, same objects
- Two-way data binding = awesome
- Dynamic template passed as-is to database
Build fast
- NodeJS has the same object with _id
Build fast
- MongoDB shell shows the same object!
- Dynamic schema = no need for rake
- Try it for yourself: mean-stack-todo on github
Build fast
- Only change HTML, unless server-side
validation
- Easy to write
- Easy to debug
- Lower barrier to entry: 1 language, not 3
- Limitations: multiple clients
Don’t break things
- Automated testing makes life easy
- Nodeunit, Jasmine
- Integration tests using angular-scenario
Karma: Solving JS Testing
- http://karma-runner.github.io
- Launch browsers, run tests on file save
- Compatibility: angular-scenario, nodeunit,
jasmine
- Continuous Integration: run tests on commit
- Karma integrates easily with Jenkins,
Semaphore, Travis CI
Thanks for Listening!
Comments, questions, haikus?
Read more at:
thecodebarbarian.com
github.com/vkarpov15
@code_barbarian

MEAN Stack - Google Developers Live 10/03/2013

  • 1.
    Intro to theMEAN Stack Valeri Karpov Kernel Tools Engineer, MongoDB thecodebarbarian.com github.com/vkarpov15 @code_barbarian
  • 2.
    Who is thisguy? - CTO of SCVNGR (LevelUp) ‘08 - AngularJS user since v.0.9.4 - Google intern under Misko Hevery in ‘09 - Ascot Project ‘12 - ’13 - MongoDB ‘13 - Present
  • 3.
    What is thistalk about? - Why we started using MEAN and ditched Rails - Why the MEAN stack is exceptional for prototyping - How the MEAN stack makes automated testing super easy
  • 4.
    What is theMEAN Stack? MongoDB - document database ExpressJS - web framework for NodeJS AngularJS - client-side sorcery NodeJS - event-driven IO in Javascript
  • 5.
    MEAN Stack Origins -TonightLife, TigerLabs summer ‘12 - AngularJS, iOS, Android clients - Rails backend wasn’t ideal - Too many testing tools - HTTP concurrency - Debugging database interactions - 2.5 devs, 5 languages
  • 6.
    MEAN Stack Origins -Ascot Project, AngelHack DC ‘12 - Only one language - Very simple data model - Parallelization - Originally no AngularJS - Tagger in jQuery, bad idea
  • 7.
    MEAN Stack Philosophy Ideally,a web-dev stack should help you: Prototype. Build a usable product fast Test. Automate testing using CI Adapt. Iterate on feedback Scale. Utilize server resources efficiently
  • 8.
    MEAN Stack Philosophy Whatwe’re going to talk about: Prototype. Build a usable product fast Test. Automate testing using CI Build fast and don’t break things
  • 9.
    Build fast - Supereasy setup on Windows, OSX, Linux - Just install NodeJS and MongoDB - Guide on my blog at http://bit.ly/17y8QaI
  • 10.
    Build fast - Samelanguage, same objects - Two-way data binding = awesome - Dynamic template passed as-is to database
  • 11.
    Build fast - NodeJShas the same object with _id
  • 12.
    Build fast - MongoDBshell shows the same object! - Dynamic schema = no need for rake - Try it for yourself: mean-stack-todo on github
  • 13.
    Build fast - Onlychange HTML, unless server-side validation - Easy to write - Easy to debug - Lower barrier to entry: 1 language, not 3 - Limitations: multiple clients
  • 14.
    Don’t break things -Automated testing makes life easy - Nodeunit, Jasmine - Integration tests using angular-scenario
  • 15.
    Karma: Solving JSTesting - http://karma-runner.github.io - Launch browsers, run tests on file save - Compatibility: angular-scenario, nodeunit, jasmine - Continuous Integration: run tests on commit - Karma integrates easily with Jenkins, Semaphore, Travis CI
  • 16.
    Thanks for Listening! Comments,questions, haikus? Read more at: thecodebarbarian.com github.com/vkarpov15 @code_barbarian