I'm working on the book full-time, and would love to solicit some early feedback from interested readers. Sign up for the book announcement mailing list (no spam, ever) and I'll send you the 39 page introduction and first chapter in PDF format.
I've been a professional web developer for the past 18 years or so, having built my first commercial website back in 1997. It has been incredibly exciting to watch the web evolve so dramatically over the course of the past two decades, transforming from a mere curiosity to a medium so indispensable to business and life. It has also been challenging, because this rapid pace of change has meant constantly evaluating new technologies and occasionally putting a few of them to good use for both myself and my clients. For the most part I believe I've succeeded at this challenge, having built dozens of solutions using a laundry list of powerful languages, databases, and frameworks.
Above all, this calculated limitation of scope suggests simplicity. Having struggled with technologies that seem to embrace anything but simplicity, this is in my mind precisely what makes React such an attractive technology. You can integrate a simple React-driven widget (known as elements and components in React lingo; more about this in the next chapter) into an existing web application literally within minutes, and then introduce additional components and other more advanced features as you desire.
So what else does React have to offer besides simplicity? I'll summarize a few other key features here:
We'll spend the first four chapters of this book focused almost exclusively on React-specific concepts and features before devoting the rest of the book to explaining how React works in conjunction with other powerful technologies such as the Express web application framework and the MongoDB database.
Don't worry if you're not familiar with technologies such as Node.js or Express (although it helps) as each respective chapter includes an introduction intended to get you up and running as quickly as possible.
This book is organized into nine chapters, each of which is briefly described below.
In this opening chapter you'll learn all about React fundamentals. Among other topics we'll get acquainted with JSX, creating composable components, working with props and state, responding to user input, and loading JSON. You'll also learn all about React's various component lifecycle methods, and work through a comprehensive example demonstrating exactly when and how each method executes in conjunction with a rendered component.
In chapter 2 we'll build upon React fundamentals by focusing on several key aspects of developing a React-powered web application. You'll learn about React's unconventional approach to CSS integration, how to create manageable layouts, and various approaches to defining and managing routes.
Everything we've discussed so far has been primarily focused on React's view-oriented capabilities. However in order to build a complete application you'll ultimately need look at the larger picture. In this chapter you'll learn how to do so through an introduction to Facebook's Flux application architecture. I'll also introduce you to several open source, Flux-inspired solutions such as Redux.
Logically your application will integrate with a data store such as MySQL or MongoDB. But how is this data passed between your React components and the data store? For many applications the conventional approach involves a REST API. In this chapter you'll learn how to create a REST API using the Express web framework, and integrate it alongside the example React application.
We'll need a place to store data, and while options abound in regards to databases these days, I thought this would be a fun opportunity to introduce MongoDB and take advantage of MongoDB's JSON-related features. Even if you don't plan on using MongoDB in your own projects, embrace this opportunity to at least learn more about what all the buzz is about and have fun with it. In any case, by the end of this chapter we'll have successfully integrated MongoDB into the application, connecting the REST API developed in the last chapter to the database.
Logically the success of many applications depends upon a high degree of user interaction. In this chapter we'll integrate forms and learn how to process data submitted through these forms. I'll also discuss various other UI-related matters which can contribute to providing users with a highly interactive experience.
In this chapter you'll learn how to integrate user account management capabilities, adding user registration, sign in, and other related features such as password recovery. We'll also talk about how to restrict application content to users in a variety of ways.
If anything, basing much of this instruction around a thematic project keeps the material practical and helps to frame the discussion within the greater goal of creating a working application.
Git: We'll tangentially use Git throughout the book to retrieve the companion repository and switch between example branches. If you're not familiar with Git check out Scott Chacon's great book, "Pro Git".
Node: Although I introduce Node.js in chapter 5, it would be swell if you installed it now because we will use it (and npm) in chapter 1 to run the starter project. While you're not required to use it in chapter 1, doing so will save you a tiny bit of hassle in the long run.
Chrome DevTools: All modern browsers offer some level of debugging capabilities, however the Chrome browser's tools far surpass those available elsewhere. While you're not required to use Chrome DevTools at any point in the book, I nonetheless suggest familiarizing yourself with at least one of the available browser debugging solutions.
W. Jason Gilmore is a software developer, consultant, and bestselling author. He has spent much of the past 18 years helping companies of all sizes build amazing solutions. Recent projects include a Rails-driven e-commerce analytics application for a globally recognized publisher, a Linux-powered autonomous environmental monitoring buoy, and a 10,000+ product online store.
Jason is the author of nine books, including the bestselling "Easy Laravel 5", "Easy E-Commerce Using Laravel and Stripe", "Beginning PHP and MySQL, Fourth Edition", and "Easy Active Record for Rails Developers".
Over the years Jason has published more than 300 articles within popular publications such as Developer.com, JSMag, and Linux Magazine, and instructed hundreds of students in the United States and Europe. Jason is cofounder of the wildly popular CodeMash Conference, the largest multi-day developer event in the Midwest.
Away from the keyboard, you'll often find Jason playing with his kids, hunched over a chess board, and having fun with DIY electronics.
Nobody is perfect, particularly when it comes to writing about technology. I've surely made some mistakes in both code and grammar, and probably completely botched more than a few examples and explanations. If you would like to report an error, ask a question or offer a suggestion, please e-mail me at firstname.lastname@example.org.