Pro MERN Stack - Vasan Subramanian

Pro MERN Stack

Full Stack Web App Development with Mongo, Express, React, and Node
Buch | Softcover
328 Seiten
2017 | 1st ed.
Apress (Verlag)
978-1-4842-2652-0 (ISBN)
40,65 inkl. MwSt
zur Neuauflage
  • Titel erscheint in neuer Auflage
  • Artikel merken
Zu diesem Artikel existiert eine Nachauflage
Assemble the complete stack required to build a modern web app using React: MongoDB (a NoSQL database) and Express (a framework for web application servers), which runs on Node (JavaScript on the server side), complement React very nicely. This book will also cover many other tools that go into building a complete web application: React Router, React-Bootstrap, Redux, Babel, and webpack.
Though the primary focus of Pro MERN Stack is to equip you with all that is required to build a full-fledged web application, a large portion of the book will be devoted to React.
The popular MEAN (MongoDB, Express, AngularJS, Node) stack introduced Single Page Apps (SPAs) and front-end Model-View-Controller (MVC) as new and efficient paradigms. But it has its shortcomings such as lack of support for SEO friendly server-side rendering and being too prescriptive by being a framework.
Facebook's React is a technology that competes indirectly with AngularJS. It is not a full-fledged MVC framework. It is a JavaScript library for building user interfaces (in some sense the View part). Yet, it is possible to build a web app by replacing AngularJS with React – hence the term MERN stack.

What You Will Learn



Discover the details of React, the React Way, and how to get the maximum out of this library

See the basics of MongoDB, Express, and Node, enough to build a web app

Work with other tools complementary to React, including React-Bootstrap and React Router

Use the tools required to build JavaScript based SPAs

Tie all the components together to build a complete web app.



Who This Book Is For

Developers and architects who have prior experience in any web app stack other than the MERN stack will find the book useful to learn about this modern stack. Prior knowledge of JavaScript, HTML, and CSS is required.

Vasan Subramanian has experienced all kinds of programming, from 8-bit, hand-assembled code on an 8085 to AWS Lambda. He not only loves to solve problems using software, but he also looks for the right mix of technology and processes to make a software product team most efficient. He learned software development at companies such as Corel, Wipro, and Barracuda Networks, not just as a programmer but also as a leader of teams at those companies. Vasan studied at IIT Madras and IIM Bangalore. In his current job as CTO at Accel, he mentors startups on all things tech. While not mentoring or coding (or writing books!), Vasan runs half marathons and plays 5-a-side soccer. He can be contacted at vasan.promern@gmail.com for boquets, brickbats, or anything in-between.

Chapter 1: Why MERN

This is an introductory chapter that discusses the history of React and MERN and why it's suitable for a variety of web apps. One interesting topic that I will be discussing here is why it was created and what problem it tried to solve. This will give great insights into what kind of apps React is most suitable for, and for what kind of apps it will be a misfit.

Chapter 2: Intro to React and Hello World

This chapter starts with installation of some basic components: Node, npm, Express, Babel and React. Then, the first pieces of code is written, which brings up the customary Hello World app. All the code at this point is in React (ie, no server side coding). I introduce the basics of React in this chapter.

Chapter 3: React Components

Here, I'll invent the functional requirements of our sample app that we'll use throughout the book. Then, I'll start off the first important concept of React: components and composition. Using this, we'll build the first cut of the sample app – we'll build the UI to show a list of bugs, a placeholder for a filter to control the list and another placeholder which will become a form to add a bug to the list.

Chapter 4: Data from Server

In this chapter, I will describe how data can be served from the server via APIs. I'll introduce Express and describe how to create REST APIs using Express routes. At the end of this chapter, we'll be serving the data from the server instead of hardcoded data on in our app scripts, and using this data to render our components.

Chapter 5: Using MongoDB to save the data

Here, we'll take data handling to the next level and introduce MongoDB. We'll explore how to save and retrieve data from a MongoDB database via the Mongo shell, and later, via the MongoDB Driver from our app server.

Chapter 6: Build and Bundle using Webpack

When we have many components, it is good to modularize the app. It also becomes essential when we start using third party libraries. In this chapter, I show how the app can be split into modules. To manage the dependencies and create a single bundle containing all the front-end code, we will use a utility called webpack. At the end of this chapter, we have a complete stack and the required development tools all in place. Further chapters will improve our sample app by adding more features, which require other libraries and/or features of each component of the MERN stack.

Chapter 7: Dynamic Components and Interactivity

We'll take Components to the next level in this chapter. I'll cover how to dynamically update components by manipulating state, how to deal with user interaction and finally how to communicate between components. At the end of this chapter, the user will be able to add a record to the list using a form.

Chapter 8: Routing using React Router

Routing is the act of switching between sections of the app using a URL that indicates where we are. In a single page app (SPA) a new URL does not translate to a full page request to the server, the DOM is updated by making lightweight ajax calls. React by itself does not mandate any particular routing mechanism, but fortunately there are other libraries that simplify routing for us. In this chapter, we'll introduce React Router and use that to route between different views in the app.

Chapter 9: Forms and Component Lifecycle

Handling user input via forms the React is a little different from the conventional Javascript / jQuery way. In this chapter we'll explore how user input is captured. We'll explore controlled components and uncontrolled components and which is one is appropriate in which situation. We'll now have proper forms acting as input to adding a new bug, editing an existing one, and setting a new filter.

Chapter 10: Using React Bootstrap

React Bootstrap is an epitome of how to build reusable React components. By using some existing Bootstrap components to give a polished look to our UI, we'll also learn how to build good re-usable components.
Chapter 11: Redux

The Flux architecture simplifies state handling by encapsulating all the state in what's called a Store. Instead of multiple states within each component, the Flux architectural pattern helps us think in terms of a global state. There are many implementations of Flux, we'll choose the Redux implementation and refactor the app.

Chapter 12: Session handling

Any web app will need some authentication and perhaps authorization. In this chapter, I'll introduce sessions in Express, and how to connect a session to say, a Google Authentication sign-on. Now, our app will be protected by only those who we can give access. We'll also be able to restrict who can do what kind of operations in the app.

Chapter 13: Server side rendering

A React based app is not complete till we take advantage of server side rendering. This lets us render entire pages when required, especially for automated search engine bots such as the Google-bot. At the same time, we keep our human users happy by behaving as a single-page app when requests come from a browser.

Chapter 14: Concluding remarks and mern-cli

We'll wrap up and re-cap the important concepts of the previous chapters. This is also an opportunity to introduce mern-cli, a quick way to scaffold and start off a new project.

Erscheinungsdatum
Zusatzinfo 31 Illustrations, color; XVII, 328 p. 31 illus. in color.
Verlagsort Berkley
Sprache englisch
Maße 155 x 235 mm
Gewicht 534 g
Themenwelt Mathematik / Informatik Informatik Programmiersprachen / -werkzeuge
Informatik Software Entwicklung User Interfaces (HCI)
Informatik Theorie / Studium Compilerbau
Mathematik / Informatik Informatik Web / Internet
Schlagworte Express • Express.js • MERN • MERN Stack • mongo • MongoDB • Nodejs • react • Reactjs
ISBN-10 1-4842-2652-6 / 1484226526
ISBN-13 978-1-4842-2652-0 / 9781484226520
Zustand Neuware
Haben Sie eine Frage zum Produkt?
Mehr entdecken
aus dem Bereich
Aus- und Weiterbildung nach iSAQB-Standard zum Certified Professional …

von Mahbouba Gharbi; Arne Koschel; Andreas Rausch; Gernot Starke

Buch | Hardcover (2023)
dpunkt Verlag
34,90
Lean UX und Design Thinking: Teambasierte Entwicklung …

von Toni Steimle; Dieter Wallach

Buch | Hardcover (2022)
dpunkt (Verlag)
34,90
Wissensverarbeitung - Neuronale Netze

von Uwe Lämmel; Jürgen Cleve

Buch | Hardcover (2023)
Carl Hanser (Verlag)
34,99