Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Modern Full-Stack React Projects
Modern Full-Stack React Projects

Modern Full-Stack React Projects: Build, maintain, and deploy modern web apps using MongoDB, Express, React, and Node.js

eBook
€17.99 €26.99
Paperback
€22.99 €33.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Modern Full-Stack React Projects

Preparing for Full-Stack Development

In this chapter, I am first going to give a brief overview of the contents of the book and explain why the skills taught in this book are important in a modern development environment. Then, we will jump into action and set up a project that will be used as a basis for the development of our full-stack projects. At the end of this chapter, you will have an integrated development environment (IDE) and project set up and ready for full-stack development and will understand which tools can be used for setting up such projects.

In this chapter, we are going to cover the following main topics:

  • Motivation to become a full-stack developer
  • What is new in the third edition?
  • Getting the most out of this book
  • Setting up the development environment

Technical requirements

This chapter will guide you through setting up all the necessary technologies needed for developing full-stack web applications throughout this book. Before we start, please install the following, if you do not already have them installed:

  • Node.js v20.10.0
  • Git v2.43.0
  • Visual Studio Code v1.84.2

Those versions are the ones used in the book. While installing a newer version should not be an issue, please note that certain steps might work differently on a newer version. If you are having an issue with the code and steps provided in this book, please try using the mentioned versions.

You can find the code for this chapter on GitHub: https://github.com/PacktPublishing/Modern-Full-Stack-React-Projects/tree/main/ch1.

The CiA video for this chapter can be found at: https://youtu.be/dyf3nECvKAE.

Important

If you cloned the full repository for the book, Husky may not find the .git directory when running npm install. In that case, just run git init in the root of the corresponding chapter folder.

Motivation to become a full-stack developer

Understanding full-stack development is becoming increasingly important, as companies seek to increase the cooperation – and reduce the gap – between the frontend and the backend. The frontend is becoming more deeply integrated with the backend, using technologies such as server-side rendering. Throughout this book, we are going to learn about the development, integration, testing, and deployment of full-stack projects.

What is new in this release of Full-Stack React Projects?

Unlike previous releases of Full-Stack React Projects, this new release focuses more on the integration of the frontend with the backend than the previous two editions, and thus intentionally does not focus so much on creating a user interface (UI) or using UI libraries, such as Material UI (MUI), on the frontend. This edition gives the essential knowledge for integrating and deploying full-stack web applications. The deployment of apps was missing completely from previous editions, and testing was only briefly introduced. This edition focuses more on these essential parts of full-stack development such that, after reading this book, you will be able to develop, integrate, test, and deploy a full-stack web application.

Getting the most out of this book

To keep the book short and to the point, we are going to use specific technologies and tools. The concepts, however, apply to other technologies as well. We will attempt to briefly introduce alternatives so that if something is not a good fit for your project, you can pick and choose different tools. I recommend first trying out the technologies introduced in this book to be able to follow the instructions, but do not hesitate to try out the alternatives on your own later.

It is highly recommended that you write the code on your own. Do not simply run the code examples that are provided. It is important to write the code yourself in order to learn and understand it properly. However, if you run into any issues, you can always refer to the code examples.

With that said, let’s start with setting up our development environment in the next section.

Setting up the development environment

In this book, we are going to use Visual Studio Code (VS Code) as our code editor. Feel free to use whichever editor you prefer, but keep in mind that the extensions used and settings configured may be slightly different in the editor of your choice.

Let’s now install VS Code and useful extensions, and then continue setting up all the tools needed for our development environment.

Installing VS Code and extensions

Before we can get started developing and setting up the other tools, we need to set up our code editor by following these steps:

  1. Download VS Code for your operating system from the official website (at the time of writing, the URL is https://code.visualstudio.com/). We are going to use version 1.84.2 in this book.
  2. After downloading and installing the application, open it, and you should see the following window:
Figure 1.1 – A fresh installation of VS Code (on macOS)

Figure 1.1 – A fresh installation of VS Code (on macOS)

  1. To make things easier later, we are going to install some extensions, so click on the Extensions icon, which is the fifth icon from the top on the left in the screenshot. A sidebar should open, where you will see Search Extensions in Marketplace at the top. Enter an extension name here and click on Install to install it. Let’s start by installing the Docker extension:
Figure 1.2 – Installing the Docker extension in VS Code

Figure 1.2 – Installing the Docker extension in VS Code

  1. Install the following extensions:
    • Docker (by Microsoft)
    • ESLint (by Microsoft)
    • Prettier – Code formatter (by Prettier)
    • MongoDB for VS Code (by MongoDB)

    Support for JavaScript and Node.js already comes built-in with VS Code.

  2. Create a folder for the projects made in this book (for example, you can call it Full-Stack-React-Projects). Inside this folder, create a new folder called ch1.
  3. Go to the Files tab (first icon from top) and click the Open Folder button to open the empty ch1 folder.
  4. If you get a dialog asking Do you trust the authors of the files in this folder?, check Trust the authors of all files in the parent folder ‘Full-Stack-React-Projects’ and then click on the Yes, I trust the authors button.
Figure 1.3 – Allowing VS Code to execute files in our project folder

Figure 1.3 – Allowing VS Code to execute files in our project folder

Tip

You can safely ignore this warning in your own projects, as you can be sure that those do not contain malicious code. When opening folders from untrusted sources, you can press No, I don’t trust the authors, and still browse the code. However, when doing so, some features of VS Code will be disabled.

We have now successfully set up VS Code and are ready to start setting up our project! If you have cloned the folder from the GitHub code examples provided, a notification telling you that a Git repository was found will also pop up. You can simply close this one, as we only want to open the ch1 folder.

Now that VS Code is ready, let’s continue by setting up a new project with Vite.

Setting up a project with Vite

For this book, we are going to use Vite to set up our project, as it is the most popular and liked according to The State of JS 2022 survey (https://2022.stateofjs.com/). Vite also makes it easy to set up a modern frontend project, while still making it possible to extend the configuration later if needed. Follow these steps to set up your project with Vite:

  1. In the VS Code menu bar, go to Terminal | New Terminal to open a new Terminal.
  2. Inside the Terminal, run the following command:
    $ npm create [email protected] .

    Make sure there is a period at the end of the command to create the project in the current folder instead of creating a new folder.

Note

To keep the instructions in this book working even when new versions are released, we pin all packages to a fixed version. Please follow the instructions with the given versions. After finishing this book, when starting new projects on your own, you should always try using the latest versions but keep in mind that changes might be needed to get them working. Consult the documentation of the respective packages and follow the migration path from the book version to the latest version.

  1. When asked if create-vite should be installed, simply type y and press the Return/Enter key to proceed.
  2. When asked about the framework, use the arrow keys to select React and press Return. If you are being asked for a project name, press Ctrl + C to cancel, then run the command again, making sure there is a period at the end to select the current folder.
  3. When asked about the variant, select JavaScript.
  4. Now, our project is set up and we can run npm install to install the dependencies.
  5. Afterward, run npm run dev to start the dev server, as shown in the following screenshot:
Figure 1.4 – The Terminal after setting up a project with Vite and before starting the dev server

Figure 1.4 – The Terminal after setting up a project with Vite and before starting the dev server

Note

For simplicity in setting up, we just used npm directly. If you prefer yarn or pnpm, you can instead run yarn create vite or pnpm create vite, respectively.

  1. In the Terminal, you will see a URL telling you where your app is running. You can either hold Ctrl (Cmd on macOS) and click on the link to open it in your browser, or manually enter the URL in a browser.
  2. To test whether your app is interactive, click the button with the text count is 0, and it should increase the count every time it is pressed.
Figure 1.5 – Our first React app running with Vite

Figure 1.5 – Our first React app running with Vite

Alternatives to Vite

Alternatives to Vite are bundlers, such as webpack, Rollup, and Parcel. These are highly configurable but often do not offer a great experience for dev servers. They first must bundle all our code together before serving it to the browser. Instead, Vite natively supports the ECMAScript module (ESM) standard. Furthermore, Vite requires very little configuration to get started. A downside of Vite is that it can be hard to configure certain more complex scenarios with it. An upcoming bundler that is promising is Turbopack; however, it is still very new at the time of writing. For full-stack development with server-side rendering, we will later get to know Next.js, which is a React framework that also provides a dev server out of the box.

Now that our boilerplate project is up and running, let’s spend some time setting up tools that will enforce best practices and a consistent code style.

Setting up ESLint and Prettier to enforce best practices and code style

Now that our React app is set up, we are going to set up ESLint to enforce coding best practices with JavaScript and React. We are also going to set up Prettier to enforce a code style and automatically format our code.

Installing the necessary dependencies

First, we are going to install all the necessary dependencies:

  1. In the Terminal, click on the Split Terminal icon at the top right of the Terminal pane to create a new Terminal pane. This will keep our app running while we run other commands.
  2. Click on this newly opened pane to focus it. Then, enter the following command to install ESLint, Prettier, and the relevant plugins:
    $ npm install --save-dev [email protected] \
      [email protected] \
      [email protected] \
      [email protected] \
      [email protected]

    The packages installed are the following:

    • prettier: Formats our code automatically according to a defined code style
    • eslint: Analyzes our code and enforces best practices
    • eslint-config-react: Enables rules in ESLint relevant to React projects
    • eslint-config-prettier: Disables rules relating to code style in ESLint so that Prettier can handle them instead
    • eslint-plugin-jsx-a11y: Allows ESLint to check for accessibility (a11y) issues in our JSX code

Note

The --save-dev flag in npm saves those dependencies as dev dependencies, which means that they will only be installed for development. They will not be installed and included in a deployed app. This is important in order to keep the size of our containers as small as possible later.

After the dependencies are installed, we need to configure Prettier and ESLint. We will start with configuring Prettier.

Configuring Prettier

Prettier will format the code for us and replace the default code formatter for JavaScript in VS Code. It will allow us to spend more time writing code, automatically formatting it for us properly when we save the file. Follow these steps to configure Prettier:

  1. Right-click below the files list in the left sidebar of VS Code (if it is not opened, click the Files icon) and press New file... to create a new file. Call it .prettierrc.json (do not forget the period at the beginning of the file name!).
  2. The newly created file should open automatically, so we can start writing the following configuration into it. We first create a new object and set the trailingComma option to all to make sure objects and arrays that span over multiple lines always have a comma at the end, even for the last element. This reduces the number of touched lines when committing a change via Git:
    {
      "trailingComma": "all",
  3. Then, we set the tabWidth option to 2 spaces:
      "tabWidth": 2,
  4. Set the printWidth to 80 characters per line to avoid long lines in our code:
      "printWidth": 80,
  5. Set the semi option to false to avoid semicolons where not necessary:
      "semi": false,
  6. Finally, we enforce the use of single quotes instead of double quotes:
      "jsxSingleQuote": true,
      "singleQuote": true
    }

Note

These settings for Prettier are just an example of a coding style convention. Of course, you are free to adjust these to your own preferences. There are many more options, all of which can be found in the Prettier docs (https://prettier.io/docs/en/options.html).

Configuring the Prettier extension

Now that we have a configuration file for Prettier, we need to make sure the VS Code extension is properly configured to format the code for us:

  1. Open the VS Code settings by going to File | Preferences... | Settings on Windows/Linux, or Code | Settings... | Settings on macOS.
  2. In the newly opened settings editor, click on the Workspace tab. This ensures that we save all our settings in a .vscode/settings.json file in our project folder. When other developers open our project, they will automatically be using those settings as well.
  3. Search for editor format on save and check the checkbox to enable formatting code on save.
  4. Search for editor default formatter and select Prettier - Code formatter from the list.
  5. To verify that Prettier works, open the .prettierrc.json file, add some extra spaces to the beginning of a line, and save the file. You should notice that Prettier reformatted the code to adhere to the defined code style. It will reduce the number of spaces for indentation to two.

Now that Prettier is set up properly, we do not need to worry about formatting our code manually anymore. Feel free to just type in code as you go and save the file to get it formatted for you!

Creating a Prettier ignore file

To improve performance and avoid running Prettier on files that should not be automatically formatted, we can ignore certain files and folders by creating a Prettier ignore file. Follow these steps:

  1. Create a new file called .prettierignore in the root of our project, similar to how we created the .prettierrc.json file.
  2. Add the following contents to it to ignore the transpiled source code:
    dist/

    The node_modules/ folder is automatically ignored by Prettier.

Now that we have successfully set up Prettier, we are going to configure ESLint to enforce coding best practices.

Configuring ESLint

While Prettier focuses on the style and formatting of our code, ESLint focuses on the actual code, avoiding common mistakes or unnecessary code. Let’s configure it now:

  1. Delete the automatically created .eslintrc.cjs file.
  2. Create a new .eslintrc.json file and start writing the following configuration into it. First, we set root to true to make sure ESLint does not look at parent folders for more configuration:
    {
      "root": true,
  3. Define an env object, in which we set the browser environment to true so that ESLint understands browser-specific globals such as document and window:
      "env": {
        "browser": true
      },
  4. Define a parserOptions object, where we specify that we are using the latest ECMAScript version and ESM:
      "parserOptions": {
        "ecmaVersion": "latest",
        "sourceType": "module"
      },
  5. Define an extends array to extend from recommended configurations. Specifically, we extend from ESLint’s recommended rules and the recommended rules for the plugins we installed:
      "extends": [
        "eslint:recommended",
        "plugin:react/recommended",
        "plugin:react/jsx-runtime",
        "plugin:jsx-a11y/recommended",
  6. As the last element of the array, we use prettier to disable all code style-related rules in ESLint and let Prettier handle it:
        "prettier"
      ],
  7. Now, we define settings for the plugins. First, we tell the react plugin to detect our installed React version automatically:
      "settings": {
        "react": {
          "version": "detect"
        }
      },
  8. Finally, outside of the settings section, we define an overrides array, in which we specify that ESLint should only lint .js and .jsx files:
      "overrides": [
        {
          "files": ["*.js", "*.jsx"]
        }
      ]
    }
  9. Create a new .eslintignore file, with the following contents:
    dist/
    vite.config.js

    The node_modules/ folder is automatically ignored by ESLint.

  10. Save the files and run npx eslint src in the Terminal to run the linter. You will see that there are some errors already due to our configured rules not matching the source provided by the default project in Vite:
Figure 1.6 – When running ESLint for the first time, we get some errors about rule violations

Figure 1.6 – When running ESLint for the first time, we get some errors about rule violations

  1. Fortunately, all these issues are automatically fixable by ESLint. Run npx eslint src --fix to fix the issues automatically. Now, when you run npx eslint src again, you will not get any output. This means that there were no linter errors!

Tip

The npx command allows us to execute commands provided by npm packages, in a similar context as running them in package.json scripts would do. It can also run remote packages without installing them permanently. If the package is not installed yet, it will ask you whether it should do this.

Adding a new script to run our linter

In the previous section, we have been calling the linter by running npx eslint src manually. We are now going to add a lint script to package.json:

  1. In the Terminal, run the following command to define a lint script in the package.json file:
    $ npm pkg set scripts.lint="eslint src"
  2. Now, run npm run lint in the Terminal. This should execute eslint src successfully, just like npx eslint src did:
Figure 1.7 – The linter running successfully, with no errors

Figure 1.7 – The linter running successfully, with no errors

After setting up ESLint and Prettier, we still need to make sure that they run before we commit code. Let’s set up Husky to make sure we commit proper code now.

Setting up Husky to make sure we commit proper code

After setting up Prettier and ESLint, we will now get our code automatically formatted on save by Prettier and see errors from ESLint in VS Code when we make mistakes or ignore best practices. However, we might miss some of these errors and accidentally commit code that is invalid. To avoid this, we can set up Husky and lint-staged, which run before we commit our code to Git and ensure that Prettier and ESLint are executed successfully on the source code before it is committed.

Important

If you cloned the full repository for the book, Husky may not find the .git directory when running npm install. In that case, just run git init in the root of the corresponding chapter folder.

Let’s set Husky and lint-staged up by following these steps:

  1. Run the following command to install Husky and lint-staged as dev dependencies:
    $ npm install --save-dev [email protected] \
      [email protected]
  2. Open the package.json file and add the following lint-staged configuration to it in a new object after devDependencies, then save the file. This will run Prettier and ESlint on all committed .js and .jsx files and attempt to automatically fix code style and linter errors, if possible:
      "lint-staged": {
        "**/*.{js,jsx}": [
          "npx prettier --write",
          "npx eslint --fix"
        ]
      }
  3. Initialize a Git repository in the ch1 folder and make an initial commit with just the package.json file, as lint-staged does not get executed on the initial commit:
    $ git init
    $ git add package.json
    $ git commit -m "chore: initial commit"
  4. Add the husky install script to a prepare script in package.json, so that Husky gets installed automatically when the project is cloned and npm install is executed:
    $ npm pkg set scripts.prepare="husky install"
  5. Since we do not need to run npm install again right now, we need to manually run the prepare script this time:
    $ npm run prepare
  6. Add a pre-commit hook for lint-staged, so that ESLint and Prettier run every time we do git commit:
    $ npx husky add .husky/pre-commit "npx lint-staged"
  7. Now, add all files to Git and attempt to make a commit:
    $ git add .
    $ git commit -m "chore: basic project setup"

If everything worked successfully, you should see husky running lint-staged, which, in turn, runs prettier and eslint, after you run git commit. If you are getting a configuration error, ensure that all files are saved properly and then run git commit again.

Figure 1.8 – Husky and lint-staged successfully enforcing code style and best practices before we commit

Figure 1.8 – Husky and lint-staged successfully enforcing code style and best practices before we commit

Setting up commitlint to enforce a standard for our commit messages

In addition to linting our code, we can also lint our commit messages. You may have noticed that we were prefixing our commit messages with a type already (the chore type). Types make it easier to follow what was changed in a commit. To enforce the use of types, we can set up commitlint. Follow these steps to set it up:

  1. Install commitlint and a conventional config for commitlint:
    $ npm install --save-dev @commitlint/[email protected] \
      @commitlint/[email protected]
  2. Create a new .commitlintrc.json file in the root of our project and add the following contents:
    {
      "extends": ["@commitlint/config-conventional"]
    }
  3. Add a commit-msg hook to Husky:
    $ npx husky add .husky/commit-msg \
      'npx commitlint --edit ${1}'
  4. Now, if we try adding our changed files and committing without a type or a wrong type, we will get an error from commitlint and will not be able to make such a commit. If we add the correct type, it will succeed:
    $ git add .
    $ git commit -m "no type"
    $ git commit -m "wrong: type"
    $ git commit -m "chore: configure commitlint"

The following figure shows Husky in action. If we write an incorrect commit message, it will reject it and not let us commit the code. Only if we enter a properly formatted commit message will the commit go through:

Figure 1.9 – commitlint working successfully and preventing commits without a type and with wrong types

Figure 1.9 – commitlint working successfully and preventing commits without a type and with wrong types

Commit messages in the commitlint conventional config (https://www.conventionalcommits.org/) are structured in a way where a type must be listed first, then an optional scope follows, and then the description follows, such as type(scope): description. Possible types are as follows:

  • fix: For bug fixes
  • feat: For new features
  • refactor: For restructuring the code without adding features or fixing bugs
  • build: For changes in the build system or dependencies
  • ci: For changes in the CI/CD configuration
  • docs: For changes in the documentation only
  • perf: For performance optimizations
  • style: For fixing code formatting
  • test: For adding or adjusting tests

The scope is optional and best used in a monorepo to specify that changes were made to a certain app or library within it.

Summary

Now that we have successfully set up our project and started enforcing standards, we can continue working on our project without worrying about a consistent code style, consistent commit messages, or making small mistakes. ESLint, Prettier, Husky, and commitlint have got us covered.

In the next chapter, Chapter 2, Getting to Know Node.js and MongoDB, we are going to learn how to write and run small Node.js scripts and how MongoDB, a database system, works.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Understand how the different aspects of a MERN application come together through a series of practical projects
  • Set up frontend and backend projects that can be integrated and maintained together
  • Enhance your proficiency in building scalable and sustainable React projects
  • Purchase of the print or Kindle book includes a free PDF eBook

Description

Understanding full-stack development is vital as companies aim to bridge the gap between frontend and backend development. Recent trends show deeper integration between the two, opening numerous possibilities for building real-world web applications, through server-side technologies like Node.js, Express, and MongoDB. Written by the author of Learning Redux and Learn React Hooks, and CEO of TouchLay, Modern Full-Stack React Projects will guide you through the entire process of advancing from a frontend developer to a full-stack developer. Starting with how to set up robust projects that can be maintained for a long time, you’ll then progress toward developing a backend system and integrating it with the frontend. Throughout the book, you’ll learn how to build, test, and deploy a blog application and a chat application. You’ll also explore MongoDB, Express, React, Node.js (MERN) stack, best practices for frontend and backend development, different full-stack architectures, unit and end-to-end testing, and deployment of full-stack web applications. Once you get to grips with the essential concepts, you’ll progress to learn how to use Next.js, an enterprise-grade full-stack web framework for React. By the end, you’ll be well-versed in the MERN stack and all set to create performant and scalable full-stack web applications.

Who is this book for?

This book is for frontend developers, JavaScript engineers, and React developers who possess a solid understanding of JavaScript and React concepts. Specifically designed for those with limited experience in the development, creation, integration, and deployment of backend and full-stack systems, this book will equip you with the necessary skills to create high-quality web applications.

What you will learn

  • Implement a backend using Express and MongoDB, and unit-test it with Jest
  • Deploy full-stack web apps using Docker, set up CI/CD and end-to-end tests using Playwright
  • Add authentication using JSON Web Tokens (JWT)
  • Create a GraphQL backend and integrate it with a frontend using Apollo Client
  • Build a chat app based on event-driven architecture using Socket.IO
  • Facilitate Search Engine Optimization (SEO) and implement server-side rendering
  • Use Next.js, an enterprise-ready full-stack framework, with React Server Components and Server Actions
Estimated delivery fee Deliver to Austria

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jun 07, 2024
Length: 506 pages
Edition : 1st
Language : English
ISBN-13 : 9781837637959
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to Austria

Premium delivery 7 - 10 business days

€17.95
(Includes tracking information)

Product Details

Publication date : Jun 07, 2024
Length: 506 pages
Edition : 1st
Language : English
ISBN-13 : 9781837637959
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.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
€189.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
€264.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 83.97 104.97 21.00 saved
Mastering Node.js Web Development
€37.99
Modern Full-Stack React Projects
€22.99 €33.99
React and React Native
€22.99 €32.99
Total 83.97 104.97 21.00 saved Stars icon
Banner background image

Table of Contents

27 Chapters
Part 1:Getting Started with Full-Stack Development Chevron down icon Chevron up icon
Chapter 1: Preparing for Full-Stack Development Chevron down icon Chevron up icon
Chapter 2: Getting to Know Node.js and MongoDB Chevron down icon Chevron up icon
Part 2:Building and Deploying Our First Full-Stack Application with a REST API Chevron down icon Chevron up icon
Chapter 3: Implementing a Backend Using Express, Mongoose ODM, and Jest Chevron down icon Chevron up icon
Chapter 4: Integrating a Frontend Using React and TanStack Query Chevron down icon Chevron up icon
Chapter 5: Deploying the Application with Docker and CI/CD Chevron down icon Chevron up icon
Part 3:Practicing Development of Full-Stack Web Applications Chevron down icon Chevron up icon
Chapter 6: Adding Authentication with JWT Chevron down icon Chevron up icon
Chapter 7: Improving the Load Time Using Server-Side Rendering Chevron down icon Chevron up icon
Chapter 8: Making Sure Customers Find You with Search Engine Optimization Chevron down icon Chevron up icon
Chapter 9: Implementing End-to-End Tests Using Playwright Chevron down icon Chevron up icon
Chapter 10: Aggregating and Visualizing Statistics Using MongoDB and Victory Chevron down icon Chevron up icon
Chapter 11: Building a Backend with a GraphQL API Chevron down icon Chevron up icon
Chapter 12: Interfacing with GraphQL on the Frontend Using Apollo Client Chevron down icon Chevron up icon
Part 4:Exploring an Event-Based Full-Stack Architecture Chevron down icon Chevron up icon
Chapter 13: Building an Event-Based Backend Using Express and Socket.IO Chevron down icon Chevron up icon
Chapter 14: Creating a Frontend to Consume and Send Events Chevron down icon Chevron up icon
Chapter 15: Adding Persistence to Socket.IO Using MongoDB Chevron down icon Chevron up icon
Part 5:Advancing to Enterprise-Ready Full-Stack Applications Chevron down icon Chevron up icon
Chapter 16: Getting Started with Next.js Chevron down icon Chevron up icon
Chapter 17: Introducing React Server Components Chevron down icon Chevron up icon
Chapter 18: Advanced Next.js Concepts and Optimizations Chevron down icon Chevron up icon
Chapter 19: Deploying a Next.js App Chevron down icon Chevron up icon
Chapter 20: Diving Deeper into Full-Stack Development Chevron down icon Chevron up icon
Index 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 Full star icon Full star icon Full star icon 5
(8 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Sebastian Jun 16, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I come from backend development with only a bit of experience in the frontend world, I've found this book and it was really worth it. It explains everything very in depth, you can easily follow with little experience in React but it also doesnt get boring if you already understand a concept well. There is very nice graphics to explain things and its good to follow along. Would recommend for anyone trying to get more in depth into web development and wanting to understand the big picture rather than just pure javascript or such.
Amazon Verified review Amazon
M. Jul 19, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I recommend this book to any React developer as a user's manual, especially to all junior devs. This book takes all the confusing, random aspects of full-stack React development and creates harmony and clarity from the chaos:REST APIsMERN StackReact Router v6DockerAuthenticationServer-Side RenderingSEOTestingData VisualizationGraphQLSocket.IONext.jsServer ComponentsAll these concepts and more are covered in detail, starting with npm create vite and guiding the reader iteratively through thousands of examples and code samples until they have created their own full-stack production React application as the finished product.
Amazon Verified review Amazon
Salman Farsi Jun 26, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The book focuses on building and maintaining modern web apps using MongoDB, Express, React, and Node.js. It covers setting up development environments, working with Node.js and MongoDB, implementing backend services, integrating frontends with React, and deploying applications using Docker and CI/CD practices. Discusses advanced concepts like authentication with JWT, server-side rendering, and optimizing applications for search engines.Aimed at developers with React experience who whish to learn full-stack development, including backend integration and app deployment.In short this is great resource for beginners and advance React developers, to get full-stack development experience.
Amazon Verified review Amazon
Fuad Jul 06, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
One of the book's standout features is its emphasis on practical application. Each concept is illustrated with clear, real-world examples that progressively build in complexity. Whether you're learning how to model data effectively using MongoDB's flexible schema or integrating MongoDB with popular web frameworks like Node.js, Express, and Angular, the book ensures you not only understand the theory but also gain hands-on experience through well-crafted exercises and projects.
Amazon Verified review Amazon
teo Jul 28, 2024
Full star icon Full star icon Full star icon Full star icon Full star icon 5
If you're a React developer and want to expand your knowledge this is book is for you. It provides great examples for an end to end project from development to production. High recommended.
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 the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact [email protected] with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at [email protected] using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on [email protected] with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on [email protected] within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on [email protected] who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on [email protected] within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela