Working with React and Go (Golang)

Learn how to build a single page application in React, with data supplied by a Go back end REST API

  • 0.0 (0 Reviews)
  • 0 Students
  • 123 Lessons
  • Trevor Sawler

Course Overview

React and Go are something of a match made in heaven. React is the world's most popular JavaScript library for building Single Page Applications, and Go is uniquely well-suited for building REST back ends. That is what this course is all about.

This course has been completely re-done, for React version 18 and React Router version 6. The old version of this course is still available at the end of the new one, with each section marked as "Legacy." I'll remove it in a month or so, just to give people who have already started a chance to finish that version, if they so desire.

Learn how to develop and deploy a fast, secure web application built using the most popular and in-demand JavaScript front end (React), with one of the most popular and powerful programming languages for the back end (Go).

React is an open-source, front end JavaScript library for building user interfaces or UI components. React is maintained by Facebook and a community of developers and companies. React can be used as a base in the development of single-page or mobile applications. React is the most popular front-end JavaScript library in the field of web development, and is used by many well-known organizations, including Netflix, Instagram, and the New York Times. With React, we build fast, interactive user interfaces.

Go is a modern, type safe, compiled, and extremely fast programming language. It it is ideally suited for building safe, scalable, incredibly fast REST APIs and web applications, and is also used by large corporations around the wold, including Netflix, Instagram, American Express, and the New York Times.

If you were paying attention, you might have noticed some overlap there -- the same large companies using React are also using Go. There is a reason for that, and we will be exploring that reason in this course.

In this course we will go over the core fundamentals of React, including the React life cycle, components, functional components, props, state, and more. We will also cover calling a remote API (both one we build, and a 3rd party API), and much more.

In the first part of the course, we'll build a simple application using both React class component and Functional Components with hooks. Although hooks and functions appear to the the future for React, there are literally millions of lines of code out there built using classes, so it's important to know how to work with React using both classes and functions & hooks.

In the second project for this course, we'll build a Single Page Web Application (SPA) with a React front end and a Go back end API, where we will  cover receiving requests on the back end, both as JSON and as GraphQL, and returning that response as JSON.

In order to secure access to authenticated users for certain parts  of our site, we will also explore how to generate and use JSON Web Tokens (JWT), including refresh tokens.

This course is not intended for absolute beginners. I expect that you have some experience in JavaScript and Go, and a good knowledge of HTML.

Please note that this course requires you to download Docker Desktop from Docker. If you are a Udemy Business user, please check with your employer before downloading software.

See more

FAQ

FAQ area empty

Course curriculum

13 chương 123 bài học 12 giờ 53 phút 7 bài học thử miễn phí
Chương 1 Introduction
Chương 2 Setting up our development environment
Chương 3 Getting Started with React
  • How React works 13:41
  • Hello world with React using Classes 4:59
  • Hello world with React using functional components 6:42
  • Styling Components 3:51
  • Using Bootstrap CSS Học thử 3:08
  • Using props: passing data to components 4:57
  • React and State I 9:19
  • React and State II Học thử 6:47
  • React and State III 9:23
  • React and State IV 6:18
  • React and State V 6:45
  • Intercepting form submissions with onSubmit() 3:21
  • HandleSubmit() continued 5:52
  • Ref: using references in React 3:29
  • References with components: forwardRef() 3:20
  • Class Lifecycle 13:58
Chương 4 Getting started with our main project: Go Watch a Movie
  • Getting started with our project 2:48
  • Setting up the application layout 11:37
  • Getting started with React Router v6 3:57
  • Configuring React Router 7:14
  • Using React Router's Link 10:22
  • Working on the Movies component 7:48
  • Routing from the Movies component to individual movies 2:22
  • Displaying an individual movie 5:28
Chương 5 Setting up User Login
  • Working on the Login button 5:11
  • Creating the login form 12:45
  • Giving the Login component access to setJWT 4:26
  • Adding error messages and redirects to the Login component 9:00
  • Logging out 2:34
Chương 6 Getting started with our Back End API
  • Starting the back end API 9:55
  • Adding handlers and routes to our API 6:55
  • Installing a routing package 4:11
  • Adding a route to our handlers 2:42
  • Returning JSON from our API 6:02
  • Returning a list of movies as JSON 10:51
  • Connecting the front end to the back end API 4:45
  • Enabling CORS middleware 7:04
  • Enabling React's proxy to the back end API 2:49
Chương 7 Connecting to Postgres
  • Setting up our database using Docker 6:12
  • Getting started connecting our API to Postgres 3:24
  • Installing a database driver and connecting to Postgres 9:02
  • Setting up a database repository I 15:59
  • Setting up a database repository II 5:39
  • Improving the allMovies handler to use our database 3:06
Chương 8 Working with JSON
  • Setting up utils.go and a writeJSON helper function 7:10
  • Adding a readJSON helper function 6:19
  • Adding an errorJSON helper function 2:22
  • Using our errorJSON helper function 1:31
Chương 9 Authentication with JWT
  • Installing a JWT package 8:09
  • Generating tokens 13:11
  • Setting default values for JWT tokens 6:09
  • Creating a handler to generate a JWT 3:42
  • Trying out our handler 2:12
  • Generate refresh token cookie 5:46
  • Reading a JSON payload in the authenticate handler 2:07
  • Looking up a user by email 7:45
  • Validating a password 6:40
  • Updating the Login component on the front end 8:45
  • Refresh tokens I 10:11
  • Refresh tokens II 4:18
  • Refresh tokens III 5:31
  • Refresh tokens IV 8:59
  • Refresh tokens V 9:33
  • Protecting routes using JWT tokens 13:41
  • Authentication middleware 2:42
  • Adding our middleware to routes 3:09
  • Trying our our protected routes 9:12
Chương 10 Create/Read/Update/Delete for our Movie Catalogue
  • Starting on the Add/Edit movie component 4:12
  • Creating a select component 5:30
  • Creating a checkbox component 3:03
  • Using our input controls to create the edit movie form 13:51
  • Continuing to work on the EditMovie component 9:00
  • Getting a movie and Genres from the database 19:33
  • Creating handlers to get movies for public and admin 8:36
  • Displaying a movie to the public on the front end 8:50
  • Getting started with showing genres on the Add/Edit movie component 7:29
  • Adding checkboxes for genres to the front end form 18:31
  • Enabling checkbox clicks on the EditMovie component 4:58
  • Validation I 5:47
  • Validation II 6:16
  • Creating a database method to insert a movie 4:17
  • Creating a handler to insert a movie 3:03
  • Getting a movie image from a remote API I 12:34
  • Getting a movie image from a remote API II 2:35
  • Handling genres when inserting a movie 5:51
  • Inserting a movie from the front end 7:36
  • Trying out adding a movie 2:35
  • Editing an existing movie I 10:01
  • Editing an existing movie II 1:50
  • Editing an existing movie III 3:18
  • Writing the handler to update a movie 5:25
  • Trying out editing a movie from the front end 3:31
  • Getting started with deleting a movie 6:19
  • Deleting a movie II 2:01
  • Deleting a movie III 2:36
  • Deleting a movie IV 1:43
Chương 11 Displaying movies by Genre
  • Getting started with listing movies by Genre 4:23
  • Creating a handler to list movies by Genre 3:14
  • Modifying the front end to list movies by Genre 8:40
  • Creating the OneGenre component 10:49
Chương 12 GraphQL
  • Getting started with GraphQL 9:28
  • GraphQL II 11:42
  • GraphQL III 4:35
  • Creating a handler for GraphQL 5:37
  • Connecting to our GraphQL endpoint from the front end 15:58
  • Adding search functionality 7:12
Chương 13 Deploying our application
  • Configuring environment variables with .env 7:09
  • Preparing the back end for deployment 3:35
  • Dumping our database for the live server 2:14
  • Copying files to the server for deployment 5:45
  • Populating the database on the live server 6:27
  • Starting our back end with Supervisor 7:42
  • Configuring Caddy 7:44
  • Trying out our live application 2:26
  • Fixing the Genres component 3:22

Requirment

  • A basic knowledge of the Go programming language

  • A basic knowledge of Javascript

  • A basic knowledge of HTML

Outcomes

  • Build amazing single page applications with React JS

  • Build reusable, composable components in React

  • Build a REST API in Go that handles JSON requests, and serves JSON responses

  • Build an API in Go that handles GraphQL requests

Instructor

...
Trevor Sawler

0.0

  • ... 0 Student
  • ... 9 Courses
  • ... 0 review

View Details

Reviews

Rate this course :

Remove all