SlideShare a Scribd company logo
Zero to Hipster with the M.I.K.E. Stack
Jen Looper and Charlie Key
Jen Looper
Developer Advocate, Telerik
@jenlooper
Charlie Key
Co-Founder, Modulus
@Zwigby
Signs of hipsterism
Fixed-Gear Bicycles
Signs of hipsterism
Mason Jar Lunches
Signs of hipsterism
Urban Beekeeping
Signs of hipsterism
Using a Cool-Sounding JavaScript-Based Framework
I’m totally a hipster.
“If you call yourself a hipster, you’re so not one.”
Mom, srsly!”
You know you’re a hipster when…
You create your own darn web stack*
Presenting…the M.I.K.E. Stack
*with thanks also to Carl Bergenhem** and Burke Holland
**Carl looks kind of like Mike or vice versa
Meet M.I.K.E. for your SPA!
M
I
K
E
MongoDB - Database
Io.js - Backend Server
Kendo UI – Presentation
& SPA routing
Express.js - Web Server
& API
}
Meet M.I.K.E.
M MongoDB – a noSQL database
• Mongo – scalable, for ‘humongous’ amounts of data
• Not a relational database
• Uses JSON-based querying language
• Flexible data model
SQL: select * from tblInventory Mongo: db.inventory.find({})
Meet M.I.K.E.
I Io.js– (a fork of Node, we’re just going to use Node)
• Io.js is hipper than Node but I won’t tell if you use Node
• Node = server-side JS
//this goes in a file called example.js
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Worldn');
}).listen(1337, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
//execute it from the command line
% node example.js
Server running at http://127.0.0.1:1337/
Meet M.I.K.E.
K Kendo UI – Presentation layer
• jQuery-based widgets to help
you make your frontend look
stylin’
• Leverages HTML5 and
JavaScript
• Because rolling your own
charts and grids = :’-(
• Using Kendo routing to create
SPA (no page refresh)
Meet M.I.K.E.
E Express.js – your webserver
• Because Node + Express = <3
• Facilitates creating API
. add package.json to folder
& declare express as dependency
{
"name": "Mike",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www"
},
"description": "Mike",
"author": {
"name": "Looper",
"email": ""
},
"dependencies": {
"express": "~4.9.0"
}
}
. npm install to add express to the folder
. Create test.js in folder:
var express = require('express')
var app = express()
app.get('/', function (req, res) {
res.send('Hello Express!')
})
var server = app.listen(3000, function () {
var host = server.address().address
var port = server.address().port
console.log('Example app listening at http://%s:%s', host, port)
})
. node test
http://www.mike-stack.com
https://github.com/jlooper/mike
Let’s get started!
Let’s build a SPA-style web site using the M.I.K.E. stack because we can
I’m using Visual Studio 2013 on Windows 8.1
with Node installed
Install NodeJS Tools for Visual Studio
NodeJS Tools available from Codeplex
Today’s tasks:
1.Scaffold an Express 4 app in VS and clean it up
for our purposes
2.Set up an Express Route
3.Add Kendo UI and Bootstrap for pretteh + SPA
behavior
4.All about that database!
5.Craft your API
Create a new Express 4 Project
VS will install dependencies for you
…and scaffold a basic Express app to run on
NodeJS
Run the app in Chrome and…
What just happened?
A bunch of dependencies were installed
Public folder > images, CSS, JS
Routes > ‘traffic signals’
Views > jade templates for each view
app.js > base file
package.json > lists dependencies to install
We don’t need a lot of those dependencies. Let’s
change it up.
Edit package.json and update npm Packages in VS
"dependencies": {
"express": "~4.9.0",
"body-parser": "~1.8.1",
"mongoose": "3.8.11",
"cookie-parser": "~1.3.3",
"morgan": "~1.3.0",
"serve-favicon": "~2.1.3",
"debug": "~2.0.0",
"ejs": "^1.0.0"
}
Now we have only packages we need:
we got rid of jade* and stylus**
*because “ew”
**because we don’t really need it now
1. Housekeeping – remove reference to
jade and stylus in app.js
and delete .jade and .styl files
remove
Set our rendering engine to be html, since we
don’t use jade
Replace the .jade templates with some simple html
(for now)
2. Routing.
Let’s look at routing in Express
Routes correspond
to web pages and calls:
localhost:1337/users
Building our /contact routes
Delete all /routes files, replace with
contact.js
3. Let’s add Kendo UI !
npm install –g bower
make sure you have git installed
bower install kendo-ui
Add to /public
Add bootstrap .js, bootstrap styles, and custom
styles
/public/javascripts/bootstrap.min.js
/public/stylesheets/bootstrap.min.css
/public/stylesheets/style.css
Build out Kendo templates in index.html
1. Link up all the scripts in the header
2. Add a blank div <div id=“main"></div>
3. Add 3 kendo templates – nav, home-view, contact-view
<script type="text/x-kendo-template" id="home-view">
<div class="view-content">
<div class="container content">
<div class="row">
<div class="col-sm-12">
Home
</div>
</div>
</div>
</div>
</script>
Add app.js to /bower_components/kendo-ui
/kendo/app.js will turn our Express app into a SPA
_MIKE.startSPA = function () {
_kendoRouter.start();
_baseLayout.render('#main');
}
Use Express for managing database calls via Express routes
Use Kendo for page routing
Fire it up!
In index.html, call startApp:
<script>
(function() {
MIKE.startApp();
})();
</script>
4. All about that database!
Install MongoDB, and start it up with ‘mongod’ and then ‘mongo’
Require mongoose and connect to the local
db
In /app.js:
var mongoose = require('mongoose');
var connectionString = 'mongodb://127.0.0.1/contacts'
mongoose.connect(connectionString);
Mongoose provides structure for MongoDB. You can create a
model to whip data into shape.
Database
name
Make a data schema to shape data sent to MongoDB
Create a new file: /models/contact.js
var mongoose=require('mongoose');
var Schema=mongoose.Schema;
var contactSchema = new Schema({
fName: String,
lName: String,
email: String,
status: String,
schedule: String,
message: String
});
module.exports = mongoose.model('Contact', contactSchema);
Make your data model available to your Express
routes
In routes/contact.js, add a line:
var Contact = require(‘../models/contact’);
5. Create your API
In /app.js, add:
app.use('/api', contacts);
…set up ajax call
$.ajax({
url: '/api/contacts',
type: 'post',
data: serializedDataToPost,
contentType: 'application/json'
}).done(function (data) {
$('.alert-success').toggle();
$(".success-message").html(data.message);
}).fail(function (data) {
$('.alert-danger').toggle();
$(".fail-message").html(data.message);
});
Build a form on the frontend to get contact
info
See the pretty widgets! (I spy Kendo UI)
<input id="schedule" name="schedule" data-
role="timepicker" data-bind="value: schedule"
value="10:00 AM">
Test the form post
db.contacts.find()
{ "_id" : ObjectId("551d79a387ff1b140eb4f663"), "lName" : "Looper", "fName" : "Jen", "email" :
"jen.looper@telerik.com", "schedule" : "2015-04-03T22:30:00.000Z", "status" : "", "message" : ”dinner
time!", "__v" : 0 }
>
Query
mongo to
see data
What just happened!?
1. Frontend form gathered data
2. Made ajax call via Kendo UI
framework
3. Shaped up the data using
Mongoose schema
4. Via Express route, sent data to
Mongo, bubbled up message from
Express to Frontend
5. Scheduled Mike to come to dinner
6. Dropped mic’ and walked away
Trivia question!!!
For a prize!
What is the name of the company that builds the
Node.js add-ons for Visual Studio?
Let’s take Mike to Production!
Charlie Key
Co-Founder, Modulus
@Zwigby
Thank you!
Charlie Key
Co-Founder, Modulus
@Zwigby
Evaluation: http://bit.ly/next-looper-2
Jen Looper
Developer Advocate, Telerik
@jenlooper

More Related Content

What's hot

Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
Michael MacDonald
 
Json to json transformation in mule
Json to json transformation in muleJson to json transformation in mule
Json to json transformation in mule
Antonio Pellegrino
 
xml-motor ~ What,Why,How
xml-motor ~ What,Why,Howxml-motor ~ What,Why,How
xml-motor ~ What,Why,How
Abhishek Kumar
 
A slightly advanced introduction to node.js
A slightly advanced introduction to node.jsA slightly advanced introduction to node.js
A slightly advanced introduction to node.js
Sudar Muthu
 
MySQLi - An Improved Extension of MySQL
MySQLi - An Improved Extension of MySQLMySQLi - An Improved Extension of MySQL
MySQLi - An Improved Extension of MySQL
Global Codester
 
Symfony2 and AngularJS
Symfony2 and AngularJSSymfony2 and AngularJS
Symfony2 and AngularJS
Antonio Peric-Mazar
 
Ruby MVC from scratch with Rack
Ruby MVC from scratch with RackRuby MVC from scratch with Rack
Ruby MVC from scratch with Rack
DonSchado
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
True-Vision
 
Mule: JSON to Object
Mule: JSON to ObjectMule: JSON to Object
Mule: JSON to Object
Sulthony Hartanto
 
Mule parsing with json part2
Mule parsing with json part2Mule parsing with json part2
Mule parsing with json part2
Anirban Sen Chowdhary
 
Webinar: Getting Started with Ruby and MongoDB
Webinar: Getting Started with Ruby and MongoDBWebinar: Getting Started with Ruby and MongoDB
Webinar: Getting Started with Ruby and MongoDB
MongoDB
 
Remove web calls and scale your site like crazy !
Remove web calls and scale your site like crazy !Remove web calls and scale your site like crazy !
Remove web calls and scale your site like crazy !
Wim Godden
 
Create a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDBCreate a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDB
Hengki Sihombing
 
Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformer
irfan1008
 
Creating dynamic json in Mule
Creating dynamic json in MuleCreating dynamic json in Mule
Creating dynamic json in Mule
F K
 
from(0).to('rubygems.org')
from(0).to('rubygems.org')from(0).to('rubygems.org')
from(0).to('rubygems.org')
michele franzin
 

What's hot (16)

Ruby on Rails Presentation
Ruby on Rails PresentationRuby on Rails Presentation
Ruby on Rails Presentation
 
Json to json transformation in mule
Json to json transformation in muleJson to json transformation in mule
Json to json transformation in mule
 
xml-motor ~ What,Why,How
xml-motor ~ What,Why,Howxml-motor ~ What,Why,How
xml-motor ~ What,Why,How
 
A slightly advanced introduction to node.js
A slightly advanced introduction to node.jsA slightly advanced introduction to node.js
A slightly advanced introduction to node.js
 
MySQLi - An Improved Extension of MySQL
MySQLi - An Improved Extension of MySQLMySQLi - An Improved Extension of MySQL
MySQLi - An Improved Extension of MySQL
 
Symfony2 and AngularJS
Symfony2 and AngularJSSymfony2 and AngularJS
Symfony2 and AngularJS
 
Ruby MVC from scratch with Rack
Ruby MVC from scratch with RackRuby MVC from scratch with Rack
Ruby MVC from scratch with Rack
 
Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)Rails Presentation (Anton Dmitriyev)
Rails Presentation (Anton Dmitriyev)
 
Mule: JSON to Object
Mule: JSON to ObjectMule: JSON to Object
Mule: JSON to Object
 
Mule parsing with json part2
Mule parsing with json part2Mule parsing with json part2
Mule parsing with json part2
 
Webinar: Getting Started with Ruby and MongoDB
Webinar: Getting Started with Ruby and MongoDBWebinar: Getting Started with Ruby and MongoDB
Webinar: Getting Started with Ruby and MongoDB
 
Remove web calls and scale your site like crazy !
Remove web calls and scale your site like crazy !Remove web calls and scale your site like crazy !
Remove web calls and scale your site like crazy !
 
Create a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDBCreate a RESTful API with NodeJS, Express and MongoDB
Create a RESTful API with NodeJS, Express and MongoDB
 
Converting with custom transformer
Converting with custom transformerConverting with custom transformer
Converting with custom transformer
 
Creating dynamic json in Mule
Creating dynamic json in MuleCreating dynamic json in Mule
Creating dynamic json in Mule
 
from(0).to('rubygems.org')
from(0).to('rubygems.org')from(0).to('rubygems.org')
from(0).to('rubygems.org')
 

Similar to Zero to Hipster with the M.I.K.E. Stack

MIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
MIKE Stack Introduction - MongoDB, io.js, KendoUI, and ExpressMIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
MIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
Charlie Key
 
Building HTTP API's with NodeJS and MongoDB
Building HTTP API's with NodeJS and MongoDBBuilding HTTP API's with NodeJS and MongoDB
Building HTTP API's with NodeJS and MongoDB
donnfelker
 
RESTful API In Node Js using Express
RESTful API In Node Js using Express RESTful API In Node Js using Express
RESTful API In Node Js using Express
Jeetendra singh
 
MongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN StackMongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN Stack
MongoDB
 
How to build microservices with node.js
How to build microservices with node.jsHow to build microservices with node.js
How to build microservices with node.js
Katy Slemon
 
Node js crash course session 5
Node js crash course   session 5Node js crash course   session 5
Node js crash course session 5
Abdul Rahman Masri Attal
 
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
Codemotion
 
Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014
Brian Cavalier
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
Adrien Guéret
 
Node.js with MySQL.pdf
Node.js with MySQL.pdfNode.js with MySQL.pdf
Node.js with MySQL.pdf
SudhanshiBakre1
 
Getting into ember.js
Getting into ember.jsGetting into ember.js
Getting into ember.js
reybango
 
Introducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsIntroducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.js
Richard Rodger
 
20120816 nodejsdublin
20120816 nodejsdublin20120816 nodejsdublin
20120816 nodejsdublin
Richard Rodger
 
Full Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQLFull Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQL
All Things Open
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
Matthew Groves
 
Express node js
Express node jsExpress node js
Express node js
Yashprit Singh
 
Be mean
Be meanBe mean
Be mean
Suissa
 
Node js getting started
Node js getting startedNode js getting started
Node js getting started
Pallavi Srivastava
 
Basic API Creation with Node.JS
Basic API Creation with Node.JSBasic API Creation with Node.JS
Basic API Creation with Node.JS
Azilen Technologies Pvt. Ltd.
 
phptut4
phptut4phptut4
phptut4
tutorialsruby
 

Similar to Zero to Hipster with the M.I.K.E. Stack (20)

MIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
MIKE Stack Introduction - MongoDB, io.js, KendoUI, and ExpressMIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
MIKE Stack Introduction - MongoDB, io.js, KendoUI, and Express
 
Building HTTP API's with NodeJS and MongoDB
Building HTTP API's with NodeJS and MongoDBBuilding HTTP API's with NodeJS and MongoDB
Building HTTP API's with NodeJS and MongoDB
 
RESTful API In Node Js using Express
RESTful API In Node Js using Express RESTful API In Node Js using Express
RESTful API In Node Js using Express
 
MongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN StackMongoDB Days UK: Building Apps with the MEAN Stack
MongoDB Days UK: Building Apps with the MEAN Stack
 
How to build microservices with node.js
How to build microservices with node.jsHow to build microservices with node.js
How to build microservices with node.js
 
Node js crash course session 5
Node js crash course   session 5Node js crash course   session 5
Node js crash course session 5
 
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
 
Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014Differential Sync and JSON Patch @ SpringOne2GX 2014
Differential Sync and JSON Patch @ SpringOne2GX 2014
 
Introduction to node.js
Introduction to node.jsIntroduction to node.js
Introduction to node.js
 
Node.js with MySQL.pdf
Node.js with MySQL.pdfNode.js with MySQL.pdf
Node.js with MySQL.pdf
 
Getting into ember.js
Getting into ember.jsGetting into ember.js
Getting into ember.js
 
Introducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.jsIntroducing the Seneca MVP framework for Node.js
Introducing the Seneca MVP framework for Node.js
 
20120816 nodejsdublin
20120816 nodejsdublin20120816 nodejsdublin
20120816 nodejsdublin
 
Full Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQLFull Stack Development with Node.js and NoSQL
Full Stack Development with Node.js and NoSQL
 
Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017Full stack development with node and NoSQL - All Things Open - October 2017
Full stack development with node and NoSQL - All Things Open - October 2017
 
Express node js
Express node jsExpress node js
Express node js
 
Be mean
Be meanBe mean
Be mean
 
Node js getting started
Node js getting startedNode js getting started
Node js getting started
 
Basic API Creation with Node.JS
Basic API Creation with Node.JSBasic API Creation with Node.JS
Basic API Creation with Node.JS
 
phptut4
phptut4phptut4
phptut4
 

More from Jen Looper

Computer Science for Kids: A Storytelling Approach
Computer Science for Kids: A Storytelling ApproachComputer Science for Kids: A Storytelling Approach
Computer Science for Kids: A Storytelling Approach
Jen Looper
 
Staying Fresh and Avoiding Burnout
Staying Fresh and Avoiding BurnoutStaying Fresh and Avoiding Burnout
Staying Fresh and Avoiding Burnout
Jen Looper
 
Game On With NativeScript
Game On With NativeScriptGame On With NativeScript
Game On With NativeScript
Jen Looper
 
NativeScript and Angular
NativeScript and AngularNativeScript and Angular
NativeScript and Angular
Jen Looper
 
Sharing Code between Web and Mobile Apps
Sharing Code between Web and Mobile AppsSharing Code between Web and Mobile Apps
Sharing Code between Web and Mobile Apps
Jen Looper
 
Beacons, Plants, Boxes
Beacons, Plants, BoxesBeacons, Plants, Boxes
Beacons, Plants, Boxes
Jen Looper
 
Ignite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseIgnite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and Firebase
Jen Looper
 
Hackathon Slides
Hackathon SlidesHackathon Slides
Hackathon Slides
Jen Looper
 
Using Beacons in a Mobile App - IoT Nearables
Using Beacons in a Mobile App - IoT NearablesUsing Beacons in a Mobile App - IoT Nearables
Using Beacons in a Mobile App - IoT Nearables
Jen Looper
 
Swipe Left for NativeScript
Swipe Left for NativeScriptSwipe Left for NativeScript
Swipe Left for NativeScript
Jen Looper
 
Angular 2 and NativeScript
Angular 2 and NativeScriptAngular 2 and NativeScript
Angular 2 and NativeScript
Jen Looper
 
Crafting an Adventure: The Azure Maya Mystery
Crafting an Adventure: The Azure Maya MysteryCrafting an Adventure: The Azure Maya Mystery
Crafting an Adventure: The Azure Maya Mystery
Jen Looper
 
Re-Building a Tech Community - Post Pandemic!
Re-Building a Tech Community - Post Pandemic!Re-Building a Tech Community - Post Pandemic!
Re-Building a Tech Community - Post Pandemic!
Jen Looper
 
Building a Tech Community in Ten Easy Steps
Building a Tech Community in Ten Easy StepsBuilding a Tech Community in Ten Easy Steps
Building a Tech Community in Ten Easy Steps
Jen Looper
 
Becoming a Green Developer
Becoming a Green DeveloperBecoming a Green Developer
Becoming a Green Developer
Jen Looper
 
Azure Static Web Apps
Azure Static Web AppsAzure Static Web Apps
Azure Static Web Apps
Jen Looper
 
Creating a Great Workshop
Creating a Great WorkshopCreating a Great Workshop
Creating a Great Workshop
Jen Looper
 
The Ethics of Generative AI: A Humanist's Guide
The Ethics of Generative AI: A Humanist's GuideThe Ethics of Generative AI: A Humanist's Guide
The Ethics of Generative AI: A Humanist's Guide
Jen Looper
 
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXT
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXTTelerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXT
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXT
Jen Looper
 
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT Conference
Jen Looper
 

More from Jen Looper (20)

Computer Science for Kids: A Storytelling Approach
Computer Science for Kids: A Storytelling ApproachComputer Science for Kids: A Storytelling Approach
Computer Science for Kids: A Storytelling Approach
 
Staying Fresh and Avoiding Burnout
Staying Fresh and Avoiding BurnoutStaying Fresh and Avoiding Burnout
Staying Fresh and Avoiding Burnout
 
Game On With NativeScript
Game On With NativeScriptGame On With NativeScript
Game On With NativeScript
 
NativeScript and Angular
NativeScript and AngularNativeScript and Angular
NativeScript and Angular
 
Sharing Code between Web and Mobile Apps
Sharing Code between Web and Mobile AppsSharing Code between Web and Mobile Apps
Sharing Code between Web and Mobile Apps
 
Beacons, Plants, Boxes
Beacons, Plants, BoxesBeacons, Plants, Boxes
Beacons, Plants, Boxes
 
Ignite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and FirebaseIgnite your app development with Angular, NativeScript and Firebase
Ignite your app development with Angular, NativeScript and Firebase
 
Hackathon Slides
Hackathon SlidesHackathon Slides
Hackathon Slides
 
Using Beacons in a Mobile App - IoT Nearables
Using Beacons in a Mobile App - IoT NearablesUsing Beacons in a Mobile App - IoT Nearables
Using Beacons in a Mobile App - IoT Nearables
 
Swipe Left for NativeScript
Swipe Left for NativeScriptSwipe Left for NativeScript
Swipe Left for NativeScript
 
Angular 2 and NativeScript
Angular 2 and NativeScriptAngular 2 and NativeScript
Angular 2 and NativeScript
 
Crafting an Adventure: The Azure Maya Mystery
Crafting an Adventure: The Azure Maya MysteryCrafting an Adventure: The Azure Maya Mystery
Crafting an Adventure: The Azure Maya Mystery
 
Re-Building a Tech Community - Post Pandemic!
Re-Building a Tech Community - Post Pandemic!Re-Building a Tech Community - Post Pandemic!
Re-Building a Tech Community - Post Pandemic!
 
Building a Tech Community in Ten Easy Steps
Building a Tech Community in Ten Easy StepsBuilding a Tech Community in Ten Easy Steps
Building a Tech Community in Ten Easy Steps
 
Becoming a Green Developer
Becoming a Green DeveloperBecoming a Green Developer
Becoming a Green Developer
 
Azure Static Web Apps
Azure Static Web AppsAzure Static Web Apps
Azure Static Web Apps
 
Creating a Great Workshop
Creating a Great WorkshopCreating a Great Workshop
Creating a Great Workshop
 
The Ethics of Generative AI: A Humanist's Guide
The Ethics of Generative AI: A Humanist's GuideThe Ethics of Generative AI: A Humanist's Guide
The Ethics of Generative AI: A Humanist's Guide
 
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXT
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXTTelerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXT
Telerik AppBuilder, Estimote Beacons, and the IoT - Presentation for TelerikNEXT
 
Telerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT ConferenceTelerik AppBuilder Presentation for TelerikNEXT Conference
Telerik AppBuilder Presentation for TelerikNEXT Conference
 

Recently uploaded

WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
fredae14
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
alexjohnson7307
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
panagenda
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
DanBrown980551
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
saastr
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
flufftailshop
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 

Recently uploaded (20)

WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
Recommendation System using RAG Architecture
Recommendation System using RAG ArchitectureRecommendation System using RAG Architecture
Recommendation System using RAG Architecture
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
leewayhertz.com-AI in predictive maintenance Use cases technologies benefits ...
 
HCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAUHCL Notes and Domino License Cost Reduction in the World of DLAU
HCL Notes and Domino License Cost Reduction in the World of DLAU
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides5th LF Energy Power Grid Model Meet-up Slides
5th LF Energy Power Grid Model Meet-up Slides
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
Deep Dive: AI-Powered Marketing to Get More Leads and Customers with HyperGro...
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdfNunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
Nunit vs XUnit vs MSTest Differences Between These Unit Testing Frameworks.pdf
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 

Zero to Hipster with the M.I.K.E. Stack

  • 1. Zero to Hipster with the M.I.K.E. Stack Jen Looper and Charlie Key
  • 2. Jen Looper Developer Advocate, Telerik @jenlooper
  • 7. Signs of hipsterism Using a Cool-Sounding JavaScript-Based Framework
  • 8. I’m totally a hipster.
  • 9. “If you call yourself a hipster, you’re so not one.” Mom, srsly!”
  • 10. You know you’re a hipster when… You create your own darn web stack* Presenting…the M.I.K.E. Stack *with thanks also to Carl Bergenhem** and Burke Holland **Carl looks kind of like Mike or vice versa
  • 11. Meet M.I.K.E. for your SPA! M I K E MongoDB - Database Io.js - Backend Server Kendo UI – Presentation & SPA routing Express.js - Web Server & API }
  • 12. Meet M.I.K.E. M MongoDB – a noSQL database • Mongo – scalable, for ‘humongous’ amounts of data • Not a relational database • Uses JSON-based querying language • Flexible data model SQL: select * from tblInventory Mongo: db.inventory.find({})
  • 13. Meet M.I.K.E. I Io.js– (a fork of Node, we’re just going to use Node) • Io.js is hipper than Node but I won’t tell if you use Node • Node = server-side JS //this goes in a file called example.js var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }).listen(1337, '127.0.0.1'); console.log('Server running at http://127.0.0.1:1337/'); //execute it from the command line % node example.js Server running at http://127.0.0.1:1337/
  • 14. Meet M.I.K.E. K Kendo UI – Presentation layer • jQuery-based widgets to help you make your frontend look stylin’ • Leverages HTML5 and JavaScript • Because rolling your own charts and grids = :’-( • Using Kendo routing to create SPA (no page refresh)
  • 15. Meet M.I.K.E. E Express.js – your webserver • Because Node + Express = <3 • Facilitates creating API . add package.json to folder & declare express as dependency { "name": "Mike", "version": "0.0.0", "private": true, "scripts": { "start": "node ./bin/www" }, "description": "Mike", "author": { "name": "Looper", "email": "" }, "dependencies": { "express": "~4.9.0" } } . npm install to add express to the folder . Create test.js in folder: var express = require('express') var app = express() app.get('/', function (req, res) { res.send('Hello Express!') }) var server = app.listen(3000, function () { var host = server.address().address var port = server.address().port console.log('Example app listening at http://%s:%s', host, port) }) . node test
  • 17. Let’s get started! Let’s build a SPA-style web site using the M.I.K.E. stack because we can I’m using Visual Studio 2013 on Windows 8.1 with Node installed
  • 18. Install NodeJS Tools for Visual Studio
  • 19. NodeJS Tools available from Codeplex
  • 20. Today’s tasks: 1.Scaffold an Express 4 app in VS and clean it up for our purposes 2.Set up an Express Route 3.Add Kendo UI and Bootstrap for pretteh + SPA behavior 4.All about that database! 5.Craft your API
  • 21. Create a new Express 4 Project
  • 22. VS will install dependencies for you
  • 23. …and scaffold a basic Express app to run on NodeJS
  • 24. Run the app in Chrome and…
  • 25. What just happened? A bunch of dependencies were installed Public folder > images, CSS, JS Routes > ‘traffic signals’ Views > jade templates for each view app.js > base file package.json > lists dependencies to install
  • 26. We don’t need a lot of those dependencies. Let’s change it up. Edit package.json and update npm Packages in VS "dependencies": { "express": "~4.9.0", "body-parser": "~1.8.1", "mongoose": "3.8.11", "cookie-parser": "~1.3.3", "morgan": "~1.3.0", "serve-favicon": "~2.1.3", "debug": "~2.0.0", "ejs": "^1.0.0" }
  • 27. Now we have only packages we need: we got rid of jade* and stylus** *because “ew” **because we don’t really need it now
  • 28. 1. Housekeeping – remove reference to jade and stylus in app.js and delete .jade and .styl files remove
  • 29. Set our rendering engine to be html, since we don’t use jade
  • 30. Replace the .jade templates with some simple html (for now)
  • 31. 2. Routing. Let’s look at routing in Express Routes correspond to web pages and calls: localhost:1337/users
  • 32. Building our /contact routes Delete all /routes files, replace with contact.js
  • 33. 3. Let’s add Kendo UI ! npm install –g bower make sure you have git installed bower install kendo-ui Add to /public
  • 34. Add bootstrap .js, bootstrap styles, and custom styles /public/javascripts/bootstrap.min.js /public/stylesheets/bootstrap.min.css /public/stylesheets/style.css
  • 35. Build out Kendo templates in index.html 1. Link up all the scripts in the header 2. Add a blank div <div id=“main"></div> 3. Add 3 kendo templates – nav, home-view, contact-view <script type="text/x-kendo-template" id="home-view"> <div class="view-content"> <div class="container content"> <div class="row"> <div class="col-sm-12"> Home </div> </div> </div> </div> </script>
  • 36. Add app.js to /bower_components/kendo-ui /kendo/app.js will turn our Express app into a SPA _MIKE.startSPA = function () { _kendoRouter.start(); _baseLayout.render('#main'); } Use Express for managing database calls via Express routes Use Kendo for page routing
  • 37. Fire it up! In index.html, call startApp: <script> (function() { MIKE.startApp(); })(); </script>
  • 38. 4. All about that database! Install MongoDB, and start it up with ‘mongod’ and then ‘mongo’
  • 39. Require mongoose and connect to the local db In /app.js: var mongoose = require('mongoose'); var connectionString = 'mongodb://127.0.0.1/contacts' mongoose.connect(connectionString); Mongoose provides structure for MongoDB. You can create a model to whip data into shape. Database name
  • 40. Make a data schema to shape data sent to MongoDB Create a new file: /models/contact.js var mongoose=require('mongoose'); var Schema=mongoose.Schema; var contactSchema = new Schema({ fName: String, lName: String, email: String, status: String, schedule: String, message: String }); module.exports = mongoose.model('Contact', contactSchema);
  • 41. Make your data model available to your Express routes In routes/contact.js, add a line: var Contact = require(‘../models/contact’);
  • 42. 5. Create your API In /app.js, add: app.use('/api', contacts); …set up ajax call $.ajax({ url: '/api/contacts', type: 'post', data: serializedDataToPost, contentType: 'application/json' }).done(function (data) { $('.alert-success').toggle(); $(".success-message").html(data.message); }).fail(function (data) { $('.alert-danger').toggle(); $(".fail-message").html(data.message); });
  • 43. Build a form on the frontend to get contact info
  • 44. See the pretty widgets! (I spy Kendo UI) <input id="schedule" name="schedule" data- role="timepicker" data-bind="value: schedule" value="10:00 AM">
  • 45. Test the form post db.contacts.find() { "_id" : ObjectId("551d79a387ff1b140eb4f663"), "lName" : "Looper", "fName" : "Jen", "email" : "jen.looper@telerik.com", "schedule" : "2015-04-03T22:30:00.000Z", "status" : "", "message" : ”dinner time!", "__v" : 0 } > Query mongo to see data
  • 46. What just happened!? 1. Frontend form gathered data 2. Made ajax call via Kendo UI framework 3. Shaped up the data using Mongoose schema 4. Via Express route, sent data to Mongo, bubbled up message from Express to Frontend 5. Scheduled Mike to come to dinner 6. Dropped mic’ and walked away
  • 47. Trivia question!!! For a prize! What is the name of the company that builds the Node.js add-ons for Visual Studio?
  • 48. Let’s take Mike to Production! Charlie Key Co-Founder, Modulus @Zwigby
  • 49. Thank you! Charlie Key Co-Founder, Modulus @Zwigby Evaluation: http://bit.ly/next-looper-2 Jen Looper Developer Advocate, Telerik @jenlooper