39,59 €
Unlock the power of the MEAN stack by creating attractive and real-world projects
If you are a web developer with a basic understanding of the MEAN stack, experience in developing applications with JavaScript, and basic experience with NoSQL databases, then this book is for you.
The MEAN stack is a combination of the most popular web development frameworks available—MongoDB, Angular, Express, and Node.js used together to offer a powerful and comprehensive full stack web development solution. It is the modern day web dev alternative to the old LAMP stack. It works by allowing AngularJS to handle the front end, and selecting Mongo, Express, and Node to handle the back-end development, which makes increasing sense to forward-thinking web developers. The MEAN stack is great if you want to prototype complex web applications.
This book will enable you to build a better foundation for your AngularJS apps. Each chapter covers a complete, single, advanced end-to-end project. You'll learn how to build complex real-life applications with the MEAN stack and few more advanced projects. You will become familiar with WebSockets and build real-time web applications, as well as create auto-destructing entities. Later, we will combine server-side rendering techniques with a single page application approach. You'll build a fun project and see how to work with monetary data in Mongo. You will also find out how to a build real-time e-commerce application.
By the end of this book, you will be a lot more confident in developing real-time, complex web applications using the MEAN stack.
This book is filled with independent hands-on projects that teach you how to build real-life end-to-end complex web applications using the MEAN stack.
Sie lesen das E-Book in den Legimi-Apps auf:
Seitenzahl: 296
Veröffentlichungsjahr: 2016
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 Onodi has been developing software for close to a decade now. He started working on small applications in Flash, and later moved on to the LAMP stack. For most of his career, he has been working with JavaScript. Having knowledge of both server-side technologies and a passion for JavaScript, he rapidly adopted Node.js in his development stack.
Currently, he works at Evozon, where he shares his dedication for technology and JavaScript with others and develops modern applications using the MEAN stack. Besides his daily programming routine, he is also passionate about mentoring and training.
I rarely have the chance to thank everyone for all their good deeds towards me, probably because we are used to a life lived in fast forward. But this time, I would like to take my time and sincerely thank everyone for their help and support, especially for their trust and sacrifice, making me a better person.
A big thank you to everyone: my family, my loved ones, my friends, my colleagues, everybody at Packt, and all the great people working at Evozon for the support and help they give me each day. There is no greater source of inspiration and motivation in life than doing what you love, with the ones you love.
Dan Shreim has worked as a frontend web developer for over 15 years, specializing in AngularJS, user experience, and interface design. He has worked in conjunction with several award-winning agencies on projects for numerous household-name brands around the world crossing the entertainment, financial, security, and business sectors.
He is currently working as an interface developer for a world-leading cybersecurity company in Boulder, Colorado, USA.
He has worked in Toronto, Canada, designing loyalty platforms; and in London, UK, building prototypes for usability testing.
For more information on Dan, please visit his site at http://snapjay.com.
I'd like to thank Jasper for his compassion and support over the past few years.
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.
https://www2.packtpub.com/books/subscription/packtlib
Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can search, access, and read Packt's entire library of books.
When learning new technologies or even improving our existing skill set, we are always interested in full-fledged applications: how the application is built from the concept phase to an actual running application, what pain points can different technologies solve, and what guidelines we need to follow to ease our development cycle.
Speaking of technologies, probably the most widespread of them all is JavaScript. I think the good and bad part of JavaScript is its popularity. For decades, we have had no technology that is so widely spread and ready to be integrated on different platforms.
Besides running JavaScript in the browser, which we are all so used to, for a few years we can easily run our JS code on the server using Node.js. It does not stop here, as we can start developing powerful IoT projects using only JavaScript.
For many years, we saw a movement of having a single technology that dominates every platform. I think the JavaScript stack, yes stack, at the moment is big game changer. Probably, you are thinking now that it's not that perfect or colorful; yes, I cannot agree more with you, but the evolution is so rapid—and new things are pushed every day, every minute—that we are on the edge of a technological revolution.
Wait! What? Yes, we can be a part of the revolution, we can be trend setters, we can shape the future of the Web, mobile, and IoT (maybe the universe? But of course). We can push the limits and prove that we can do great things, and we can progressively improve ourselves and the people around us.
The idea behind writing this book was to provide a guide and a higher perspective of applications built using the MEAN stack. As I interact with lots of people at the company Evozon, where I'm working, I see a big desire in people to touch and feel how applications are built using different technology stacks.
Especially in popular technologies such as JavaScript, Node.js, and MongoDB. But usually, finding full end-to-end example applications is hard. Don't get me wrong; the Internet is full of great stuff, brilliant people, and so many mind-blowing things, but it is also full of noise and uncertainty, and it's hard to know which path is right or wrong and what should be done in certain scenarios.
That's why we want to showcase different scenarios of building applications using the MEAN stack. Probably it's not the only way of doing things, but it should provide you with a starting point, or give you an insight into how certain parts of an app are built.
This is not a getting started book on Node.js and Angular 2. It will jump right into action and showcase six built-from-the-beginning applications, each with different use cases and solving a high-level problem.
Writing a book takes time, a lot of energy, and a little bit of fear. I've feared that I'll never finish this book. It was a long run, and the funniest part was that the first three chapters were written in an earlier version of AngularJS. Don't worry! Everything is shipped using Angular 2.
As you might have guessed, we had a long run and rewrote everything using the currently-in-beta-release Angular 2. Why? Because, as I told you before, we want to push our limits. We want to grow and master new ways of building modern applications.
I've tried to cover a variety of applications built using the MEAN stack, ranging from a simple contact manager and a real-time chat application to a full auction website.
Chapter 1, Contact Manager, will cover the process of building an introductory application to save your contacts in MondoDB. The chapter will introduce you to TDD (short for Test-Driven Development) for your Node.js application. You will learn how to build an Angular 2 app that will access data from the Express API.
Chapter 2, Expense Tracker, is going to dive deep into working with monetary data in JavaScript and storing this data in MongoDB using the exact precision approach. Also, you are going to learn how to add a token for authentication of each request in the client application by extending the built-in HTTP service in Angular. Besides this, you'll see how to use the aggregation framework from MongoDB and display the result in your Angular application.
Chapter 3, Job Board, will focus on building a more consumer-level application that will enable users to define a custom profile with dynamic data. You will use reactive extensions in Angular to create different communication layers in your application. On the backend, we are going to build a RESTful API using Node.js and set up a boilerplate application from the previously built apps that we are going to use further in the book.
Chapter 4, Chat Application, will start reusing the boilerplate built in the previous chapter. But the most fun part will begin when we create a chat service layer that uses SocketIO. This will enable both the backend and the frontend Angular app to communicate in real time to send messages. The chat service will be built in such a way that it's easily extendable with new modules, besides instant messaging, such as when a user is online or goes offline.
Chapter 5, E-Commerce Application, is going to reflect the ease of storing unstructured data in MongoDB. We'll discuss in detail how to store your product catalog in a NoSQL database. Besides this, our initial architecture from the previous chapters is going to get a new form, and we'll experiment with micro-apps, each with its own responsibility. The micro-apps will use the core e-commerce module that encapsulates all the business logic. Also, this chapter will cover two client apps, one built with a totally different technology, and an admin application using Angular 2.
Chapter 6, Auction Application, is going to be more of an extension of the previous chapter; in other words, it will use the e-commerce API to fetch product information and authenticate users. This will push us not only to reuse existing code but rely on other services for faster prototyping when building products. Also, we are going to dive deeper into RxJs and see how we can build a real-time bidding system in our Angular auction application using SocketIO on the server side.
You will require any modern web browser (such as Chrome's latest version or IE 10+), the Node.js platform installed on your machine, and version 3.2 or higher of MongoDB. Optionally, you can install any web server, such as Nginx, Apache, IIS, or lighttpd, to proxy requests to your Node.js application.
If you are a web developer with a basic understanding of the MEAN stack, experience of developing applications with JavaScript, and basic experience with NoSQL databases, then this book is for you.
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail <[email protected]>, and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
You can download the example code files for this book from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.
You can download the code files by following these steps:
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/MEAN-Blueprints. We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]> with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at <[email protected]>, and we will do our best to address the problem.
