MEAN Web Development - Second Edition
eBook - ePub

MEAN Web Development - Second Edition

Amos Q. Haviv

Share book
  1. 368 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

MEAN Web Development - Second Edition

Amos Q. Haviv

Book details
Book preview
Table of contents
Citations

About This Book

Develop your real-time MEAN application efficiently using a combination of MongoDB, Express, Angular, and NodeAbout This Book• Construct a fully-functional MEAN application by using its components along with the best third-party modules• Harness the power of the JavaScript ecosystem to effectively run, build, and test your MEAN application• Gain a deep, practical understanding of real-time web application development through real-world examplesWho This Book Is ForIf you are a JavaScript developer who is interested in building modern web applications using MongoDB, Express, Angular 2, and Node 5.0, then this book is for you. You only need knowledge of JavaScript development.What You Will Learn• Use MongoDB to store and retrieve your application's data• Connect your Express application to MongoDB and use the Mongoose module• Manage your users' authentication and offer them diverse login options using Passport• Structure and use an Angular 2 application in your MEAN project• Use Socket.io to create real-time communication between your client and server• Test your application's Express and Angular 2 entitiesIn DetailThe MEAN stack is a collection of the most popular modern tools for web development that helps you build fast, robust, and maintainable web applications.Starting with the MEAN core frameworks, this pragmatic guide will explain the key concepts of each framework, how to set them up properly, and how to use popular modules to connect it all together. By following the real-world examples shown in this tutorial, you will scaffold your MEAN application architecture, add an authentication layer, and develop an MVC structure to support your project development. You will learn the best practices of maintaining clear and simple code and will see how to avoid common pitfalls. Finally, you will walk through the different tools and frameworks that will help expedite your daily development cycles.Watch how your application development grows by learning from the only guide that is solely orientated towards building a full, end-to-end, real-time application using the MEAN stack!Style and approachThis comprehensive guide covers every part of the MEAN stack, and focuses on the gestalt power of the apps they can create through practical, real-world examples

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is MEAN Web Development - Second Edition an online PDF/ePUB?
Yes, you can access MEAN Web Development - Second Edition by Amos Q. Haviv in PDF and/or ePUB format, as well as other popular books in Informatica & Programmazione web. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785883675
Edition
2

MEAN Web Development Second Edition


Table of Contents

MEAN Web Development Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Introduction to MEAN
Three-tier web application development
The evolution of JavaScript
Introduction to ECMAScript 2015
Modules
Classes
Arrow functions
Let and Const
Default, Rest, and Spread
Summary
Introducing MEAN
Installing MongoDB
Installing MongoDB on Windows
Running MongoDB manually
Running MongoDB as a Windows service
Installing MongoDB on Mac OS X and Linux
Installing MongoDB from binaries
Installing MongoDB using a package manager
Using the MongoDB shell
Installing Node.js
Installing Node.js on Windows
Installing Node.js on Mac OS X
Installing Node.js on Linux
Running Node.js
Introducing npm
Using npm
The installation process of npm
Installing a package using npm
Removing a package using npm
Updating a package using npm
Managing dependencies using the package.json file
Creating a package.json file
Installing the package.json dependencies
Updating the package.json file
Summary
2. Getting Started with Node.js
Introduction to Node.js
io.js and the Node.js foundation
Node.js ES6 support
Node.js LTS support
JavaScript event-driven programming
Node.js event-driven programming
JavaScript Closures
Node modules
CommonJS modules
Node.js core modules
Node.js third-party modules
Node.js file modules
Node.js folder modules
Developing Node.js web applications
Meet the Connect module
Connect middleware
Understanding the order of Connect middleware
Mounting Connect middleware
Summary
3. Building an Express Web Application
Introducing Express
Installing Express
Creating your first Express application
The application, request, and response objects
The application object
The request object
The response object
External middleware
Implementing the MVC pattern
The application folder structure
Horizontal folder structure
Vertical folder structure
File-naming conventions
Implementing the horizontal folder structure
Handling request routing
Adding the routing file
Configuring an Express application
Environment configuration files
Rendering views
Configuring the view system
Rendering EJS views
Serving static files
Configuring sessions
Summary
4. Introduction to MongoDB
Introduction to NoSQL
Introducing MongoDB
Key features of MongoDB
The BSON format
MongoDB ad hoc queries
MongoDB indexing
MongoDB replica set
MongoDB sharding
MongoDB 3.0
MongoDB shell
MongoDB databases
MongoDB collections
MongoDB CRUD operations
Creating a new document
Creating a document using insert()
Creating a document using update()
Creating a document using save()
Reading documents
Finding all the collection documents
Using an equality statement
Using query operators
Building AND/OR queries
Updating existing documents
Updating documents using update()
Updating documents using save()
Deleting documents
Deleting all documents
Deleting multiple documents
Deleting a single document
Summary
5. Introduction to Mongoose
Introducing Mongoose
Installing Mongoose
Connecting to MongoDB
Understanding Mongoose schemas
Creating the user schema and model
Registering the User model
Creating new users using save()
Finding multiple user documents using find()
Advanced querying using find()
Reading a single user document using findOne()
Updating an existing user document
Deleting an existing user document
Extending your Mongoose schema
Defining default values
Using schema modifiers
Predefined modifiers
Custom setter modifiers
Custom getter modifiers
Adding virtual attributes
Optimizing queries using indexes
Defining custom model methods
Defining custom static methods
Defining custom instance methods
Model validation
Predefined validators
Custom validators
Using Mongoose middleware
Using pre middleware
Using post middleware
Using Mongoose ref fields
Summary
6. Managing User Authentication Using Passport
Introducing Passport
Installing Passport
Configuring Passport
Understanding Passport strategies
Using Passport's local strategy
Installing Passport's local strategy module
Configuring Passport's local strategy
Adapting the User model
Creating the authentication views
Modifying the Users controller
Displaying flash error messages
Installing the Connect-Flash module
Configuring Connect-Flash module
Using Connect-Flash module
Wiring the user's routes
Understanding Passport OAuth strategies
Setting up OAuth strategies
Handling OAuth user creation
Using Passport's Facebook strategy
Installing Passport's Facebook strategy
Configuring Passport's Facebook strategy
Wiring Passport's Facebook strategy routes
Using Passport's Twitter strategy
Installing Passport's Twitter strategy
Configuring Passport's Twitter strategy
Wiring Passport's Twitter strategy routes
Using Passport's Google strategy
Installing Passport's Google strategy
Configuring Passport's Google strategy
Wiring Passport's Google strategy routes
Summary
7. Introduction to Angular
Introducing Angular 2
From Angular 1.x to Angular 2.x
Introduction to TypeScript
Types
Basic types
The any type
Interfaces
Decorators
Summary
Angular 2 Architecture
Angular 2 Modules
Angular 2 Components
Angular 2 Templates
Angular 2 data binding
Interpolation binding
Property binding
Event binding
Two-way binding
Angular 2 Directives
Attribute directives
Structural directives
Component directives
Angular 2 Services
Angular 2 Dependency Injection
Using Dependency Injection in Angular 2
Angular 2 Routing
Setup
Routes
Router outlet
Router links
Summary
The project setup
Configuring TypeScript
Configuring Express
Restructuring the application
Creating the application module
Creating the application component
Bootstrapping the application module
Starting your Angular application
Managing authentication
Rendering the user object
Modifying the users' server controller
Creating the authentication module
Creating the authentication component
Configuring the authentication routes
Creating the signin component
Creating the signup component
Creating the authentication service
Creating the home module
Creating the home component
Configuring the home routes
Refactoring the application module
Configuring the application routes
Summary
8. Creating a MEAN CRUD Module
Introducing CRUD modules
Setting up the Express components
Creating the Mongoose model
Setting up the Express controller
The error handling method of the Express controller
The create() method of the Express controller
The list() method of the Express cont...

Table of contents