Hands-On Full Stack Development with Go
eBook - ePub

Hands-On Full Stack Development with Go

Build full stack web applications with Go, React, Gin, and GopherJS

  1. 324 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Hands-On Full Stack Development with Go

Build full stack web applications with Go, React, Gin, and GopherJS

Book details
Book preview
Table of contents
Citations

About This Book

Create a real-world application in Go and explore various frameworks and methodologies for full-stack development

Key Features

  • Build a responsive front end by using the powerful React framework
  • Build web APIs and middleware in the Go language by making use of the popular Gin framework
  • Build an Isomorphic Go React application via GopherJS
  • Perform unit tests, and benchmarking on your web API

Book Description

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.

What you will learn

  • Understand Go programming by building a real-world application
  • Learn the React framework to develop a frontend for your application
  • Understand isomorphic web development utilizing the GopherJS framework
  • Explore methods to write RESTful web APIs in Go using the Gin framework
  • Learn practical topics such as ORM layers, secure communications, and Stripe's API
  • Learn methods to benchmark and test web APIs in Go

Who this book is for

Hands-On Full Stack Development with Go will appeal to developers who are looking to start building amazing full stack web applications in Go. Basic knowhow of Go language and JavaScript is expected. The book targets web developers who are looking to move to the Go language.

Frequently asked questions

Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes, you can access Hands-On Full Stack Development with Go by Mina Andrawos in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming. We have over one million books available in our catalogue for you to explore.

Information

Year
2019
ISBN
9781789138658
Edition
1

Section 1: The Go Language

The objective of this section is to introduce the reader to the Go language. In this section of the book, the reader will gain practical knowledge of how to build effective software in Go.
This section consists of the following chapters:
  • Chapter 1, Welcome to Full Stack Go
  • Chapter 2, Building Blocks of the Go Language
  • Chapter 3, Go Concurrency

Welcome to Full Stack Go

This book is the result of an effort to provide you, the reader, with a very practical and concise learning tool for building full stack web applications in Go. Learning how to build full stack web applications in a powerful language such as Go can be a very valuable skill, as it allows you to write fully functional and scalable applications on your own. Go is known in the industry for both its performance and relative ease of use. This ensures that your applications can sustain growing data loads and expanding users, without suffering from scalability issues too early.
Full stack developers are the main drivers behind software startups; this is because of their ability to build products both quickly and efficiently from scratch. They are also typically the key members or the subject-matter experts (SMEs) in large corporations, as they help architect software systems, from the user interface down to the backend code. Even as an individual developer, learning full stack web programming can help you build your product ideas quickly, over a weekend or two.
In this chapter, we will cover the following topics:
  • What is full stack development?
  • What will we build?
  • The outline of this book

What is full stack development?

Before we take any further steps, we first need to answer a simple question; what does it really mean to be a full stack developer? A full stack developer can be defined as a software engineer who has the skill to work on both the frontend and the backend of an application.
The frontend of a web application is basically anything related to the user interface of the application. For web applications, the technologies that are needed to build the user interface are HTML, CSS, and JavaScript. In production environments, an application can support different types of frontends, depending on the device by which the user is viewing the web application. For example, a frontend on a mobile smartphone may need different rules to accommodate the limited screen size of the device, compared to a screen size of a large desktop monitor.
In order to make the application perform the tasks it is expected to do, the backend of a web application consists of all the software layers that need to communicate with the frontend of the application. The backend includes the database layers, the security layer, the user request-handling layer, all the API layers, and more. The backend of a web application can be written in any mature programming language. We will obviously be using Go as our backend language for this book.

What will we build?

Throughout this book, we will build a full stack web application from scratch. The application will be called GoMusic; it's a store for musical instruments written in React.js and Go. The following screenshot demonstrates how the main page will look:
Users will be able to browse the musical instruments in the store, buy what they like with their credit cards, and log in to their accounts to see their existing orders.
Let's take a look at the architecture of the application that we are going to build in this book.

The application architecture

Our application architecture will be relatively straightforward—we will use the extremely popular React.js framework for our frontend code, and then we will use the powerful Gin framework for our backend code. Gin comes with a wide array of useful packages that we will be using to build our web application. We will also make use of the Go object-relational mapping (GORM) package, which is one of the most popular object-relational mapping (ORM) layers in the Go language:
We'll build our application piece by piece, starting from the frontend, and then moving to the backend. We will cover some very important concepts in the world of modern web applications, such as reactive UIs, RESTful APIs, security, ORMs, credit card handling, testing, benchmarking, and more.
As we cover these different topics, we'll cover the majority of the code involved in building the application.
In the next section, we'll take a tour to discover the outline of this book, and what each chapter will cover.

The outline of this book

This book will cover numerous practical topics to help you acquire the deep skills necessary for a full stack developer:
  • In Chapter 2, Go's Building Blocks, and Chapter 3, Go Concurrency, we will take a deep and a practical tour into the Go language. You will learn about some of the key features of the language, as well as some of its popular design patterns.
  • In Chapter 4, Frontend with React.js, and Chapter 5, Building a Frontend for GoMusic, we will cover how to build beautiful and responsive frontend applications using the React.js framework. This is also where we'll start building our GoMusic web application. We will cover React's building blocks, design patterns, best practices, and more. The majority of the frontend code of the book project will be covered in Chapter 4, Frontend with React.js, and Chapter 5, Building a Frontend for GoMusic; however, we won't cover every single line of JavaScript code, so as not to lose focus. All the code will be available in the GitHub repository for this book.
  • In Chapter 6, RESTful Web APIs in Go with the Gin Framework, and Chapter 7, Advanced Web Go Applications with Gin and React, we will start building our backend code using the Gin framework. We will cover RESTful APIs, ORMs, secure web connections, and more.
  • In Chapter 8, Testing and Benchmarking Your Web API, we will learn how to test and benchmark our Go code using Go's testing package, and the best practices in the industry.
  • In Chapter 9, Introduction to Isomorphic Go with GopherJS, we will go through a crash course in isomorphic Go programming. Isomorphic Go programming is the practice of using Go for both the frontend and the backend. This is possible through the GopherJS framework. Chapter 9, Introduction to Isomorphic Go with GopherJS, is a standalone chapter, as it doesn't attempt to rebui...

Table of contents

  1. Title Page
  2. Copyright and Credits
  3. Dedication
  4. About Packt
  5. Contributors
  6. Preface
  7. Section 1: The Go Language
  8. Welcome to Full Stack Go
  9. Building Blocks of the Go Language
  10. Go Concurrency
  11. Section 2: The Frontend
  12. Frontend with React.js
  13. Building a Frontend for GoMusic
  14. Section 3: Web APIs and Middleware in Go
  15. RESTful Web APIs in Go with the Gin Framework
  16. Advanced Web Go Applications with Gin and React
  17. Testing and Benchmarking Your Web API
  18. Introduction to Isomorphic Go with GopherJS
  19. Where to Go from Here?
  20. Other Books You May Enjoy