Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Full-Stack Web Development with GraphQL and React

You're reading from   Full-Stack Web Development with GraphQL and React Taking React from frontend to full-stack with GraphQL and Apollo

Arrow left icon
Product type Paperback
Published in Feb 2022
Publisher Packt
ISBN-13 9781801077880
Length 472 pages
Edition 2nd Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Sebastian Grebe Sebastian Grebe
Author Profile Icon Sebastian Grebe
Sebastian Grebe
Arrow right icon
View More author details
Toc

Table of Contents (17) Chapters Close

Preface 1. Section 1: Building the Stack
2. Chapter 1: Preparing Your Development Environment FREE CHAPTER 3. Chapter 2: Setting Up GraphQL with Express.js 4. Chapter 3: Connecting to the Database 5. Section 2: Building the Application
6. Chapter 4: Hooking Apollo into React 7. Chapter 5: Reusable React Components and React Hooks 8. Chapter 6: Authentication with Apollo and React 9. Chapter 7: Handling Image Uploads 10. Chapter 8: Routing in React 11. Chapter 9: Implementing Server-Side Rendering 12. Chapter 10: Real-Time Subscriptions 13. Chapter 11: Writing Tests for React and Node.js 14. Section 3: Preparing for Deployment
15. Chapter 12: Continuous Deployment with CircleCI and AWS 16. Other Books You May Enjoy

What this book covers

Chapter 1, Preparing Your Development Environment, explains the architecture of an application by going through some core concepts, the complete process, and preparing a working React setup. We will see how React, Apollo Client, and Express.js fit together and cover some good practices when working with React. Further, we will show you how to debug the frontend with React Developer Tools.

Chapter 2, Setting Up GraphQL with Express.js, teaches you how to configure your backend by installing Express.js and Apollo via NPM. Express.js will be used for the web server, which handles and passes all GraphQL requests to Apollo.

Chapter 3, Connecting to the Database, discusses the opportunities that GraphQL offers when it comes to mutating and querying data. As an example, we will use traditional SQL to build a full application. To simplify the database code, we will use Sequelize, which lets us query our SQL Server with a normal JavaScript object and also allows us to use MySQL, MSSQL, PostgresSQL, or just a SQLite file. We will build models and schemas for users and posts in Apollo and Sequelize.

Chapter 4, Hooking Apollo into React, is where you will learn how to hook Apollo into React and build frontend components to send GraphQL requests. This chapter will explain Apollo-specific configurations.

Chapter 5, Reusable React Components and React Hooks, with the basic concepts and flow of fetching and presenting data clear, will dive deeper into writing more complex React components and sharing data across them.

Chapter 6, Authentication with Apollo and React, will explain the common ways of authenticating a user on the web and in GraphQL. You will be guided through building a complete authentication workflow by using best practices.

Chapter 7, Handling Image Uploads, is the point by which you will have a working authentication and authorization system built on top of Apollo. Moving on, to go beyond normal requests with JSON responses as with GraphQL, we will now upload images via Apollo and save them in separate object storage such as AWS S3.

Chapter 8, Routing in React, is where, to build a complete application for the end user, you will implement some further features, such as a profile page. We will accomplish this by installing React Router v5.

Chapter 9, Implementing Server-Side Rendering, covers server-side rendering. For many applications, this is a must-have. It is important for SEO but can also have positive effects on your end user. This chapter will focus on getting your current application moved to a server-side rendered setup.

Chapter 10, Real-Time Subscriptions, looks at how our application is a great use case for WebSocket and Apollo subscriptions. Many of the applications we use daily have a self-updating notification bar. This chapter will focus on how to build this feature with a more or less experimental GraphQL and Apollo feature called subscriptions.

Chapter 11, Writing Tests for React and Node.js, looks at how a real production-ready application always has an automated testing environment. We will use Mocha, a JavaScript unit testing framework, and Enzyme, a React testing tool, to ensure the quality of our application. This chapter will focus on testing the GraphQL backend and how to properly test React applications with Enzyme.

Chapter 12, Continuous Deployment with CircleCI and AWS, studies deployment. Deploying an application means no more uploading files manually via FTP. Nowadays, you can virtually run your application in the cloud without having a complete server running. For easy deployment of our application, we will use Docker. Before deploying our application, we will quickly cover a basic continuous deployment setup, which will let you deploy all your new code with ease. This chapter will explain how to deploy your applications using Git, Docker, AWS, and CircleCI.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime