Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Web Development with MongoDB and Node
Web Development with MongoDB and Node

Web Development with MongoDB and Node: Build fast web applications for handling any kind of data , Third Edition

Arrow left icon
Profile Icon Joseph D'mello Profile Icon Satheesh Profile Icon Jason Krol
Arrow right icon
€32.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
Paperback Sep 2017 330 pages 3rd Edition
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
Arrow left icon
Profile Icon Joseph D'mello Profile Icon Satheesh Profile Icon Jason Krol
Arrow right icon
€32.99
Full star icon Full star icon Full star icon Full star icon Full star icon 5 (1 Ratings)
Paperback Sep 2017 330 pages 3rd Edition
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m
eBook
€17.99 €26.99
Paperback
€32.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

Web Development with MongoDB and Node

Welcome to JavaScript in the Full Stack

What was once only considered a language to add enhancements and widgets to a web page has since evolved into its own fully-fledged ecosystem. As of the survey of year 2017 ( https://insights.stackoverflow.com/survey/2017 ), it stands as the most popular language in terms of usage on stack overflow with around a million questions tagged on it. There are tons of frameworks and environments to make it possible to run JavaScript almost anywhere. I believe Atwood's law says it best:

"Any application that can be written in JavaScript will eventually be written in JavaScript!"

While this quote dates back to 2007, it's never been truer than today. Not only can you use JavaScript to develop a complete single-page application such as Gmail, but you will also see how we can use it to achieve the following projects in the coming chapters of the book:

  • Completely power the backend using Node.js and Express.js
  • Persist data with a powerful document oriented database such as MongoDB
  • Write dynamic HTML pages using Handlebars.js
  • Deploy your entire project to the cloud using services such as Heroku and Amazon Web Services (AWS)

With the introduction of Node.js, JavaScript has officially gone in a direction that was never even possible before. Now, you can use JavaScript on the server and you can also use it to develop full-scale, enterprise-level applications. When you combine this with the power of MongoDB and its JSON-powered data, you can work with JavaScript in every layer of your application.

Let's quickly go through some basic concepts of Node.js and MongoDB, which will help you in following the rest of the chapters in this book.

A short introduction to Node.js

One of the most important things that people get confused about while getting introduced to Node.js is understanding what, exactly, it is. Is it a different language altogether, is it just a framework on top of it, or is it something else? Node.js is definitely not a new language, and it is not just a framework on JavaScript. It can be considered as a runtime environment for JavaScript built on top of Google's V8 engine. So, it provides us with a context where we can write JavaScript code on any platform where Node.js can be installed. Anywhere!

Now, a bit about its history! Back in 2009, Ryan Dahl gave a presentation at JSConf that changed JavaScript forever. During his presentation, he introduced Node.js to the JavaScript community. He concluded it after a roughly 45-minute talk, receiving a standing ovation from the audience in the process. He was inspired to write Node.js after he saw a simple file upload progress bar on Flickr, the image-sharing site. Realizing that the site was going about the whole process the wrong way, he decided that there had to be a better solution.

Now let's go through the features of Node.js, which make it unique from other server-side programming languages.

The advantage that the V8 engine brings in

The V8 engine was developed by Google and was open sourced in 2008. As we all know, JavaScript is an interpreted language and it will not be as efficient as a compiled language, as each line of code gets interpreted one by one while the code gets executed. The V8 engine brings in an efficient model, where the JavaScript code is first interpreted and then compiled into machine-level code.

The new V8 5.9 provides a stable release that introduces TurboFan compiler which provides performance and mass optimization benefits. It also launches Ignition interpreter which is quiet efficient for all the small and big devices like servers or IOT devices etc that varies on memory spectrum. Due to such low memory footprint it delivers fast startup of an application. We can study benchmarks in following link : https://goo.gl/B15xB2

With two powerful updates, the v8 team is also working on Orinoco, which is a garbage collector that works on mechanism of parallel and concurrent compacting.

Such a high performance with promising results was the reason to push the node 8(LTS) launch date from may 2018 to october 2018. Currently we are using node 8 with a non-LTS version. It provides clean replace for users using node v4.x.x and above with no broken library. The version 8 also has various inbuilt features like buffer improvements and inbuilt promisify methods etc. We can study them in following link : https://goo.gl/kMySCS

Node.js is single-threaded!

With the advent of the web, the traditional JavaScript was intended to add simple functionality and minimal runtime in the browser. Thus, JavaScript was kept as a single-threaded scripting language. Now, just to get a brief idea regarding single-threaded model, let's consider the following diagram:

A single-threaded model creates a single Callstack in an execution context. In the preceding code, when the function getData() is invoked, the function is pushed in the stack for execution sequentially.

In the context of Node.js, JavaScript is the base scripting language, hence, Node.js is single-threaded. You might be asking, how does a single-threaded model help? Typical PHP, ASP.NET, Ruby, or Java-based servers follow a model where each client request results in the instantiation of a new thread or even a process.

When it comes to Node.js, requests are run on the same thread with shared resources. A question that is often asked is, what will be the advantage of using such a model? To understand this, we should understand the problem that Node.js tries to resolve. It tries to do asynchronous processing on a single thread to provide more performance and scalability for applications that are supposed to handle too much web traffic. Imagine web applications that handle millions of concurrent requests; if the server makes a new thread for handling each request that comes in, it will consume a lot of resources and we will end up trying to add more and more servers to increase the scalability of the application.

The single-threaded, asynchronous processing model has its advantage in the previous context, and you can process much more concurrent requests with fewer server-side resources. However, there is a downside to this approach; Node (by default) will not utilize the number of CPU cores available on the server it is running on, without using extra modules like pm2.

The point that Node.js is single-threaded doesn't mean that it doesn't use threads internally. It is just that the developer and the execution context that the code has exposure to have no control over the threading model internally used by Node.js.
If you are new to the concept of threads and process, I would suggest you go through some preliminary articles about these topics. There are plenty of YouTube videos on the same topic as well.
The following reference could be used as a starting point:
http://www.cs.ucsb.edu/~rich/class/cs170/notes/IntroThreads/

Non-blocking asynchronous execution

One of the most powerful features of Node.js is that it is both event-driven and asynchronous. So, how does an asynchronous model work? Imagine you have a block of code and at some nth line you have an operation that is time consuming. What happens to the lines that follow the nth line while this code gets executed? In normal synchronous programming models, the lines that follow the nth line will have to wait until the operation at that line completes. An asynchronous model handles this case differently.

Let us visualize this scenario with the help of the following code and diagram:

In the preceding case, the setTimeout() method is provided by JavaScript (Node.js) API. Hence, this method is recognized as synchronous and is executed in a different execution context. According to functionality to setTimeout() , it executes the callback function after a specified duration, in our case after three seconds.

Further, the current execution is never blocked for a process to complete. When Node.js API determines that the completion of an event has been fired, it will execute your callback function at that moment.

In a typical synchronous programming language, executing the preceding code will yield the following output:

If you are still interested in learning more about asynchronous models and the callback concept in JavaScript, Mozilla Developer Network (MDN) has many articles that explain these concepts in detail.

npm - the Node Package Manager

Writing applications with Node.js is really enjoyable when you realize the sheer wealth of information and tools at your disposal! Using Node.js's built-in package manager, npm, you can find literally tens of thousands of modules that can be installed and used within your application with just a few keystrokes! One of the biggest reasons for the success of Node.js is npm, which is one of the best package managers out there, with a very minute learning curve. If this is the first ever package manager that you are getting exposed to, you should consider yourself lucky!

On a regular month, npm handles more than a billion downloads, and it has around 150,000 packages currently available for you to download. You can view the library of available modules by visiting www.npmjs.com. Downloading and installing any module within your application is as simple as executing the following command:

npm install package 

Have you written a module that you want to share with the world? You can package it up using npm and upload it to the public registry at www.npmjs.org just as easily! If you are not sure how a module you installed works, the source code is right there in your project's node_modules/ folder waiting to be explored!

Package versions of modules in npm follow semantic versioning, such as major.minor.patch order.

Sharing and reusing JavaScript

While you develop web applications, you will always end up doing the validations for your UI, both at the client and server sides, as the client-side validations are required for better UI experience and server-side validations are needed for better security of the app. Think about two different languages in action: you will have the same logic implemented in both the server and client sides. With Node.js, you can think of sharing the common function between server and client, reducing the code duplication to a large extent.

Ever worked on optimizing the load time for client-side components of your Single-Page Application (SPA) loaded from template engines such as Underscore? You would end up thinking about a way we could share the rendering of templates in both server and client at the same time; some call it hybrid templating.

Node.js resolves the context of duplication of client templates better than any other server-side technologies, just because we can use the same JS templating framework and the templates both at server and client.

If you are taking this point lightly, the problem it resolves is not just the issue of reusing validations or templates on the server and client. Think about an SPA being built; you will need to implement the subsets of server-side models in the client-side MV* framework also. Now, think about the templates, models, and controller subsets being shared on both client and server. We are solving a higher scenario of code redundancy.

Not just for building web servers!

Node.js is not just to write JavaScript in the server-side. Yes, we have discussed this point earlier. Node.js sets up the environment for the JavaScript code to work anywhere it can be installed. It can be a powerful solution to create command-line tools, as well as fully featured, locally run applications that have nothing to do with the web or a browser. Grunt.js is a great example of a Node-powered command-line tool that many web developers use daily to automate tasks such as build processes, compiling CoffeeScript, launching Node.js servers, running tests, and more.

In addition to command-line tools, Node.js is increasingly popular among the hardware crowd with the Node.js bots movement. Johnny-Five and Cylon.js are two popular Node.js libraries that exist to provide a framework to work with robotics. Just search on YouTube for Node.js robots and you will see a lot of examples. Also, there is a chance that you might be using a text editor developed on Node.js. GitHub's open source editor named Atom, which is hugely popular, is an example.

Real-time web application with Socket.io

One of the important reasons behind the origin of Node.js was to support real-time web applications. Node.js has a couple of frameworks built for real-time web applications which are hugely popular: Socket.io and Sock.JS. These frameworks make it very simple to build instant, collaboration-based applications such as Google Drive and Mozilla's together.js. Before the introduction of WebSockets in the modern browsers, this was achieved via long polling, which was not a great solution for real-time experience. While WebSockets is a feature that is only supported in modern browsers, Socket.io acts as a framework, which also features seamless fallback implementations for legacy browsers.

If you need to understand more on the use of WebSockets in applications, here's a good resource on MDN that you can explore:
https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications.

Networking and file IO

In addition to the powerful non-blocking asynchronous nature of Node.js, it also has robust networking and filesystem tools available via its core modules. With Node.js's networking modules, you can create server and client applications that accept network connections and communicate via streams and pipes. Node contains a module named as fs or filesystem which is totally responsible for all kind of read write operations performed on files. It also takes an advantage of streaming feature of node to perform those operations.

Microservices

Dividing the app with respect to a functionality unit is called a microservice. Each microservice becomes the self contained unit of deployment. Node.js is based on the common JS modules pattern which provides modularity in structure of an application. Such a pattern is used to create the microservices. With the increase of functionality, the number of microservices increases. To manage those services, the Node.js ecosystem provides powerful libraries like pm2. Therefore, it enables the elements of an application to be updated and scaled separately.

Internet of things (IoT)

With the advent of Internet of things (IoT), the Node.JS ecosystem provides amazing library support for various devices like sensors, beacons, wearables, and so on. Node.js is considered as an ideal technology for managing the request made by those devices via its powerful backbone of streams and non-blocking I/O. Popular IoT board variants like Arduino, Raspberry Pi, and so on, have more than 300 Node.js packages. The developers building data-intensive, real-time applications often find Node.js as a natural fit.

A simple server with Node.js

To see an example of how lightweight Node.js can be, let's take a look at some sample code that starts up an HTTP server and sends Hello World to a browser:

var http = require('http');
http.createServer(function(req, res) {
res.writeHead(200, { 'Content-Type': 'text/plain' });
res.end('Hello World\n');
}).listen(8080, 'localhost');
console.log('Server running at http://localhost:8080');

A few basic lines of code are all it takes to write a complete Node.js application. Running it with a simple Node.js app.js command will launch an HTTP server that is listening on port 8080. Point any browser to http://localhost:8080, and you will see the simple output Hello World on your screen! While this sample app doesn't actually do anything useful, it should give you a glimpse of the kind of power you will have while writing web applications using Node.js. If you don't have the initial Node.js development environment set up, we will discuss it in the next chapter.

When to use Node.js

You may have heard of this proverb by an american psychologist, Abraham Maslow:

"If all you have is a hammer, everything looks like a nail!"

This makes a lot of sense in this context. Node.js is not a technology to depend for on all the application problems that you intend to solve, and if not chosen wisely, the decision to use it will backfire. Node.js is well suited for applications that are expected to handle a huge amount of concurrent connections. Also, it should be noted, it is most suited for applications where each incoming request requires very few CPU cycles. This means that if you intend to do computation-intensive tasks upon request, it will end up blocking the event loop, thereby impacting other requests concurrently processed by the web server. Node.js is well suited for real-time web applications, such as chat rooms, collaboration tools, online games, and so on. So, when deciding whether or not to use Node.js, we should analyze the application context seriously and figure out whether Node.js really suits the context of the application.

It is quite hard to debate over the use cases of Node.js in a detailed manner. However, the following Stack Overflow thread does this effectively, and I strongly recommend you to go through the answers on this post if you are more interested in the use cases of Node.js: http://stackoverflow.com/questions/5062614/how-to-decide-when-to-use-node-js.

As we have briefly gone through the concept and features of Node.js, now let's look into the NoSQL and MongoDB side.

The NoSQL movement

Let's start by exploring the answers to the question: What exactly is a NoSQL database? NoSQL is a common term for database technologies that deviate from the traditional Relational Database Management System (RDBMS) concepts. The common reason for these database solutions to deviate from RDBMS database standards is to achieve and set better standards of availability and partitioning capabilities than traditional RDBMS solutions.

To introduce you to this concept, we should have a look at the Brewer's theorem, which is otherwise known as the CAP theorem:

"It is impossible for a distributed computer system to simultaneously provide all three of the following guarantees: Consistency, Availability, and Partition Tolerance."

Traditional RDBMS solutions are good at consistency, but compromise a little once it comes to providing better availability (data reads) and partitioning capabilities. Most of the NoSQL solutions have been evolved in this direction to achieve better heights in data availability and partitioning.

As this is a common term for any database technology that deviates from the concepts followed by RDBMS solutions such as MySQL, PostgreSQL, and so on, there are various subsets for NoSQL databases. Most popular subsets of NoSQL are document stores, key-value stores, and graph-based database solutions. MongoDB, which is the one we are going to try out, falls into the document store category. There are many more NoSQL solutions available in the market apart from MongoDB, such as Cassandra, Redis, Neo4j, HBase, and so on.

A short introduction to MongoDB

As we discussed in the previous paragraph, MongoDB falls into the document store category of NoSQL databases. MongoDB is being actively developed by 10gen, which has been renamed to MongoDB Inc. MongoDB is open source and its source is available on various platforms, such as GitHub.

We will look at the following various features of MongoDB:

  • JSON-friendly database
  • Schema-less design
  • Various performance facets

JSON-friendly database

One of the most important reasons for the popularity of MongoDB is that it is a JSON-friendly database. This means that documents are stored and retrieved from MongoDB as JavaScript objects. Internally, this JSON data gets converted to BSON format while getting persisted to the system. So, this gives extreme flexibility, where we can use the same data format from client to server and eventually to the database.

A typical document (record) in a MongoDB collection (table) might look like the following code:

$ mongo 
> db.contacts.find({email: 'jason@kroltech.com'}).pretty()
{
"email" : "jason@kroltech.com",
"phone" : "123-456-7890",
"gravatar" : "751e957d48e31841ff15d8fa0f1b0acf",
"_id" : ObjectId("52fad824392f58ac2452c992"),
"name" : {
"first" : "Jason",
"last" : "Krol"
},
"__v" : 0
}

After examining the preceding output, we can see a key called _id. It is a MongoDB ID which must be encoded as a binary JSON objectID(BSON). If failed to encode, MongoDB won't be able to retrieve or update an object.

Schema-less design

Another important feature of MongoDB is its schema-less nature. With a relational database, you are required to define the exact structure of the data being stored ahead of time, which is termed as the schema. This means that you must have defined the exact number of columns, the length, and the data type for every field in a table, and that each field must always match that exact set of criteria. Mongo provides a flexible nature where the documents that you store into the database need not follow any schema unless the developer enforces it through the application level. This makes MongoDB a great fit for Agile-based development, as you could carry out modifications on the application schema on the fly.

Various performance facets

Other than the JavaScript-friendly nature, one other resemblance between MongoDB and Node.js is that MongoDB is also designed with highly concurrent applications with heavy read operations in mind.

MongoDB also introduces the concept of sharding, which makes it possible to scale the database horizontally as well as vertically. If the application owner needs to increase the database capabilities, they could add more machines into the stack. This is a cheaper option compared to investing in the RAM of a single machine, which will be the case in RDBMS solutions.

The process of Indexing created a list of values called index for a chosen field. These indexes are used to query larger chunks of data. Using indexes accelerates the data retrieval speed and performance. The MongoDB client provides various methods like ensureIndex to create an index only if one doesn't exist.

Additionally, MongoDB has various commands to allow aggregation of data, such as group, count, and return distinct values.

All the advantages that we discussed come with some impact on the consistency, as MongoDB does not strictly adhere to the RDBMS standards like ACID transactions. Also, if you end up creating a data model that might need too many JOIN operations, then MongoDB won't make a good fit as it is not designed with too many aggregations, even though the aggregations are possible via the MongoDB aggregation framework. MongoDB may or may not be the right solution for your application. You should truly weigh the pros and cons of each technology before making a decision to determine which technology is right for you.

Node.js and MongoDB in the wild

Both Node.js and MongoDB are extremely popular and active in the development community. This is true for enterprises as well. Some of the biggest names in the Fortune 500 space have fully embraced Node.js to power their web applications.
This is due in large part to the asynchronous nature of Node.js, which makes it a great alternative for high traffic, high I/O applications such as e-commerce websites and mobile applications.

Here's just a small list of some big companies that are working with Node.js:

  • PayPal
  • LinkedIn
  • eBay
  • Walmart
  • Yahoo!
  • Microsoft
  • Dow Jones
  • Uber
  • New York Times

MongoDB's use in the enterprise sector is equally as impressive and widespread, with an increasing number of companies adopting the leading NoSQL database server. Here's just a small list of some big companies that are working with MongoDB:

  • Cisco
  • Craigslist Inc.
  • Forbes
  • FourSquare
  • Intuit
  • McAfee
  • MTV
  • MetLife
  • Shutterfly
  • Under Armour

What to expect from this book

The remainder of this book is going to be a guided tour that walks you through the creation of a complete data-driven website. The website we create will feature almost every aspect of a typical large-scale web development project. The app will be developed using a popular Node.js framework called Express, and it will persist data using MongoDB. In the first few chapters, we will cover the groundwork involved in getting the core of the server up and serving content. This includes configuring your environment so you are up and running with Node.js and MongoDB, and a basic introduction to the core concepts of both technologies. Then, we will write a web server powered by ExpressJS from scratch, which will handle serving all of the necessary files for the website. From there, we will work with the Handlebars template engine to serve both static and dynamic HTML web pages. Diving deeper, we will make the application persistent by adding a data layer where the records for the website will be saved and retrieved via a MongoDB server.

We will cover writing a RESTful API so that other people can interact with your application. Finally, we will go into the details to see how to write and execute tests for all of your code. A summary is given in the following section.

Wrapping up, we will take a brief detour as we examine some popular, merging frontend technologies that are becoming increasingly popular while writing SPAs. These technologies include Backbone.js, Angular, and Ember.js.

Last but not least, we will go into detail about how to deploy your new website to the Internet using popular cloud-based hosting services such as Heroku and Amazon Web Services.

Summary

In this chapter, we reviewed what is to be expected throughout the rest of this book. We discussed the amazing current state of JavaScript and how it can be used to power the full stack of a web application. Not that you needed any convincing in the first place, but I hope you're excited and ready to get started writing web applications using Node.js and MongoDB!

Next up, we will set up your development environment and get you up and running with Node.js, MongoDB, and npm, as well as write and launch a quick Node.js app that uses MongoDB!

Left arrow icon Right arrow icon

Key benefits

  • 1. Learn the new ECMAScript along with Node 8 and MongoDB to make your application more effective.
  • 2. Get the up-to-date information required to launch your first application prototype using the latest versions of Node.js and MongoDB.
  • 3. A practical guide with clear instructions to designing and developing a complete web application from start to finish using trending frameworks such as angular4 and hapi

Description

Node.js builds fast, scalable network applications while MongoDB is the perfect fit as a high-performance, open source NoSQL database solution. The combination of these two technologies offers high performance and scalability and helps in building fast, scalable network applications. Together they provide the power for manage any form of data as well as speed of delivery. This book will help you to get these two technologies working together to build web applications quickly and easily, with effortless deployment to the cloud. You will also learn about angular 4, which consumes pure JSON APOIs from a hapi server. The book begins by setting up your development environment, running you through the steps necessary to get the main application server up-and-running. Then you will see how to use Node.js to connect to a MongoDB database and perform data manipulations. From here on, the book will take you through integration with third-party tools to interact with web apps. You will see how to use controllers and view models to generate reusable code that will reduce development time. Toward the end, the book supplies tests to properly execute your code and take your skills to the next level with the most popular frameworks for developing web applications. By the end of the book, you will have a running web application developed with MongoDB, Node.js, and some of the most powerful and popular frameworks.

Who is this book for?

The book is designed for JavaScript developers of any skill level who want to get up-and-running using Node.js and MongoDB to build full-featured web applications. A basic understanding of JavaScript and HTML is the only prerequisite for this book.

What you will learn

  • Work with Node.js building blocks
  • Write and configure a web server using Node.js powered by the Express.js framework
  • Build dynamic HTML pages using the Handlebars template engine
  • Persist application data using MongoDB and Mongoose ODM
  • Test your code using automated testing tools such as the Mocha framework
  • Automate test cases using Gulp
  • Reduce your web development time by integrating third-party tools for web interaction.
  • Deploy a development environment to the cloud using services such as Heroku, Amazon Web Services, and Microsoft Azure
  • Explore single-page application frameworks to take your web applications to the next level
Estimated delivery fee Deliver to Romania

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 29, 2017
Length: 330 pages
Edition : 3rd
Language : English
ISBN-13 : 9781788395083
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Estimated delivery fee Deliver to Romania

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

Product Details

Publication date : Sep 29, 2017
Length: 330 pages
Edition : 3rd
Language : English
ISBN-13 : 9781788395083
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 104.97
Web Development with MongoDB and Node
€32.99
Mastering  Node.js
€41.99
Mastering MongoDB 3.x
€29.99
Total 104.97 Stars icon

Table of Contents

12 Chapters
Welcome to JavaScript in the Full Stack Chevron down icon Chevron up icon
Getting Up and Running Chevron down icon Chevron up icon
Node and MongoDB Basics Chevron down icon Chevron up icon
Introducing Express Chevron down icon Chevron up icon
Templating with Handlebars Chevron down icon Chevron up icon
Controllers and View Models Chevron down icon Chevron up icon
Persisting Data with MongoDB Chevron down icon Chevron up icon
Creating a RESTful API Chevron down icon Chevron up icon
Testing Your Code Chevron down icon Chevron up icon
Deploying with Cloud-Based Services Chevron down icon Chevron up icon
Popular Node.js Web Frameworks Chevron down icon Chevron up icon
Single Page Applications with Popular Frontend Frameworks Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(1 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
D. Wallace Mar 06, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Somewhat dated, but an excellent book. Very well written. Great starter material for a fledgling web developer.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela