Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Full-Stack React Projects
Full-Stack React Projects

Full-Stack React Projects: Modern web development using React 16, Node, Express, and MongoDB

eBook
$27.98 $39.99
Paperback
$48.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing
Table of content icon View table of contents Preview book icon Preview Book

Full-Stack React Projects

Unleashing React Applications with MERN

React may have opened up new frontiers for frontend web development and changed the way we program JavaScript user interfaces, but we still need a solid backend to build a complete web application. Although there are myriad options when selecting backend technologies, the benefits and appeal of using a full JavaScript stack are undeniable, especially when there are robust and widely-adopted backend technologies such as Node, Express, and MongoDB. Combining the potential of React with these industry-tested, server-side technologies creates a diverse array of possibilities when developing real-world web applications.

This book guides you through setting up for MERN-based web development, to building real-world web applications of varying complexities.

Before diving into the development of these web applications, we are going to answer the following questions in this chapter to set the context for using MERN:

  • What is the MERN stack?
  • Why is MERN relevant today?
  • When is MERN a good fit for developing web apps?
  • How is this book organized to help master MERN?

MERN stack

MongoDB, Express, React, and Node are used in tandem to build web applications and make up the MERN stack. In this lineup, Node and Express bind the web backend together, MongoDB serves as the NoSQL database, and React makes the frontend that the user sees and interacts with.

All four of these technologies are free, open-source, cross-platform, and JavaScript-based, with extensive community and industry support. Each technology has a unique set of attributes, which when integrated together make a simple but effective full JavaScript stack for web development.

Node

Node was developed as a JavaScript runtime environment built on Chrome's V8 JavaScript engine. Node made it possible to start using JavaScript on the server-side to build a variety of tools and applications beyond previous use cases that were limited to within a browser.

Node has an event-driven architecture capable of asynchronous, non-blocking I/O. Its unique non-blocking I/O model eliminates the waiting approach to serving requests. This allows building scalable and lightweight real-time web applications that can efficiently handle many requests.

Node's default package management system, the Node package manager or npm, comes bundled with the Node installation. Npm gives access to hundreds of thousands of reusable Node packages built by developers all over the world and boasts that it is currently the largest ecosystem of open source libraries in the world.

Learn more about Node at https://nodejs.org/en/ and browse through available npm modules at https://www.npmjs.com/.

Express

Express is a basic framework for building web applications and APIs with a Node server. It provides a simple layer of fundamental web application features that complements Node.

In any web application developed with Node, Express can be used as a routing and middleware web framework that has minimal functionality of its own—an Express application is essentially a series of middleware function calls.

Middleware functions are functions that have access to the HTTP request and response objects, and also the next middleware function in the web application's request-response cycle.

It is possible to insert almost any compatible middleware of your choice into the request handling chain, in almost any order, making Express very flexible to work with.

Find out what is possible with Express.js at expressjs.com.

MongoDB

MongoDB is a top choice when deciding on a NoSQL database for any application. It is a document-oriented database that stores data in flexible, JSON-like documents. This means fields can vary from document to document and data models can evolve over time in response to changing application requirements.

Applications that place a high priority on availability and scalability benefit from MongoDB's distributed architecture features. It comes with built-in support for high availability, horizontal scaling using sharding, and multi-data center scalability across geographic distributions.

MongoDB has an expressive query language, enabling ad hoc queries, indexing for fast lookups, and real-time aggregation that provides powerful ways to access and analyze data while maintaining performance even when data size grows exponentially.

Explore MongoDB features and services at https://www.mongodb.com/.

React

React is a declarative and component-based JavaScript library for building user interfaces. Its declarative and modular nature makes it easy for developers to create and maintain reusable, interactive, and complex user interfaces.

Large applications that display a lot of changing data can be fast and responsive if built with React, as it takes care of efficiently updating and rendering just the right UI components when specific data changes. React does this efficient rendering with its notable implementation of a virtual DOM, setting React apart from other web UI libraries that handle page updates with expensive manipulations directly in the browser's DOM.

Developing user interfaces using React also forces frontend programmers to write well-reasoned and modular code that is reusable, easier to debug, test, and extend.

Check out resources on React at https://reactjs.org/.

Since all four technologies are JavaScript-based, these are inherently optimized for integration. However, how these are actually put together in practice to form the MERN stack can vary based on application requirements and developer preferences, making MERN customizable and extensible to specific needs.

Relevance of MERN

JavaScript has come a long way since its inception and it is ever-growing. The MERN stack technologies have challenged the status quo and broken new ground for what is possible with JavaScript. But when it comes to developing real-world applications that need to be sustainable, is it a worthy choice? Some of the reasons that make a strong case for choosing MERN for your next web application are briefly outlined in the following.

Consistency across the technology stack

As JavaScript is used throughout, developers don't need to learn and change gears frequently to work with very different technologies. This also enables better communication and understanding across teams working on different parts of the web application.

Less time to learn, develop, deploy, and extend

Consistency across the stack also makes it easy to learn and work with MERN, reducing the overhead of adopting a new stack and the time to develop a working product. Once the working base of a MERN application is set up and a workflow established, it takes less effort to replicate, further develop, and extend any application.

Widely adopted in the industry

Organizations of all sizes have been adopting the technologies in this stack based on their needs because they can build applications faster, handle highly diverse requirements, and manage applications more efficiently at scale.

Community support and growth

Developer communities surrounding the very popular MERN stack technologies are quite diverse and growing on a regular basis. With lots of people continuously using, fixing, updating, and willing to help grow these technologies, the support system will remain strong for the foreseeable future. These technologies will continue to be maintained, and resources are very likely to be available in terms of documentation, add-on libraries, and technical support.

The ease and benefits of using these technologies are already widely recognized. Because of the high-profile companies that continue adoption and adaptation, and the growing number of people contributing to the code bases, providing support, and creating resources, technologies in the MERN stack will continue to be relevant for a long time to come.

Range of MERN applications

Given the unique features attributed to each technology, along with the ease of extending functionalities of this stack by integrating other technologies, the range of applications that can be built with this stack is actually quite diverse.

These days, web applications are, by default, expected to be rich client apps that are immersive, interactive, and don't fall short on performance and availability. The grouping of MERN strengths makes it perfect for developing web applications that meet these very aspects and demands.

Moreover, novel and upcoming attributes of some of these technologies, such as low-level operation manipulation with Node, large file streaming capabilities with MongoDB GridFS, and virtual reality features on the web using React 360, make it possible to build even more complex and unique applications with MERN.

It may seem reasonable to pick specific features in the MERN technologies, and argue why these don't work for certain applications. But given the versatile nature of how a MERN stack can come together and be extended; these concerns can be addressed in MERN on a case-by-case basis. In this book, we will demonstrate how to make such considerations when faced with specific requirements and demands in the application being built.

MERN applications developed in this book

To demonstrate the breadth of possibilities with MERN and how you can easily start building a web application with varying features, this book will showcase everyday use web applications alongside complex and rare web experiences:

The preceding screenshot gives a glimpse of the four different MERN applications developed in the rest of this book 

Social media platform

For the first MERN application, we will build a basic social media application inspired by Twitter and Facebook. This social media platform will implement simple features such as post sharing, liking and commenting, following friends, and an aggregated news feed.

Online marketplace

E-commerce web applications of all sorts are abundant on the internet, and these will not go out of style anytime soon. Using MERN, we will build an online marketplace application covering core aspects, such as support for seller accounts, product listings, a shopping cart for customers, and payment processing.

Media streaming application

To test out some advanced MERN capabilities, a more immersive application, such as a media streaming application, is the next pick. Inspired by features from Netflix and YouTube, this application will implement content uploading and viewing capabilities with a media content upload feature for content providers, and real-time content streaming for viewers.

VR game for the web

The release of React 360 makes it possible to apply web VR capabilities to React user interfaces. We will explore how to create rare web experiences with React 360 in MERN by putting together a basic virtual reality game application for the web. Users will be able to make and play VR games, where each game will have animated VR objects that the player can collect to complete the game.

Book structure

This book aims to help JavaScript developers who have zero-to-some experience with the MERN stack, to set up and start developing web applications of varying complexity. It includes guidelines for building out and running the different applications supplemented with code snippets and explanations of key concepts.

The book is organized into five parts, progressing from basic to advanced topics, taking you on a journey of building MERN from the ground up, then using it to develop different applications with simple to complex features, while demonstrating how to extend the capabilities of the MERN stack based on application requirements.

Getting started with MERN

Chapter 1, Unleashing React Applications with MERN and Chapter 2, Preparing the Development Environment set the context for developing web applications in a MERN stack and guide you through setting up your development environment.

Building MERN from the ground up – a skeleton application

Chapter 3, Building a Backend with MongoDB, Express, and Node and Chapter 4, Adding a React Frontend to Complete MERN show how to bring the MERN stack technologies together to form a skeleton web application with minimal and basic features. This skeletal MERN application acts as a base for the four main applications developed in the rest of the book.

Developing basic web applications with MERN

In this part, you will become familiar with the core attributes of a MERN stack web application by building out two real-world applications—a simple social media platform in Chapter 5, Starting with a Simple Social Media Application, and an online marketplace in Chapter 6, Exercising New MERN Skills with an Online Marketplace and Chapter 7, Extending the Marketplace for Orders and Payments.

Advancing to complex MERN applications

Chapter 8, Building a Media Streaming Application, Chapter 9, Customizing Media Player and Improve SEO, Chapter 10, Developing a Web-Based VR Game, and Chapter 11, Making the VR Game Dynamic using MERN show how this stack can be used to develop applications with more complex and immersive features, such as media streaming and virtual reality using React 360.

Going forward with MERN

Finally Chapter 12, Following Best Practices and Developing MERN Further wraps up the preceding chapters and applications developed by expanding on best practices to follow to make successful MERN applications, suggesting improvements and further developments.

You may choose to use the book out of the prescribed order based on your experience level and preference. A developer who is very new to MERN can follow the path set out in the book. For a more seasoned JS developer, the chapters in the Building MERN from the ground up - a skeleton application section would be a good place to start setting up the base application, then pick any of the four applications to build and extend.

Getting the most out of this book

The content in this book is practical-oriented and covers the implementation steps, code, and concepts relevant to building out each MERN application. It is recommended that, rather than attempting to just read through the chapters, you should run the relevant code in parallel, and browse through the application features while following the explanations in the book.

Chapters that discuss code implementations will point to GitHub repositories containing the complete code with instructions on how to run the code. You can pull the code, install, and run it before reading through the chapter:

You may consider the recommended following steps outlined to follow the implementations in this book:

  • Before diving into the implementation details discussed in the chapter, pull code from the relevant GitHub repository
  • Follow instructions with the code to install and run the application
  • Browse the features of the running application, while reading the feature descriptions in the relevant chapter
  • With the code running in development mode and also open in the editor, refer to the steps and explanations in the book to get a deeper understanding of the implementations

This book aims to provide a quick onboarding with working code for each application. You can experiment with, improve, and extend this code as desired. For an active learning experience, you are encouraged to refactor and modify the code while following the book. In some examples, the book chooses verbose code over succinct and cleaner code because it is easier to reason about for newcomers. In some other implementations, the book sticks with more widely used and traditional conventions over modern and upcoming JavaScript conventions. This is done to minimize disparity when you refer to online resources and documentation while researching the discussed technologies and concepts on your own. These instances where the code in the book can be updated, serve as good opportunities to explore and grow skills beyond what is covered in the book. 

Summary

In this chapter, we discovered the context for developing web applications in the MERN stack, and how this book will help you develop with this stack.

MERN stack projects integrate MongoDB, Express, React, and Node to build web applications. Each of the technologies in this stack has made relevant strides in the world of web development. These are widely adopted and continue to improve with the support of growing communities. It is possible to develop MERN applications with diverse requirements, ranging from everyday use applications to more complex web experiences. The practical-oriented approach in this book can be used to grow MERN skills from basic to advanced, or for diving right into building the more complex applications.

In the next chapter, we will start gearing up for MERN application development by setting up the development environment.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • •Create dynamic web applications with the MERN stack
  • •Leverage the power of React in building interactive and complex user interfaces
  • •Unlock the potential of Node, Express, and MongoDB to build modern full-stack applications

Description

The benefits of using a full JavaScript stack for web development are undeniable, especially when robust and widely adopted technologies such as React, Node, and Express and are available. Combining the power of React with industry-tested, server-side technologies, such as Node, Express, and MongoDB, creates a diverse array of possibilities when developing real-world web applications. This book guides you through preparing the development environment for MERN stack-based web development, to creating a basic skeleton application and extending it to build four different web applications. These applications include a social media, an online marketplace, a media streaming, and a web-based game application with virtual reality features. While learning to set up the stack and developing a diverse range of applications with this book, you will grasp the inner workings of the MERN stack, extend its capabilities for complex features, and gain actionable knowledge of how to prepare MERN-based applications to meet the growing demands of real-world web applications.

Who is this book for?

Full-Stack React Web Development Projects is for JavaScript developers who have some experience with React, but no previous experience with full-stack development involving Node, Express, and MongoDB, and who want practical guidelines to start building different types of real-world web applications with this stack.

What you will learn

  • •Set up your development environment and develop a MERN application
  • •Implement user authentication and authorization using JSON Web Tokens
  • •Build a social media application by extending the basic MERN application
  • •Create an online marketplace application with shopping cart and Stripe payments
  • •Develop a media streaming application using MongoDB GridFS
  • •Implement server-side rendering with data to improve SEO
  • •Set up and use React 360 to develop user interfaces with VR capabilities
  • •Learn industry best practices to make MERN stack applications reliable and scalable

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : May 29, 2018
Length: 470 pages
Edition : 1st
Language : English
ISBN-13 : 9781788835534
Tools :

What do you get with a Packt Subscription?

Free for first 7 days. $19.99 p/m after that. Cancel any time!
Product feature icon Unlimited ad-free access to the largest independent learning library in tech. Access this title and thousands more!
Product feature icon 50+ new titles added per month, including many first-to-market concepts and exclusive early access to books as they are being written.
Product feature icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Product feature icon Thousands of reference materials covering every tech concept you need to stay up to date.
Subscribe now
View plans & pricing

Product Details

Publication date : May 29, 2018
Length: 470 pages
Edition : 1st
Language : English
ISBN-13 : 9781788835534
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 146.97
React Cookbook
$48.99
Full-Stack React Projects
$48.99
Full-Stack Web Development with Vue.js and Node
$48.99
Total $ 146.97 Stars icon

Table of Contents

13 Chapters
Unleashing React Applications with MERN Chevron down icon Chevron up icon
Preparing the Development Environment Chevron down icon Chevron up icon
Building a Backend with MongoDB, Express, and Node Chevron down icon Chevron up icon
Adding a React Frontend to Complete MERN Chevron down icon Chevron up icon
Starting with a Simple Social Media Application Chevron down icon Chevron up icon
Exercising New MERN Skills with an Online Marketplace Chevron down icon Chevron up icon
Extending the Marketplace for Orders and Payments Chevron down icon Chevron up icon
Building a Media Streaming Application Chevron down icon Chevron up icon
Customizing the Media Player and Improving SEO Chevron down icon Chevron up icon
Developing a Web-Based VR Game Chevron down icon Chevron up icon
Making the VR Game Dynamic Using MERN Chevron down icon Chevron up icon
Following Best Practices and Developing MERN Further Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Half star icon Empty star icon Empty star icon 2.9
(10 Ratings)
5 star 30%
4 star 20%
3 star 0%
2 star 10%
1 star 40%
Filter icon Filter
Top Reviews

Filter reviews by




Joe Chacon Feb 24, 2020
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Thank you for this book.This book has helped me to understand more advanced topics regarding react and server side rendering react.This is a very valuable resource to have in a persons library.
Amazon Verified review Amazon
R Valades Jul 06, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This is a great book for getting started with full-stack React web applications. Frontend and backend implementations are outlined from scratch and the author goes into great length to explain not just how it’s done but also why.Some particular things that stood out for me:- Almost all the aspects of developing a full stack application are covered, including authentication and authorization.- The development flow for each project is easy to follow through the book chapters.- Good use of illustrations, specially the React component hierarchy diagrams that also give an overview of each project.- A hidden gem: Live demos of each project in the corresponding GitHub repositories.Highly recommendable book.
Amazon Verified review Amazon
Asif Mahmud Aug 11, 2018
Full star icon Full star icon Full star icon Full star icon Full star icon 5
For someone who is relatively new in the discipline of Web Development this can be a great book to start with, if you are looking to build your first full-stack JavaScript application. All chapters are composed of several defining parts that maintain a sense of continuity throughout the volume. Additionally, the author has provided the code repositories on GitHub, so you can play around with the code and implement something of your own, if you want.In short, the book starts with the whys for the technology used, and then it gradually dives into setting up the development environment for creating applications. Personally I found this to be a real time-saver, since I didn’t have to jump around the Web to figure out which package to use.Turned out to be great place to get my hands dirty!
Amazon Verified review Amazon
Pat J Ryll Jul 10, 2018
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Great book! Nice examples and easy to follow.
Amazon Verified review Amazon
skysongz Apr 22, 2019
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Background: So, I'm in the position of not coming from a CS background, and I've been working on learning the MERN stack to land a junior developer job.I've enjoyed this book so far. I've learned a fair amount while working through some of the projects. I can also understand why a lot of people might be put off by the book. I think without a lot of CS background, just reading this book and not using any other resources would be a bit frustrating, because the book doesn't provide much 'perspective' on code choices and other things. This is okay; it's pretty clear that in a work situation, you won't have the luxury of listening to a commentary on the codebase you're working with. And so, rather than lament the fact that this book isn't going to make you an amazing mern developer on it's own, you should appreciate that it gives you some different and complete projects.My current approach is to use this book, along with Udemy video courses to get a more complete picture of the mern stack. There are many worthwhile resources, and I think the trick is to not put too much weight in any one of them, and use them together to establish a firm foundation.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is included in a Packt subscription? Chevron down icon Chevron up icon

A subscription provides you with full access to view all Packt and licnesed content online, this includes exclusive access to Early Access titles. Depending on the tier chosen you can also earn credits and discounts to use for owning content

How can I cancel my subscription? Chevron down icon Chevron up icon

To cancel your subscription with us simply go to the account page - found in the top right of the page or at https://subscription.packtpub.com/my-account/subscription - From here you will see the ‘cancel subscription’ button in the grey box with your subscription information in.

What are credits? Chevron down icon Chevron up icon

Credits can be earned from reading 40 section of any title within the payment cycle - a month starting from the day of subscription payment. You also earn a Credit every month if you subscribe to our annual or 18 month plans. Credits can be used to buy books DRM free, the same way that you would pay for a book. Your credits can be found in the subscription homepage - subscription.packtpub.com - clicking on ‘the my’ library dropdown and selecting ‘credits’.

What happens if an Early Access Course is cancelled? Chevron down icon Chevron up icon

Projects are rarely cancelled, but sometimes it's unavoidable. If an Early Access course is cancelled or excessively delayed, you can exchange your purchase for another course. For further details, please contact us here.

Where can I send feedback about an Early Access title? Chevron down icon Chevron up icon

If you have any feedback about the product you're reading, or Early Access in general, then please fill out a contact form here and we'll make sure the feedback gets to the right team. 

Can I download the code files for Early Access titles? Chevron down icon Chevron up icon

We try to ensure that all books in Early Access have code available to use, download, and fork on GitHub. This helps us be more agile in the development of the book, and helps keep the often changing code base of new versions and new technologies as up to date as possible. Unfortunately, however, there will be rare cases when it is not possible for us to have downloadable code samples available until publication.

When we publish the book, the code files will also be available to download from the Packt website.

How accurate is the publication date? Chevron down icon Chevron up icon

The publication date is as accurate as we can be at any point in the project. Unfortunately, delays can happen. Often those delays are out of our control, such as changes to the technology code base or delays in the tech release. We do our best to give you an accurate estimate of the publication date at any given time, and as more chapters are delivered, the more accurate the delivery date will become.

How will I know when new chapters are ready? Chevron down icon Chevron up icon

We'll let you know every time there has been an update to a course that you've bought in Early Access. You'll get an email to let you know there has been a new chapter, or a change to a previous chapter. The new chapters are automatically added to your account, so you can also check back there any time you're ready and download or read them online.

I am a Packt subscriber, do I get Early Access? Chevron down icon Chevron up icon

Yes, all Early Access content is fully available through your subscription. You will need to have a paid for or active trial subscription in order to access all titles.

How is Early Access delivered? Chevron down icon Chevron up icon

Early Access is currently only available as a PDF or through our online reader. As we make changes or add new chapters, the files in your Packt account will be updated so you can download them again or view them online immediately.

How do I buy Early Access content? Chevron down icon Chevron up icon

Early Access is a way of us getting our content to you quicker, but the method of buying the Early Access course is still the same. Just find the course you want to buy, go through the check-out steps, and you’ll get a confirmation email from us with information and a link to the relevant Early Access courses.

What is Early Access? Chevron down icon Chevron up icon

Keeping up to date with the latest technology is difficult; new versions, new frameworks, new techniques. This feature gives you a head-start to our content, as it's being created. With Early Access you'll receive each chapter as it's written, and get regular updates throughout the product's development, as well as the final course as soon as it's ready.We created Early Access as a means of giving you the information you need, as soon as it's available. As we go through the process of developing a course, 99% of it can be ready but we can't publish until that last 1% falls in to place. Early Access helps to unlock the potential of our content early, to help you start your learning when you need it most. You not only get access to every chapter as it's delivered, edited, and updated, but you'll also get the finalized, DRM-free product to download in any format you want when it's published. As a member of Packt, you'll also be eligible for our exclusive offers, including a free course every day, and discounts on new and popular titles.