![]()
Table of Contents
MEAN Blueprints
Credits
About the Author
About the Reviewer
www.PacktPub.com
eBooks, discount offers, and more
Why subscribe?
Preface
The idea behind the book
A little bit of twist
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. Contact Manager
Setting up the base application
Folder structure
Server-side package.json
The first application file
Creating the Express configuration file
Setting up mocha for testing
Setting up Mongoose
Managing contacts
Creating the contact mongoose schema
Describing the contact route
Creating a contact
Getting contacts
Getting a contact by ID
Updating a contact
Removing a contact
Running our tests
Implementing the contact routes
Adding all endpoints
Finding a contact by ID
Getting contact information
Updating a contact
Removing a contact
Running the contact test
Securing your application routes
Describing the password helper
Implementing the password helper
Creating the user Mongoose schema
Describing the authentication method from the user model
Implementing the authentication method
Authentication routes
Describing the authentication routes
Integrating Passport
Implementing the authentication routes
Restricting access to contacts routes
Integrating Angular 2 into our application
Granting access to our application
AuthService
User sign-in component
Custom HTTP service
The Contact module
Contact service
Contact component
List contacts component
Creating a contact component
Editing an existing contact
Finishing touch
Summary
2. Expense Tracker
Setting up the base application
Installing the dependencies
Creating the base configuration files
Creating the main server.js file
Setting up the user section
Describing the user model
Implementing the user model
Authenticating users
Describing the authentication strategies
Implementing the token generation
Persisting tokens in MongoDB
Authentication using HTTP Basic
Adding authentication routes
Verifying users using bearer authentication
Bearer strategy
Protecting resources using tokens
Tracking expenses
Monetary values
The category model
Categories routes
Getting the category by ID
Creating a category
Getting one and all categories
Updating and deleting a category
Defining the expense model
Describing the expense module functionality
CRUD operations for expenses
Create expense
Get expense by ID
Get one expense
Get all expenses
Update expense
Delete expense
Getting the expense balance
Implementing the Angular client application
Bootstrapping the project
Registering users
The auth service
Register component
Sign-in-user component
Common functionalities
Custom HTTP service
Using a single export file
The categories module
Category service
The categories component
Create a new category
List all categories
The category component
The expenses module
Expense service
Filter expenses
Add a new expense
List expenses
Display balance
Expenses component
Summary
3. Job Board
Setting up the base application
Modifying the user backend
Modifying the user model
An authorization policy
The company backend module
The company model
The company controller
Creating a company
Getting a company by ID
Getting all companies
Updating a company
Adding a company member
Removing a company member
Company routes
The job backend module
The job model
Job controller
Adding a new job for a company
Finding a job by ID
Getting all jobs
Updating a specific job
Job routes
Getting one and all jobs
Creating a route
Updating a route
Job applications
The application model
Controller logic
Applying for a job
Finding a given application by ID
Getting all job applications
Updating an application
Removing an application from a job
Creating a new company
The company service
Creating a company component
Displaying companies
The job module
The job service
The job base component
The jobs component
The job list component
Job details
Adding new jobs
Company details
User profile
Profile backend
Synchronizing profile data
Editing profile data
The profile block component
Extra models
Summary
4. Chat Application
Setting up the base application
Modifying the user model
The message history data model
The thread schema
The message schema
Thread backend
Thread controller
Defining routes
Message controller
Backend chat service
Chat service implementation
Instant messaging module
Bootstrapping the Angular app
The boot file
App component
Custom data types
User type
Thread type
Message type
Application services
User service
The thread service
The message service
The chat component
The user list component
Displaying threads
Thread component
Thread list component
Messaging
Sending messages
The message component
The message list component
Summary
5. E-commerce Application
Setting up the base application
Data modeling
Custom money data type
The product model
The order model
The inventory model
The core Service Layer
The product catalog
The inventory manager
Shopping cart
The Auth micro app
Defining the class
The controller
Exposing an API
The Api class
Product controller
Product router
Shared resources
The admin section
The admin micro app
Changing the auth module
Products administration
The product service
List products
The main product component
Add and edit a product
Order handling
Retrieving orders
View and update orders
Building the Storefront
Storefront micro app
Storefront pages
Main layout
List products
Summary
6. Auction Application
Setting up the base app
What we are building
Data modeling
Auction
Bidder
Auction backend
The Mediator
Auction manager
Auctioneer
Using the service from controller
Accessing data from the e-commerce API
E-commerce client service
Frontend services
Auction service
The socket service
The bid service
The bidder service
The Auction module
The base component
The auction list
The detail page
The bid module
Listing bids
The bid component
Summary
Index
![]()
Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: May 2016
Production reference: 1240516
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78355-394-5
www.packtpub.com
![]()
Author
Robert Onodi
Reviewer
Dan Shreim
Acquisition Editor
Rahul Nair
Content Development Editor
Mayur Pawanikar
Technical Editor
Vivek Arora
Copy Editor
Vikrant Phadke
Project Coordinator
Nidhi Joshi
Proofreader
Safis Editing
Indexer
Monica Mehta
Graphics
Disha Haria
Production Coordinator
Nilesh Mohite
Cover Work
Nilesh Mohite
![]()
Robert O...