0%

Book Description

Getting MEAN, Second Edition teaches you how to develop full-stack web applications using the MEAN stack. Practical from the very beginning, the book helps you create a static site in Express and Node. Expanding on that solid foundation, you’ll integrate a MongoDB database, build an API, and add an authentication system. Along the way, you’ll get countless pro tips for building dynamic and responsive data-driven web applications!

Table of Contents

  1. Copyright
  2. Brief Table of Contents
  3. Table of Contents
  4. Praise for the First Edition
  5. Preface
  6. Acknowledgments
  7. About this book
  8. About the authors
  9. About the cover illustration
  10. Part 1. Setting the baseline
    1. Chapter 1. Introducing full-stack development
      1. 1.1. Why learn the full stack?
      2. 1.2. Introducing Node.js: The web server/platform
      3. 1.3. Introducing Express: The framework
      4. 1.4. Introducing MongoDB: The database
      5. 1.5. Introducing Angular: The front-end framework
      6. 1.6. Supporting cast
      7. 1.7. Putting it together with a practical example
      8. Summary
    2. Chapter 2. Designing a MEAN stack architecture
      1. 2.1. A common MEAN stack architecture
      2. 2.2. Looking beyond SPAs
      3. 2.3. Designing a flexible MEAN architecture
      4. 2.4. Planning a real application
      5. 2.5. Breaking the development into stages
      6. 2.6. Hardware architecture
      7. Summary
  11. Part 2. Building a Node web application
    1. Chapter 3. Creating and setting up a MEAN project
      1. 3.1. A brief look at Express, Node, and npm
      2. 3.2. Creating an Express project
      3. 3.3. Modifying Express for MVC
      4. 3.4. Importing Bootstrap for quick, responsive layouts
      5. 3.5. Making it live on Heroku
      6. Summary
    2. Chapter 4. Building a static site with Node and Express
      1. 4.1. Defining the routes in Express
      2. 4.2. Building basic controllers
      3. 4.3. Creating some views
      4. 4.4. Adding the rest of the views
      5. 4.5. Taking the data out of the views and making them smarter
      6. Summary
    3. Chapter 5. Building a data model with MongoDB and Mongoose
      1. 5.1. Connecting the Express application to MongoDB by using Mongoose
      2. 5.2. Why model the data?
      3. 5.3. Defining simple Mongoose schemas
      4. 5.4. Using the MongoDB shell to create a MongoDB database and add data
      5. 5.5. Getting your database live
      6. Summary
    4. Chapter 6. Writing a REST API: Exposing the MongoDB database to the application
      1. 6.1. The rules of a REST API
      2. 6.2. Setting up the API in Express
      3. 6.3. GET methods: Reading data from MongoDB
      4. 6.4. POST methods: Adding data to MongoDB
      5. 6.5. PUT methods: Updating data in MongoDB
      6. 6.6. DELETE method: Deleting data from MongoDB
      7. Summary
    5. Chapter 7. Consuming a REST API: Using an API from inside Express
      1. 7.1. How to call an API from Express
      2. 7.2. Using lists of data from an API: The Loc8r homepage
      3. 7.3. Getting single documents from an API: The Loc8r Details page
      4. 7.4. Adding data to the database via the API: add Loc8r reviews
      5. 7.5. Protecting data integrity with data validation
      6. Summary
  12. Part 3. Adding a dynamic front end with Angular
    1. Chapter 8. Creating an Angular application with TypeScript
      1. 8.1. Getting up and running with Angular
      2. 8.2. Working with Angular components
      3. 8.3. Getting data from an API
      4. 8.4. Putting an Angular application into production
      5. Summary
    2. Chapter 9. Building a single-page application with Angular: Foundations
      1. 9.1. Adding navigation in an Angular SPA
      2. 9.2. Building a modular app using multiple nested components
      3. 9.3. Adding geolocation to find places near you
      4. 9.4. Safely binding HTML content
      5. 9.5. Challenge
      6. Summary
    3. Chapter 10. Building a single-page application with Angular: The next level
      1. 10.1. Working with more-complex views and routing parameters
      2. 10.2. Working with forms and handling submitted data
      3. 10.3. Improving the architecture
      4. 10.4. Using the SPA instead of the server-side application
      5. Summary
  13. Part 4. Managing authentication and user sessions
    1. Chapter 11. Authenticating users, managing sessions, and securing APIs
      1. 11.1. How to approach authentication in the MEAN stack
      2. 11.2. Creating a user schema for MongoDB
      3. 11.3. Creating an authentication API with Passport
      4. 11.4. Securing relevant API endpoints
      5. Summary
    2. Chapter 12. Using an authentication API in Angular applications
      1. 12.1. Creating an Angular authentication service
      2. 12.2. Creating the Register and Login pages
      3. 12.3. Working with authentication in the Angular app
      4. Summary
  14. Appendix A. Installing the stack
    1. Installing Node and npm
    2. Installing Express globally
    3. Installing MongoDB
    4. Installing Angular
  15. Appendix B. Installing and preparing the supporting cast
    1. Twitter Bootstrap
    2. Font Awesome
    3. Installing Git
    4. Installing Docker
    5. Installing a suitable command-line interface
    6. Setting up Heroku
  16. Appendix C. Dealing with all the views
    1. Moving the data from the views to the controllers
    2. Switching from Promises to Observables
  17. Appendix D. Reintroducing JavaScript
    1. Everybody knows JavaScript, right?
    2. Good habits or bad habits
    3. Arrow functions
    4. Destructuring
    5. Logic flow and looping
    6. Getting to know JSON
    7. Formatting practices
    8. String formatting
    9. Understanding callbacks
    10. Promises and async/await
    11. Writing modular JavaScript
    12. Classes
    13. Functional programming concepts
    14. Final thoughts
  18. Data integration differences for various approaches used by Node.js applications
  19. Index
  20. List of Figures
  21. List of Tables
  22. List of Listings
18.118.137.243