SlideShare a Scribd company logo
API Driven Applications
AngularJS, NodeJS and MongoDB
@HmidiHamdi
JSA | JCertif TN
Software Engeneering | ISSATSo
Member & Founder | ISSATSo Google Club
Agenda
- API Driven Application
- Getting started with Angular JS
- Basics Of Node JS
- Discovering MongoDB
API DRIVEN APPLICATION
REST API
REST = Representation State Transfer.
- Client Sends HTTP verbs(GET, POST,
DELETE, PUT) along with a URL and
variable parameters that are unlencoded.
- The URL tells us what object to act on.
- Server Replies with a result code and valid
JSON.
HTTP Verbs - CRUD
- GET : when a client want to read an object.
- POST : when a client want to ceate an
object.
- PUT : when a client want to update an
object.
- DELETE : when a client want to delete an
object.
Why REST API ?
a simple way to create a data service enabling
you to easy create all your other applications:
- HTML5 / JAVASCRIPT.
- ANDROID.
- IOS.
MEAN STACK
M : MongoDB (Most Popular NoSql DataBase).
E : ExpressJS (Web Application Framework).
A : AngularJS (A Robust Framework for
creating HTML5 and Javascript rich web
Applications).
N : NodeJS (Server-side Javascript interpreter).
Our Example :
API  Driven Application - AngulatJS, NodeJS and MongoDB | JCertif Tunisia 2015
●
●
●
●
●
●
●
●
●
<!doctype html>
<html>
<head ng-app >
<title>Exemple 1</title>
<SCRIPT TYPE="text/javascript" src="JS/angular.min.js">
</SCRIPT>
</head>
<body >
<input type="text" ng-model="name" >
<h1>Hello {{name}} </h1>
</body>
</html>
Directives
<html ng-app>
<input type="text" ng-model="name" >
<ng-view > </ng-view>
Model
Controller & $Scope
Events
● ng-click
● ng-hide/ng-show
● ng-dbl-click
● ng-keydown
● ng-keyup
Routing
AJAX
Let’s Drive in
API  Driven Application - AngulatJS, NodeJS and MongoDB | JCertif Tunisia 2015
What is NodeJS ?
● Open Source, Cross-platform runtime
environment for server-side and networking
applications.
● NodeJS provides an Event-Driven
architecture and non-blocking I/O API.
● Run your Javascript on Server.
● Uses V8 Engine.
Hello Node JS
Node Package Manager
Express JS
Uses
app.use(express.static(__dirname + '/Public'));
// set the static files location /public/img will be /img for users
app.use(morgan('dev'));
// log every request to the console
app.use(bodyParser.urlencoded({'extended':'true'}));
// parse application/x-www-form-urlencoded
app.use(bodyParser.json());
// parse application/json
app.use(bodyParser.json({ type: 'application/vnd.api+json' }));
// parse application/vnd.api+json as json
app.use(methodOverride());
Routes
app.get('/todos/:id', function (req, res, next) {
var todo=getTodo(id);
res.json(todo);
});
-------------
app.get('/todos', function (req, res, next) {
var todos= getTodos();
res.json(todos);
});
API  Driven Application - AngulatJS, NodeJS and MongoDB | JCertif Tunisia 2015
What is MongoDB?
MongoDB is an Open-Source document-
oriented NoSQL database. It stores data in
JSON-like format.
Why use MongoDB ?
- SQL databases was invented to store data.
- MongoDB stores documents (or) Objects.
- now-a-days, everyone works with Objects
(Python/Ruby/Java/etc).
- And we need Databases to persist our objects.
- why not store objects directly?
- Embedded documents and arrays reduce need for Join.
MongoDB Tools
● Mongo : MongoDB client as a Javascript
shell.
● MongoImport : import CSV, JSON and TSV
data.
● MongoExport : export data as JSON and
CSV.
NoSQL DataBase Terms:
DataBase : Like other Relational DataBases.
Collection : Like Table in RDBMS(Has no
common Schema).
Document : Like a Record in RDBMS or Row.
Field : Like a RDBMS column {key : value }.
Mongoose CRUD(Create, Read, Update,
Delete)
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/MyApp');
var SpeakerSchema = new mongoose.Schema({
name : String ,
img : String,
detail : String
});
var Speaker = mongoose.model('Speaker',SpeakerSchema);
Create
app.post('/NewSpeaker',function(req,res){
var sp = new Speaker({
name : req.body.nameS,
img : req.body.imgS,
detail: req.body.det
});
sp.save(function(err){
if(err)
console.log(err);
else
res.json(sp);
});
});
Read
app.get('/getSpeakers/:Name',function(req,res){
Speaker.findOne({ name: req.params.Name }, function (err, doc){
if (err){
res.send(err);
}
res.json(doc);
});
});
app.get('/getSpeakers',function(req,res){
Speaker.find(function(err, todos) {
if (err){
res.send(err);
}
res.json(todos); // return all todos in JSON format
});
});
Update
● Model.update(conditions, update, [options],
[callback])
Delete
● Model.remove(conditions, [callback])
app.delete('/DeleteSpeaker/:id',function(req,res){
Speaker.remove({ _id : req.params.id}, function (err) {
if (err) return res.send(err);
res.json({"result":"success"});
});
});
<Coding Time !>
<Thank You!>
Hmidihamdi7@gmail.com
/+ HamdiHmidiigcien
/hamdi.igc

More Related Content

PDF
AngularJS Deep Dives (NYC GDG Apr 2013)
Nitya Narasimhan
 
PDF
API Days Australia - Automatic Testing of (RESTful) API Documentation
Rouven Weßling
 
PPTX
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
Fwdays
 
PDF
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Codemotion
 
PDF
AngularJS with RequireJS
Johannes Weber
 
PDF
Matthew Eernisse, NodeJs, .toster {webdev}
.toster
 
PPTX
Microservices/dropwizard
FKM Naimul Huda, PMP
 
PDF
API Days Paris - Automatic Testing of (RESTful) API Documentation
Rouven Weßling
 
AngularJS Deep Dives (NYC GDG Apr 2013)
Nitya Narasimhan
 
API Days Australia - Automatic Testing of (RESTful) API Documentation
Rouven Weßling
 
Alexey Kupriyanenko "The State of Modern JavaScript and Web in 2020 - Real us...
Fwdays
 
Going fullstack React(ive) - Paulo Lopes - Codemotion Amsterdam 2017
Codemotion
 
AngularJS with RequireJS
Johannes Weber
 
Matthew Eernisse, NodeJs, .toster {webdev}
.toster
 
Microservices/dropwizard
FKM Naimul Huda, PMP
 
API Days Paris - Automatic Testing of (RESTful) API Documentation
Rouven Weßling
 

What's hot (20)

PDF
A real-world Relay application in production - Stefano Masini - Codemotion Am...
Codemotion
 
PDF
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
Shengyou Fan
 
ZIP
Javascript Everywhere From Nose To Tail
Cliffano Subagio
 
PDF
Workshop 13: AngularJS Parte II
Visual Engineering
 
PDF
Redux. From twitter hype to production
FDConf
 
PDF
ReactJS vs AngularJS - Head to Head comparison
500Tech
 
PDF
Abstracting Just Enough
jlongster2
 
PDF
Workshop 15: Ionic framework
Visual Engineering
 
PDF
«От экспериментов с инфраструктурой до внедрения в продакшен»​
FDConf
 
PDF
Redux Universal
Nikolaus Graf
 
PDF
Workshop 25: React Native - Components
Visual Engineering
 
PPTX
AngularJS - Architecture decisions in a large project 
Elad Hirsch
 
PPTX
Frontend technologies
Jose Ramon Roblero Ruiz
 
PDF
From ActiveRecord to EventSourcing
Emanuele DelBono
 
PDF
AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...
AWS Chicago
 
PDF
AtlasCamp 2015: How HipChat ships at the speed of awesome
Atlassian
 
PPTX
Introduction to MongoDB
Chun-Kai Wang
 
PDF
Rails course day 6
Al Sayed Gamal
 
PPTX
A Brief Introduction to React.js
Doug Neiner
 
PDF
Using a simple Ruby program to interface with quickly provisioned cloud appli...
Cloud Elements
 
A real-world Relay application in production - Stefano Masini - Codemotion Am...
Codemotion
 
[Kotlin Serverless 工作坊] 單元 3 - 實作 JSON API
Shengyou Fan
 
Javascript Everywhere From Nose To Tail
Cliffano Subagio
 
Workshop 13: AngularJS Parte II
Visual Engineering
 
Redux. From twitter hype to production
FDConf
 
ReactJS vs AngularJS - Head to Head comparison
500Tech
 
Abstracting Just Enough
jlongster2
 
Workshop 15: Ionic framework
Visual Engineering
 
«От экспериментов с инфраструктурой до внедрения в продакшен»​
FDConf
 
Redux Universal
Nikolaus Graf
 
Workshop 25: React Native - Components
Visual Engineering
 
AngularJS - Architecture decisions in a large project 
Elad Hirsch
 
Frontend technologies
Jose Ramon Roblero Ruiz
 
From ActiveRecord to EventSourcing
Emanuele DelBono
 
AWS user group September 2017 - Rob Ribeiro "Seeking Solutions for Debugging ...
AWS Chicago
 
AtlasCamp 2015: How HipChat ships at the speed of awesome
Atlassian
 
Introduction to MongoDB
Chun-Kai Wang
 
Rails course day 6
Al Sayed Gamal
 
A Brief Introduction to React.js
Doug Neiner
 
Using a simple Ruby program to interface with quickly provisioned cloud appli...
Cloud Elements
 
Ad

Viewers also liked (20)

PPTX
Cosa ci dicono le particelle "strane"?
chreact
 
PDF
wordpress-based-non-profit-website-redesign-project-by-digital-systems
Digital Systems
 
PPTX
Colors and M
denegri77
 
PPTX
An adventure on the red planet
chreact
 
PPTX
Esperimento 1
chreact
 
PDF
prestashop-time-log
Digital Systems
 
PPTX
Pannello solare 2B Iervolino
chreact
 
PPTX
Юлия Федорова, Хорошая программа продает сама себя
lashkova
 
PPT
The powerofgreenlight
chreact
 
PPTX
Vulcanizziamoci
chreact
 
PDF
CSS2inCanWestGlobalTemplates
Digital Systems
 
PPT
Radici nello spazio
chreact
 
PPTX
ET chiama Terra
chreact
 
PPTX
новые медиа и создание информационного поля мероприятия
lashkova
 
PPT
Проектирование мероприятий. Лариса Малышева для I_Love_Events.conf
lashkova
 
PPTX
Letter a new program pp
denegri77
 
PPT
Cretaceo 2.0?
chreact
 
PPTX
l calore del colore
chreact
 
PDF
Cubiertas & Fachadas
Jessica Forero
 
PPTX
THE FRUITS
denegri77
 
Cosa ci dicono le particelle "strane"?
chreact
 
wordpress-based-non-profit-website-redesign-project-by-digital-systems
Digital Systems
 
Colors and M
denegri77
 
An adventure on the red planet
chreact
 
Esperimento 1
chreact
 
prestashop-time-log
Digital Systems
 
Pannello solare 2B Iervolino
chreact
 
Юлия Федорова, Хорошая программа продает сама себя
lashkova
 
The powerofgreenlight
chreact
 
Vulcanizziamoci
chreact
 
CSS2inCanWestGlobalTemplates
Digital Systems
 
Radici nello spazio
chreact
 
ET chiama Terra
chreact
 
новые медиа и создание информационного поля мероприятия
lashkova
 
Проектирование мероприятий. Лариса Малышева для I_Love_Events.conf
lashkova
 
Letter a new program pp
denegri77
 
Cretaceo 2.0?
chreact
 
l calore del colore
chreact
 
Cubiertas & Fachadas
Jessica Forero
 
THE FRUITS
denegri77
 
Ad

Similar to API Driven Application - AngulatJS, NodeJS and MongoDB | JCertif Tunisia 2015 (20)

PDF
Getting started with node JS
Hamdi Hmidi
 
PPTX
Node js crash course session 5
Abdul Rahman Masri Attal
 
PPTX
Unit IV database intergration with node js
Rahul Borate
 
PDF
Basic API Creation with Node.JS
Azilen Technologies Pvt. Ltd.
 
PDF
Backend Basic in nodejs express and mongodb PPT.pdf
sadityaraj353
 
PPTX
MEAN.js Workshop
Michael Haberman
 
PDF
Introduction to REST API with Node.js
Yoann Gotthilf
 
PDF
Writing RESTful web services using Node.js
FDConf
 
PPTX
FULL stack -> MEAN stack
Ashok Raj
 
PPTX
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
Hariharan Ganesan
 
PPTX
Node js Introduction
sanskriti agarwal
 
PPTX
mern _stack _power _point_ presentation(1)
susmithalanka2
 
PDF
Download full ebook of Mean Web Development 2nd Amos Q Haviv instant download...
eilkfbiznc943
 
PDF
Beginning MEAN Stack
Rob Davarnia
 
PPTX
Create Rest API in Nodejs
Irfan Maulana
 
PDF
Node Js, AngularJs and Express Js Tutorial
PHP Support
 
PDF
Developing and Testing a MongoDB and Node.js REST API
All Things Open
 
PDF
TDD a REST API With Node.js and MongoDB
Valeri Karpov
 
PDF
Thu 1500 lacoul_shamod_color
DATAVERSITY
 
Getting started with node JS
Hamdi Hmidi
 
Node js crash course session 5
Abdul Rahman Masri Attal
 
Unit IV database intergration with node js
Rahul Borate
 
Basic API Creation with Node.JS
Azilen Technologies Pvt. Ltd.
 
Backend Basic in nodejs express and mongodb PPT.pdf
sadityaraj353
 
MEAN.js Workshop
Michael Haberman
 
Introduction to REST API with Node.js
Yoann Gotthilf
 
Writing RESTful web services using Node.js
FDConf
 
FULL stack -> MEAN stack
Ashok Raj
 
MEAN Stack - Introduction & Advantages - Why should you switch to MEAN stack ...
Hariharan Ganesan
 
Node js Introduction
sanskriti agarwal
 
mern _stack _power _point_ presentation(1)
susmithalanka2
 
Download full ebook of Mean Web Development 2nd Amos Q Haviv instant download...
eilkfbiznc943
 
Beginning MEAN Stack
Rob Davarnia
 
Create Rest API in Nodejs
Irfan Maulana
 
Node Js, AngularJs and Express Js Tutorial
PHP Support
 
Developing and Testing a MongoDB and Node.js REST API
All Things Open
 
TDD a REST API With Node.js and MongoDB
Valeri Karpov
 
Thu 1500 lacoul_shamod_color
DATAVERSITY
 

More from Hamdi Hmidi (12)

PDF
Ng init | EPI Sousse
Hamdi Hmidi
 
PDF
Pentaho | Data Integration & Report designer
Hamdi Hmidi
 
PDF
Ng init
Hamdi Hmidi
 
PDF
Javascript - Getting started | DevCom ISITCom
Hamdi Hmidi
 
PDF
Modern web application devlopment workflow
Hamdi Hmidi
 
PDF
Les Basiques - Web Développement HTML5, CSS3, JS et PHP
Hamdi Hmidi
 
PDF
Hybrid Mobile Apps | Ionic & AngularJS
Hamdi Hmidi
 
PDF
Ng-init
Hamdi Hmidi
 
PDF
Ng-init
Hamdi Hmidi
 
PDF
Twitter bootstrap | JCertif Tunisie
Hamdi Hmidi
 
PDF
Android initiation
Hamdi Hmidi
 
PPTX
Les Fondamentaux D'Angular JS | Hmidi Hamdi
Hamdi Hmidi
 
Ng init | EPI Sousse
Hamdi Hmidi
 
Pentaho | Data Integration & Report designer
Hamdi Hmidi
 
Ng init
Hamdi Hmidi
 
Javascript - Getting started | DevCom ISITCom
Hamdi Hmidi
 
Modern web application devlopment workflow
Hamdi Hmidi
 
Les Basiques - Web Développement HTML5, CSS3, JS et PHP
Hamdi Hmidi
 
Hybrid Mobile Apps | Ionic & AngularJS
Hamdi Hmidi
 
Ng-init
Hamdi Hmidi
 
Ng-init
Hamdi Hmidi
 
Twitter bootstrap | JCertif Tunisie
Hamdi Hmidi
 
Android initiation
Hamdi Hmidi
 
Les Fondamentaux D'Angular JS | Hmidi Hamdi
Hamdi Hmidi
 

Recently uploaded (20)

PDF
Zero carbon Building Design Guidelines V4
BassemOsman1
 
PPTX
Introduction of deep learning in cse.pptx
fizarcse
 
PPTX
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PDF
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
PDF
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
PPT
Ppt for engineering students application on field effect
lakshmi.ec
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PDF
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
PPTX
easa module 3 funtamental electronics.pptx
tryanothert7
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PDF
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
PDF
Software Testing Tools - names and explanation
shruti533256
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PDF
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
PPTX
Information Retrieval and Extraction - Module 7
premSankar19
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PPTX
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Zero carbon Building Design Guidelines V4
BassemOsman1
 
Introduction of deep learning in cse.pptx
fizarcse
 
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
Biodegradable Plastics: Innovations and Market Potential (www.kiu.ac.ug)
publication11
 
July 2025: Top 10 Read Articles Advanced Information Technology
ijait
 
Ppt for engineering students application on field effect
lakshmi.ec
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
Advanced LangChain & RAG: Building a Financial AI Assistant with Real-Time Data
Soufiane Sejjari
 
easa module 3 funtamental electronics.pptx
tryanothert7
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
The Effect of Artifact Removal from EEG Signals on the Detection of Epileptic...
Partho Prosad
 
Software Testing Tools - names and explanation
shruti533256
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
Information Retrieval and Extraction - Module 7
premSankar19
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
AgentX UiPath Community Webinar series - Delhi
RohitRadhakrishnan8
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 

API Driven Application - AngulatJS, NodeJS and MongoDB | JCertif Tunisia 2015