Mastering JavaScript Single Page Application Development
eBook - ePub

Mastering JavaScript Single Page Application Development

Philip Klauzinski, John Moore

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

Mastering JavaScript Single Page Application Development

Philip Klauzinski, John Moore

Book details
Book preview
Table of contents
Citations

About This Book

An in-depth guide to exploring the design, architecture, and techniques behind building sophisticated, scalable, and maintainable single-page applications in JavaScript

About This Book

  • Build large-scale, feature-complete SPAs by leveraging widely used tools and techniques.
  • Gain a solid understanding of architecture and SPA design to build applications using the library or framework of your choice.
  • Explore the various facets of SPA development to build web apps that are fast, scalable, and easy to test.

Who This Book Is For

This book is ideal for JavaScript developers who want to build complex single-page applications in JavaScript. Some basic understanding of SPA concepts will be helpful but not essential.

What You Will Learn

  • Organize your development environment using the command line with NPM, Bower, and Grunt.
  • Choose an accurate design pattern for your app
  • Understand modular JavaScript programming and Node.js
  • Interact with a REST API using JavaScript and AJAX with practical examples
  • Build a single page application using the MEAN stack
  • Connect your app across popular social media platforms such as Facebook, Twitter, and LinkedIn
  • Test your app, both on the server side and in views
  • Prepare your app for the real world and deploy it to Heroku

In Detail

Single-page web applicationsā€”or SPAs, as they are commonly referred toā€”are quickly becoming the de facto standard for web app development. The fact that a major part of the app runs inside a single web page makes it very interesting and appealing. Also, the accelerated growth of browser capabilities is pushing us closer to the day when all apps will run entirely in the browser.

This book will take your JavaScript development skills to the next level by teaching you to create a single-page application within a full-stack JavaScript environment. Using only JavaScript, you can go from being a front-end developer to a full-stack application developer with relative ease.

You will learn to cross the boundary from front-end development to server-side development through the use of JavaScript on both ends. Use your existing knowledge of JavaScript by learning to manage a JSON document data store with MongoDB, writing a JavaScript powered REST API with Node.js and Express, and designing a front-end powered by AngularJS.

This book will teach you to leverage the MEAN stack to do everything from document database design, routing REST web API requests, data-binding within views, and adding authentication and security to building a full-fledged, complex, single-page web application.

In addition to building a full-stack JavaScript app, you will learn to test it with JavaScript-powered testing tools such as Mocha, Karma, and Jasmine. Finally, you will learn about deployment and scaling so that you can launch your own apps into the real world.

Style and approach

Following a structured approach, this book helps readers gain expertise in SPA development. Its thorough coverage of SPA architecture and design, along with practical use cases, provides readers with a clear path to building applications with the library of their choice. For readers who are afraid to take the plunge straightaway, the book also offers step-by-step guidance on developing a complex web app.

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 Mastering JavaScript Single Page Application Development an online PDF/ePUB?
Yes, you can access Mastering JavaScript Single Page Application Development by Philip Klauzinski, John Moore in PDF and/or ePUB format, as well as other popular books in Computer Science & Web Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2016
ISBN
9781785881640
Edition
1

Mastering JavaScript Single Page Application Development


Mastering JavaScript Single Page Application Development

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 authors, 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: October 2016
Production reference: 1241016
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78588-164-0
www.packtpub.com

Credits

Authors
Philip Klauzinski
John Moore
Copy Editor
Safis Editing
Reviewers
Ciro Artigot
Project Coordinator
Ritika Manoj
Commissioning Editor
Wilson D'souza
Proofreader
Safis Editing
Acquisition Editor
Reshma Raman
Indexer
Rekha Nair
Content Development Editor
Divij Kotian
Graphics
Jason Monteiro
Technical Editor
Sachit Bedi
Production Coordinator
Aparna Bhagat

About the Authors

Philip Klauzinski is a senior frontend developer specializing in JavaScript Single Page Application (SPA) development. He has over 20 years of experience in web design and web development and is a leading expert in web application development, client-side JavaScript, and Search Engine Optimization (SEO). Philip has worked as a frontend developer across multiple industries, including consumer e-commerce, business-to-business e-commerce, big data, Web hosting, direct marketing, domain name services (DNS), and manufacturing.
I would like to thank my Mom and Dad for always stressing the importance of education in my life, not just institutional education, but more importantly, the pursuance of self-education. My own interest in technology and software from a young age has driven my subsequent, self-taught approach to my career. As a result, I love what I do for a living, and I have been able to shape my professional life around the things in which I am truly interested. I am inherently driven to learn more every day, and I believe that is what has led to my success. Thank you, Mom and Dad!
John Moore has been working in web development for 20 years. He is an industry expert in JavaScript and HTML5. He has developed award-winning web applications and worked and consulted for Digital Equipment Corporation, Ernst & Young, Wachovia Bank, and Fidelity Investments. Having focused his early career on frontend web development, he helped usher in responsive web design and Single Page Applications in his roles in development and architecture. Most recently, he led Full Stack development in JavaScript, serving as CTO of a Maine-based startup company.
I would like to thank my wife, Dr. Myra Salapare, and daughters, Mila Moore and Sophia Moore, for all of their support. I would also like to thank Andrea Shiflet, Erin Benner, and Lauren Grousd for their tremendous help.

About the Reviewer

Ciro Artigot is currently working as an IT manager at ECODES, an Spanish foundation that works for the welfare of all people within the limits of our planet.
He has developed websites for over 15 years. He is a Full Stack developer and CMS expert and is addicted to Joomla, He has worked for 10 years in open source GNU projects, mainly in LAMP .
For the last few years, he has been investigating and working with SPA in MEAN environments.
I would like to thank Pampa, Diego,and Hugo, for giving me the time to review this book, and my parents and brothers, for making it possible for me to devote myself to what I like bestā€”develop

www.PacktPub.com

For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
www.PacktPub.com
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.

Why subscribe?

  • Fully searchable across every book published by Packt
  • Copy and paste, print, and bookmark content
  • On demand and accessible via a web browser

Preface

Created in 1995 by Brendan Eich of Netscape, JavaScript has gone from being a toy scripting language used only in browsers to being one of the most popular languages in the world for full-stack development. With the introduction of Node.js, built on top of Chromeā€™s V8 JavaScript Engine, developers are now able to build powerful and performant applications using JavaScript. With the addition of MongoDB, a modern NoSQL database, applications can utilize JavaScript at every tier.
Many popular web applications are implemented, partially or in whole, as single-page applications, or SPAs. With SPAs, users load a single web page, and that page is updated dynamically in response to user interaction or incoming server data. The advantage is an application experience that is smoother, replicates native application interaction, and may require less network traffic and server load.
The MEAN stack is a set of JavaScript tools representing a full stack, from database to runtime environment, application framework, and frontend. This book provides a thorough background in building SPAs using the MEAN stack and other tools in the JavaScript ecosystem. It covers the basics of SPA architecture and JavaScript tools. The book then expands to more advanced topics, such as building, securing, and deploying an SPA built with the MEAN stack.

What this book covers

Chapter 1, Getting Organized NPM, Bower, and Grunt, introduces JavaScript frontend package-management, build, and task-running tools. These tools form the foundation for you to set up an ideal development environment.
Chapter 2, Model-View-Whatever, goes beyond the original MVC design pattern and explores its translation into frontend frameworks and its evolution into Model-View-*, or Model-View-Whatever (MVW), in which the Controller layer is more open ended and often abstracted into other layers more suited to an SPA environment.
Chapter 3, SPA Essentials - Creating the Ideal Application Environment, introduces you to the common components/layers of an SPA, the best practices and variations around these components, and how to put them together and lay the groundwork for a modern SPA.
Chapter 4, REST is Best - Interacting with the Server Side of Your Application, goes into further detail about the server side of SPA architectureā€”in particular, with regard to the REST (representational state t...

Table of contents