Free Sample
+ Collection

Web Development with MongoDB and Node.js

Jason Krol

Build an interactive and full-featured web application from scratch using Node.js and MongoDB
RRP $26.99
RRP $44.99
Print + eBook

Want this title & more?

$12.99 p/month

Subscribe to PacktLib

Enjoy full and instant access to over 2000 books and videos – you’ll find everything you need to stay ahead of the curve and make sure you can always get the job done.

Book Details

ISBN 139781783987306
Paperback294 pages

About This Book

  • Configure your development environment to use Node.js and MongoDB
  • Explore the power of development using JavaScript in the full stack of a web application
  • A practical guide with clear instructions to design and develop a complete web application from start to finish

Who This Book Is For

This book is designed for developers of any skill level that 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 requirement for this book.

Table of Contents

Chapter 1: Welcome to JavaScript in the Full Stack
Node.js changed JavaScript forever
The NoSQL movement
Chapter 2: Getting Up and Running
Environment assumptions and requirements
Installing Node.js
Installing the MongoDB server
Writing your first app
Chapter 3: Node and MongoDB Basics
A JavaScript Primer
The basics of NodeJS
Installing modules using npm
The basics of MongoDB
Additional resources
Chapter 4: Writing an Express.js Server
What is Express.js?
Building a complete web application
Organizing the files
Server.js – where it all begins
Configuration module
Routers and controllers
Custom middleware
Migrating to Express v4.0.0
Chapter 5: Dynamic HTML with Handlebars
Basic syntax for Handlebars
Partial views
Handlebars Helpers
Rendering the views
Chapter 6: Controllers and View Models
View models
Updating the home controller
Updating the image controller
Helpers for reusable code
Iterating on the UI
Chapter 7: Persisting Data with MongoDB
Using MongoDB with Node
Introducing Mongoose
Defining the schema and models
Adding CRUD to the controllers
Iterating by adding an image removal capability
Refactoring and improvements
Chapter 8: Creating a RESTful API
What is an API?
What is a RESTful API?
Introducing Postman REST Client
Creating a Basic API server
Responding to GET requests
Receiving data – POST and PUT requests
Removing data – DELETE
Consuming external APIs from Node.js
Chapter 9: Testing Your Code
Tools of the trade
Writing and running your first test
Testing the application
Spy and stub everything!
Chapter 10: Deploying with Cloud-based Services
Cloud versus traditional hosting
Introduction to Git
Deploying your application
Chapter 11: Single Page Applications with Popular Frontend Frameworks
What is a Single Page Application?
Why use a frontend framework?
Frontend development tools
Testing and test-driven development
Chapter 12: Popular Node.js Web Frameworks

What You Will Learn

  • Set up a development environment and install Node.js and MongoDB
  • 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
  • Create and consume RESTful APIs
  • Test your code using automated testing tools
  • Deploy 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

In Detail

Node.js and MongoDB are quickly becoming the most popular technologies in the world of full stack JavaScript development. Powered by Google's V8 JavaScript runtime, Node.js caters to easily building fast, scalable network applications while MongoDB is the perfect fit as a scalable, high-performance, open source NoSQL database solution. Using these two technologies together, web applications can be built quickly and easily and deployed to the cloud with very little difficulty.

This book will enable you to leverage the key features of both MongoDB and Node.js in web and mobile app development. Starting with setting up your development environment, it will guide you through how to write your first Node.js web server application from scratch. Along the way, you will learn about best practices and common mistakes while mastering the core concepts of web development.


Read More