About this book

JavaScript has come of age. Building an entire web application from front to back with one language is now possible with JavaScript (even if that JavaScript is TypeScript-flavored). The MEAN stack is comprised of the best-of-breed technologies in this arena. You’ve got MongoDB for the database, Express for the server-side web-application framework, Angular for the client-side framework, and Node for the server-side platform.

This book introduces these technologies and explains how to get them working well together as a stack. Throughout the book, you’ll build a working application, focusing on one technology at a time, seeing how each technology fits into the overall application architecture. Therefore, this is a practical book designed to get you comfortable with all the technologies and using them together.

A common theme running through the book is “best practice.” This book is a springboard to building great things with the MEAN stack, so there’s a focus on creating good habits, doing things the right way, and planning.

This book doesn’t teach HTML, CSS, or basic JavaScript; previous knowledge is assumed. It does include a brief primer on the Twitter Bootstrap CSS framework and an introduction to TypeScript. Also, see appendix D for a good, long discussion on JavaScript theory, best practice, tips, and gotchas; it’s worth checking out early.

Roadmap

This book takes you on a journey through 12 chapters, in four parts.

In part 1, chapter 1 takes a look at the benefits of learning full-stack development and explores the components of the MEAN stack. Chapter 2 builds on this knowledge of the components and discusses options for using them together to build things.

In part 2, chapter 3 gets you going with creating and setting up a MEAN project, getting you acquainted with Express. Chapter 4 provides much deeper understanding of Express. You’ll build a static version of the application. Chapter 5 takes what you’ve learned about the application so far and works with MongoDB and Mongoose to design and build the data model you’ll need. Chapter 6 covers the benefits and processes of creating a data API. You’ll create a REST API by using Express, MongoDB, and Mongoose. Chapter 7 ties this REST API back into the application by consuming it from your static Express application.

In part 3, chapter 8 introduces Angular and TypeScript to the stack. You’ll see how to use them to build components for an existing web page, including calling your REST API to get data. Chapter 9 covers the fundamentals of creating a single-page application (SPA) with Angular, showing how to build a modular, scalable, and maintainable application. Chapter 10 builds on the foundations of chapter 9, developing the SPA further by covering some critical concepts and increasing the complexity of the Angular application.

In part 4, chapter 11 touches every part of the MEAN stack as you add an authentication API to the application, enabling users to register and log in. Chapter 12 builds on the API, consuming it in the Angular application, creating registered-user-only functionality, and detailing additional best practices for SPAs.

About the code

All source code in listings or in the text is in a fixed-width font like this to separate it from ordinary text. Method and function names, properties, JSON elements, and attributes in the text are presented in this same font.

In some cases, the original source code has been reformatted to fit on the pages. In general, the original code was written with page-width limitations in mind, but sometimes, you may find a slight formatting difference between the code in the book and that provided in the source download. In a few rare cases, when we couldn’t reformat long lines without changing their meaning, the book listings contain line-continuation markers ().

Code annotations accompany many of the listings, highlighting important concepts. In many cases, numbered bullets link to explanations that follow in the text.

The source code for the application built throughout the book is available to download at www.manning.com/books/getting-mean-with-mongo-express-angular-and-node-second-edition. It’s also available on GitHub at https://github.com/cliveharber/gettingMean-2.

There’s a separate folder (branch on GitHub) for each stage of the application, typically at the end of a chapter. The folders (or branches) don’t include the node modules folder, as is best practice. To run the application in any of the given folders, you need to install the dependencies by using npm install in the command line. The book covers this instruction and shows why it’s necessary.

liveBook discussion forum

The purchase of Getting MEAN includes free access to a private web forum run by Manning Publications, where you can make comments about the book, ask technical questions, and receive help from the author and from other users. To access the forum, go to https://livebook.manning.com/#!/book/getting-mean-with-mongo-express-angular-and-node-second-edition/discussion. You can also learn more about Manning’s forums and the rules of conduct at https://livebook.manning.com/#!/discussion.

Manning’s commitment to our readers is to provide a venue where a meaningful dialogue between individual readers and between readers and authors can take place. It isn’t a commitment to any specific amount of participation on the part of the authors, whose contributions to the forum remain voluntary (and unpaid). We suggest you try asking them some challenging questions lest their interest stray! The forum and the archives of previous discussions will be accessible from the publisher’s website as long as the book is in print.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.17.20