• Post category:StudyBullet-13
  • Reading time:8 mins read


Build a backend NodeJS API with a React client

What you will learn

Being able to quickly build a backend API for any kinds of projects and MVPs

Learning how to create API endpoints, testing an API and secure an API

Building a client React application and being able to plug it to an API

HTTP Client Axios package as well as Fetch Native JS API

Clean Code and Good Coding Practices in NodeJS and RESTful API architecture

Software Architecture: Learn the n-tier and layered architecture pattern

Calling an API from a client and dealing with CORS from the Web browsers

React Bootstrap v5

Implementing unit tests to the API with AVA test runner

All the little things you ABSOLUTELY need to know for taking your skills to the next level and becoming an outstanding Web developer

Implementing several NPM packages such as Pino, Yup, Toastify, React Content Loader, and so on!

Securing and optimizing an API on production with Rate Limiter, Helmet, and Compression

Documenting our API professionally with JSDoc and OpenAPI

Description

Quickly learn the fundamental of building a robust RESTFul API with NodeJSย based on an efficient professional architecture pattern, and then, see how to plug your API with a client which you will also learn how to build. A client built with the latest React and Bootstrap versions.

You will learn how to build a backend API from scratch and build a client that will speak to your API through HTTP protocol.

  • Communicate with your backend. HTTP and HTTP methods and codes.
  • How to validate the input data validation.
  • How to request some API endpoints easily
  • How to test your API gradually.
  • How to design a flexible and solid API architecture.
  • How to secure and optimize your API professionally (with the packages you absolutely need to know).
  • CORS on your API.
  • Building a client from scratchย with React JS.
  • Calling the CRUD (Create-Read-Update-Delete) endpoints from your client.
  • How to document the API endpoints with JSDoc and OpenAPI.
  • And so much more will be covered in this course.

This JavaScript course will also cover some great packages that will change your life during the development of an API efficiently.

You will learn to create very easily a design in a matter of minutes, without any complicated CSS (just a few reusable components).

You will learn how to embrace the power of “styled-components”.


Get Instant Notification of New Courses on our Telegram channel.


You will be able to add as many pages as needed in your React application thanks to React Router Dom.

At the end of this course, you will be comfortable enough to create an API from scratch by yourself, implement new endpoints, being comfortable with many packages (such as logging, rate-limiter, Yup schema validation, …).

Icing on the cake, you will be confident to create a frontend client from scratch and use those endpoints to interact with the backend on your frontend JavaScript application.

At the end of the course, you will even learn how you can create different unit tests for your API.

English
language

Content

Introduction

Project Introduction

Backend API

Create a project
Pre-checks. Environment Setup
NodeJS, NPM, Git, Git Config
Install necessary NPM packages
Install Nodemon for automatically reload any changes
Our first file (server.js)
Let’s speak with our backend (API)
Insomnia – Postman – REST clients for making HTTP requests very easily
HTTP Status Codes – Let’s make them readable
API Endpoints
Let’s design the architecture of our Simple API
Part 1 – Create a solid and flexible architecture for the API
Part 2 – Create a solid and flexible architecture for the API
Validate our endpoints
Secure our API – Potential Vulnerabilities
Let’s briefly see JSDoc and OpenAPI
Let’s git commit our simple RESTful API
Rate limiting and compressing your API
Adding Pino logging library for our NodeJS API

React Client

Let’s create our client React app
UsersList, Axios/Fetch and Installing dependencies
UsersList component – Implementation
Enhance UsersLis component
React Styled-Components
Use React Router
Create User component
Toastify messages and hadling error messages from API
Retrieve a user from our React component
Refactoring Layout-Navbar
Re-organized React client into multi-tiers
Edit a User
Delete a User
Footer and static pages
Optional – Convert axios with native JS Fetch
Enhance footer, little CSS/HTML tricks
Handle nicely an error message when no users on the homepage
Enhancement – Have a loading spinner when loading users

Unit tests (API)

Adding unit tests for our backend API

Source Code / GitHub Repositories

Part 34 – Pushing our code to GitHub