SlideShare a Scribd company logo
#MDBE17
Andrew Morgan
Developing with the modern App
Stack: MEAN and MERN
@andrewmorgan
#MDBE17
Andrew Morgan
Developing with the modern App
Stack: MEAN and MERN + Stitch
@andrewmorgan
#MDBE17
Agenda
Introducing
MEAN &
MERN
JavaScript+ Application
Backend
Node.JS
MongoDB
Express
REST
Application
Frontend
Angular
React
Other
MongoDB
Stitch
1 2 3 4 5
#MDBE17
Why do we care?
• Time to market
• Iteration
• Talent
• Universal access
• Responsive
• Scalable
• Highly Available
• Loosely coupled REST APIs
#MDBE17
The MEAN Stack
#MDBE17
The MEAN Stack
#MDBE17
The MEAN Stack
#MDBE17
The MEAN Stack
#MDBE17
The MEAN Stack (REST API)
#MDBE17
The MEAN Stack
#MDBE17
The MERN Stack
#MDBE17
"JavaScript" & JSON {
"firstName": "Ben",
"lastName": "Dixon",
"country": "UK",
"dependents" : [
{
"name" : "Ben",
"birthday" : "12-Apr-1994"
},
{
"name" : "Erik",
"birthday" : "05-Jul-2005"
}
],
"birthday" : "02-Jul-1964",
"salary" : 50000,
"skills" : [
{
"skill" : "MongoDB"
},
{
"skill" : "Node.js"
}
]
}
ES6
classes
modules
promises
iterators
generators
typed arrays
Typescript
static type checking
JSX
Java
Script
#MDBE17
Resources
• Tutorial:
‒ https://www.mongodb.com/blog/post/the-
modern-application-stack-part-1-
introducing-the-mean-stack
• GitHub Repos:
‒ https://github.com/am-
MongoDB/MongoDB-Mongopop
‒ https://github.com/am-
MongoDB/MongoDB-Mongopop-
ReactJS
‒ https://github.com/am-
MongoDB/MongoDB-Alexa
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
#MDBE17
The MEAN Stack
#MDBE17
Node.js
•JavaScript runtime environment
•Runs application backend code (within Express)
•Built-in features such as HTTP
•Asynchronous
‒ Callback functions
‒ Promises
‒ Observables
•npm package installer & package.json
> npm install mongodb
#MDBE17
#MDBE17
The MEAN Stack
#MDBE17
JBSON & idiomatic drivers
#MDBE17
The MEAN Stack
#MDBE17
Express
•Runs backend (JS) application
•Node.js module
•Terms:
‒ route: relative path to a part of the application
‒ view: templates from which HTML pages are rendered
‒ view engine: middleware to render views
•2 Extremes:
‒ Render entire page in Express
‒ Provide nothing but a REST API to access resources
#MDBE17
Express routes
app.js:
var pop = require('./routes/pop');
app.use('/pop', pop);
routes/pop.js
router.get('/ip', function(req, res, next) {
// Sends a response with the IP address of
// the server running this service.
res.json({"ip": publicIP});
});
#MDBE17
Debugging
npm install -g node-inspector
node-debug ./bin/www
#MDBE17
The MEAN Stack (REST API)
#MDBE17
REST API
•REpresentational State Transfer
•It's how clients talk to app backends
•It's how services talk to services
•HTTP(S)
•METHOD conventions:
‒ GET: Fetches data
‒ POST: Adds new data
‒ PUT: Updates data
‒ DELETE: Removes data
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
#MDBE17
The MEAN Stack
#MDBE17
Angular 2(+)
•Reactive application frontend
•Typescript
•Components & Services
•Data flows down; events back up
•Boilerplate files
•Mobile Apps:
‒ NativeScript, Ionic, or Ionic2
#MDBE17
Component data flow
#MDBE17
index.html:
<script src="systemjs.config.js"></script>
<body>
<my-app>Loading MongoPop client app</my-app>
</body>
app.component.ts:
@Component({
selector: 'my-app',
templateUrl: 'app/app.component.html',
styleUrls: ['stylesheets/style.css']})
onCollection(CollName: string) {
this.MongoDBCollectionName = CollName;}
app.component.html:
<my-add
[dataService]="dataService"
[MongoDBCollectionName]="MongoDBCollectionName"
[MockarooURL]="defaultMockarooURI"
(onCollection)="onCollection($event)">
</my-add>
#MDBE17
add.component.ts:
@Input() dataService: DataService;
@Input() MongoDBCollectionName: string;
@Input() MockarooURL: string;
@Output() onCollection = new
EventEmitter<string>();
// Run when form submitted
this.onCollection.emit(this.MongoDBCollectionName);
add.component.html:
<p>
Collection name:
<input #MongoDBCollName
id="MongoDB-collection-name"
value="{{MongoDBCollectionName}}"/>
</p>
#MDBE17
data.service.ts
#MDBE17
The MERN Stack
#MDBE17
ReactJS
•Reactive application frontend
•JSX
‒ babel
‒ Build optimized package for production
•Components & Services
•Data flows down & events back up
•Boilerplate files (fewer than Angular)
•Mobile Apps:
‒ React Native
#MDBE17
• Components inherit
data as properties
• Components store own
data to be rendered as
state
‒ setState()
• Handler functions
passed down to signal
changes back to
parent
Component data flow
#MDBE17
Execution flow
index.html:
<div id="root"></div>
index.js:
import App from './App';
ReactDOM.render(
<App />,
document.getElementById('root'));
App.js
import { CollectionName } from
'./collection.name.component';
class MongoPopContainer
extends React.Component {
handleCollectionChange(collection) {
this.setState({MongoDBCollectionName:
collection});
}
render() {
return (
<CollectionName
dataService={this.dataService}
onColl={this.handleCollectionChange}
/>
...
)}
}
class App extends Component {
render(){return (
<MongoPopContainer />)}
}
collection.name.component.js:
handleCollectionNameChange(event) {
this.setState({collection:
event.target.value});
this.props.onColl(event.target.value);
}
render() {
return (
<label>
Choose the collection:
<input type="text" size="20"
value={this.state.collection}
onChange={
this.handleCollectionNameChange}
/>
</label>)
}
#MDBE17
Angular 2 vs. ReactJS
#MDBE17
Other REST API clients
#MDBE17
IFTTT + FourSquare
#MDBE17
iOS Workflow App
#MDBE17
Apple Watch
#MDBE17
Amazon Echo
#MDBE17
The MEAN Stack
#MDBE17
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)
#MDBE17
• Developers spend less time on
plumbing code
• Developers focus more on high-
value code that differentiates the
experience delivered by their app.
#MDBE17
Resources
• Tutorial:
‒ https://www.mongodb.com/blog/post/the-
modern-application-stack-part-1-
introducing-the-mean-stack
• GitHub Repos:
‒ https://github.com/am-
MongoDB/MongoDB-Mongopop
‒ https://github.com/am-
MongoDB/MongoDB-Mongopop-
ReactJS
‒ https://github.com/am-
MongoDB/MongoDB-Alexa
Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)

More Related Content

PDF
react redux.pdf
PPTX
Introduction to MERN Stack
PPTX
ASP.NET Lecture 1
PDF
Understanding MicroSERVICE Architecture with Java & Spring Boot
PPTX
Introduction to MERN
PPTX
ReactJS presentation.pptx
PPTX
Introducing MongoDB Atlas
PPTX
Dynatrace
react redux.pdf
Introduction to MERN Stack
ASP.NET Lecture 1
Understanding MicroSERVICE Architecture with Java & Spring Boot
Introduction to MERN
ReactJS presentation.pptx
Introducing MongoDB Atlas
Dynatrace

What's hot (20)

PPTX
What is Cloud Native Explained?
PPTX
Part One: Building Web Apps with the MERN Stack
PPTX
Firebase PPT
PPTX
Ppt full stack developer
PPTX
An introduction to Serverless
PPTX
Introduction To Mobile Application Development
PDF
Introduction to back-end
PPTX
Introduction to React JS
PPTX
[Final] ReactJS presentation
PDF
Monitoring As a Service
PPTX
Firebase
PPTX
Microservices Part 3 Service Mesh and Kafka
PPTX
PPTX
Microservices Architecture & Testing Strategies
PPTX
Backend Programming
PPTX
Front-end development introduction (HTML, CSS). Part 1
PPTX
Introduction to microservices
PDF
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
PDF
What is No-Code/Low-Code App Development and Why Should Your Business Care?
PPTX
Intro to React
What is Cloud Native Explained?
Part One: Building Web Apps with the MERN Stack
Firebase PPT
Ppt full stack developer
An introduction to Serverless
Introduction To Mobile Application Development
Introduction to back-end
Introduction to React JS
[Final] ReactJS presentation
Monitoring As a Service
Firebase
Microservices Part 3 Service Mesh and Kafka
Microservices Architecture & Testing Strategies
Backend Programming
Front-end development introduction (HTML, CSS). Part 1
Introduction to microservices
How to Build Real-time Chat App with Express, ReactJS, and Socket.IO?
What is No-Code/Low-Code App Development and Why Should Your Business Care?
Intro to React
Ad

Viewers also liked (20)

PPTX
Scaling and Transaction Futures
PDF
The Path to Truly Understanding your MongoDB Data
PDF
MongoDB Stitch Introduction
PDF
Building Your Own MongoDB as a Service Offering
PPT
Introduction to MongoDB
PPTX
IOT Paris Seminar 2015 - MAXXING Presentation
PDF
MongoDB y Microservicios Parte 1: Power Microservices con Docker, Kubernetes,...
PDF
Expanding with EDB Postgres Advanced Server 9.5
 
PDF
EDB Postgres with Containers
 
PPTX
Mastering the MongoDB Javascript Shell
PPTX
Jumpstart: MongoDB BI Connector & Tableau
PDF
Getting to Insights Faster with the MongoDB Connector for BI
PPTX
Webinar: What's new in the .NET Driver
PPTX
Using MongoDB with the .Net Framework
KEY
MongoDB Java Development - MongoBoston 2010
PDF
MongoDB@addconf
PDF
Mongodb
PDF
Black Box MongoDB -- Running MongoDB at Scale at Parse
PDF
Invoice 5
ODP
Кратко о MongoDB
Scaling and Transaction Futures
The Path to Truly Understanding your MongoDB Data
MongoDB Stitch Introduction
Building Your Own MongoDB as a Service Offering
Introduction to MongoDB
IOT Paris Seminar 2015 - MAXXING Presentation
MongoDB y Microservicios Parte 1: Power Microservices con Docker, Kubernetes,...
Expanding with EDB Postgres Advanced Server 9.5
 
EDB Postgres with Containers
 
Mastering the MongoDB Javascript Shell
Jumpstart: MongoDB BI Connector & Tableau
Getting to Insights Faster with the MongoDB Connector for BI
Webinar: What's new in the .NET Driver
Using MongoDB with the .Net Framework
MongoDB Java Development - MongoBoston 2010
MongoDB@addconf
Mongodb
Black Box MongoDB -- Running MongoDB at Scale at Parse
Invoice 5
Кратко о MongoDB
Ad

Similar to Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS) (20)

PDF
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
PPTX
Introducing Stitch
PPTX
Tutorial: Building Your First App with MongoDB Stitch
PPTX
Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Application to the Next Level...
PPTX
[MongoDB.local Bengaluru 2018] Introduction to MongoDB Stitch
PPTX
MongoDB Stitch Introduction
PPTX
MongoDB BI Connector & Tableau
PDF
Your App deserves more – The Art of App Modernization
PDF
Your App Deserves More – The Art of App Modernization
PPTX
European SharePoint Conference 2018 - Build an intelligent application by con...
DOCX
Resume Vikram_S
PPTX
Building Your First App with MongoDB Stitch
DOCX
CV - John Adrian N. Delos Santos
PPTX
Share point 2013 apps and i mean it
PPTX
SharePoint Conference 2018 - Build an intelligent application by connecting i...
PDF
CBDW2014 - ColdBox RESTFul Services
PDF
Hilfe, wir brauchen ein Frontend
PDF
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
PDF
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
PPTX
Write better code faster with rest data contracts api strat
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
Introducing Stitch
Tutorial: Building Your First App with MongoDB Stitch
Ch-Ch-Ch-Ch-Changes: Taking Your MongoDB Stitch Application to the Next Level...
[MongoDB.local Bengaluru 2018] Introduction to MongoDB Stitch
MongoDB Stitch Introduction
MongoDB BI Connector & Tableau
Your App deserves more – The Art of App Modernization
Your App Deserves More – The Art of App Modernization
European SharePoint Conference 2018 - Build an intelligent application by con...
Resume Vikram_S
Building Your First App with MongoDB Stitch
CV - John Adrian N. Delos Santos
Share point 2013 apps and i mean it
SharePoint Conference 2018 - Build an intelligent application by connecting i...
CBDW2014 - ColdBox RESTFul Services
Hilfe, wir brauchen ein Frontend
DevOps in the era of serverless computing - Alessandro Vozza - Codemotion Ams...
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
Write better code faster with rest data contracts api strat

More from MongoDB (20)

PDF
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
PDF
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
PDF
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
PDF
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
PDF
MongoDB SoCal 2020: MongoDB Atlas Jump Start
PDF
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
PDF
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
PDF
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
PDF
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
PDF
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
PDF
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
PDF
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
PDF
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
PDF
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
PDF
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
PDF
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
PDF
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
PDF
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Les bonnes pratiques pour sécuriser MongoDB

Developing with the Modern App Stack: MEAN and MERN (with Angular2 and ReactJS)