[CodeStock 2015 edition]
A Full Stack Nirvana
{{Sponsor slide goes here}}
JavaScript Specialty Lead
Excella Consulting
@duluca
techtalkdc.com
explainJavaScriptPromises()
.then(function(result) {
console.log(result);
talkAboutFullStackJS();
});
function explainJSPromises() {
var deferred = Q.defer();
//some time consuming op
return deferred.promise;
}
//time consuming operation
$http.get(`google.com/search?=
javascript async promises`)
.then(function(wisdom) {
deferred.resolve(wisdom);
});
explainJavaScriptPromises()
.then(function(result) {
console.log(result);
talkAboutFullStackJS();
});
idea
JavaScript
...
profit
Presentation
API
Business
Persistence
Best Practices
IDE
Patterns
Libraries
Everything was same or very similar
Eran Hammer - WalMart Labs, Web Services Lead
The Right Stack
Angular.JS
Hapi.JS
Node.JS
LevelDB
Best Practices
WS
npm
Browserify
with 20% of the effort
+ Great for large databases
+ ORM features with Mongoose
+ Analytics using Jaspersoft
- Requires major installation
- Infrastructure
+ Fast key, value store
+ No installation
+ No infrastructure
- No ORM
- Only for basic data storage
+ Most supported Node web app framework
+ Lightweight to get off the ground
- No built in error handling
- Can be tedious
- Less help available
- Initial boilerplate
+ Consistency
+ Configurability
+ Separate business logic from transport layer
leads to
var encrypt = require('encryption');
var guid = require('guid');
...
define(['other-encryption',
'other-guid'],
function (encrypt, guid) {
...
});
brings NPM to the browser
var encrypt = require('encryption');
var guid = require('guid');
...
|-Excella.Lean.Api
|-Excella.Lean.Core
|---Exceptions
|---Models
|-Excella.Lean.Core.Composition
|---Modules
|-Excella.Lean.Dal
|---EntityFramework
|---Migrations
|-Excella.Lean.Domain:
|---Events
|-----Impl
|---Shared
|-----Impl
|-Excella.Lean.Fakes
|-Excella.Lean.ServiceReferences
|-Excella.Lean.Tests
|---Ui
|-----ModuleA
|-------PageObjects
|-------TestCases
|-Excella.Lean.Web
|---Composition
|---Content
|-----themes
|-------base
|---------images
|---Controllers
|---Core
|---Filters
|---Images
|---Models
|---Script
|-----app
|-------core
|---------helpers
|-------modules
|---------baseModule
|-----------landingPage
|---------eventsModule
|-----------eventDetails
|-----------eventsLanding
|-----lib
|-----tests
|-------core
|---------helpers
|-------other
|---Views
|-----Aat
|-----Home
|-----Shared
|-app
|---components
|---directives
|---services
|---styles
|-node_modules
|-public
|---css
|---favicons
|---fonts
|---images
|---js
|-server
|---controllers
|---models
|---services
|-shared
|-tests
Component based architecture
Standards based Web Components
var gulp = require('gulp');
gulp.task('build-js', function () {
return gulp.src('app/app.js')
.pipe(browserify({
insertGlobals : true,
debug : !process.env.production || true
}))
.pipe(gulp.dest('./public/js'))
});
gulp.task('default', ['build-js']);
gulp.task('watch', function () {
gulp.watch('./app/**/*.js', ['default']);
});
Presented in JavaScript