Book Image

Hands-On Full Stack Development with Go

By : Mina Andrawos
Book Image

Hands-On Full Stack Development with Go

By: Mina Andrawos

Overview of this book

The Go programming language has been rapidly adopted by developers for building web applications. With its impressive performance and ease of development, Go enjoys the support of a wide variety of open source frameworks, for building scalable and high-performant web services and apps. Hands-On Full Stack Development with Go is a comprehensive guide that covers all aspects of full stack development with Go. This clearly written, example-rich book begins with a practical exposure to Go development and moves on to build a frontend with the popular React framework. From there, you will build RESTful web APIs utilizing the Gin framework. After that, we will dive deeper into important software backend concepts, such as connecting to the database via an ORM, designing routes for your services, securing your services, and even charging credit cards via the popular Stripe API. We will also cover how to test, and benchmark your applications efficiently in a production environment. In the concluding chapters, we will cover isomorphic developments in pure Go by learning about GopherJS. As you progress through the book, you'll gradually build a musical instrument online store application from scratch. By the end of the book, you will be confident in taking on full stack web applications in Go.
Table of Contents (15 chapters)
Free Chapter
1
Section 1: The Go Language
5
Section 2: The Frontend
8
Section 3: Web APIs and Middleware in Go

What this book covers

Chapter 1, Welcome to Full Stack Go, provides an introduction to the topics covered in the book, as well as an overview of the architecture of the application that will be built throughout the book. This chapter also provides us with a glimpse of what to expect from the book.

Chapter 2, Building Blocks of the Go Language, introduces us to the building blocks of the Go language, and how to utilize them to build simple applications. It starts by covering Go's syntax for variables, conditional statements, loops, and functions. From there, it covers how to construct data structures in Go, and how to attach methods to them. It then concludes by focusing on learning how to write interfaces that can describe the behaviors of our program.

Chapter 3, Go Concurrency, covers the concurrency features of the Go language. It covers Go's concurrency primitives, such as goroutines, channels, and select statements, and then moves to cover some important concepts for productive concurrent software, such as locks, and wait groups.

Chapter 4, Frontend with React.js, covers the building blocks of the extremely popular React.js framework. It starts by taking a look at React components, which are the foundation for the React framework. From there, it covers props for passing data to components. And finally, it describes handling state and using developer tools.

Chapter 5, Building a Frontend for GoMusic, builds our GoMusic frontend with the knowledge gained from the previous chapter. It builds the React components needed for the GoMusic store, and makes use of React's developer tools to troubleshoot the frontend. The majority of the frontend code will be covered in this chapter.

Chapter 6, RESTful Web APIs in Go with the Gin Framework, introduces you to RESTful Web APIs and the Gin framework. It then goes ahead and dives into the key building blocks of Gin, and explains how to start writing Web APIs with it. It also covers how to do HTTP request routing and how to group HTTP request routes in Gin.

Chapter 7, Advanced Web Go Applications with Gin and React, discusses more advanced topics regarding the Gin web framework and our backend Web APIs. It covers important practical topics such as how to extend functionality by using middleware, how to achieve user authentication, how to attach logs, and how to add validations to our model bindings. It also covers the concept of ORMs, and how to connect our Web API backend to a MySQL database through a Go ORM. At the end, it will cover some of the remaining React code, then we will discuss how to connect the React app to our Go backend. The chapter also covers how to build and deploy a React application to production.

Chapter 8, Testing and Benchmarking Your Web API, discusses how to test and benchmark the Go application. It will help us to learn about the types and methods that can be used with the testing package to create unit tests that can be integrated with the code. It will then focus on learning how to benchmark our code to inspect its performance.

Chapter 9, Introduction to Isomorphic Go with GopherJS, covers GopherJS, which is a very popular open source project that helps to transpile Go's code into JavaScript, which in effect allows us to write frontend code in Go. If you are looking to write your frontend in Go instead of JavaScript, GopherJS is the way to do it. This chapter will discuss the basics of GopherJS, then cover some examples and use cases. We will also discuss how to combine GopherJS with React.js, by building a simple React application in GopherJS.

Chapter 10, Where to Go from Here? provides suggestions for where to continue the learning journey from here. It talks about cloud-native architectures, containers, and mobile app development using React Native.