Book Image

Full-Stack Web Development with Go

By : Nanik Tolaram, Nick Glynn
Book Image

Full-Stack Web Development with Go

By: Nanik Tolaram, Nick Glynn

Overview of this book

Go is a modern programming language with capabilities to enable high-performance app development. With its growing web framework ecosystem, Go is a preferred choice for building complete web apps. This practical guide will enable you to take your Go skills to the next level building full stack apps. This book walks you through creating and developing a complete modern web service from auth, middleware, server-side rendering, databases, and modern frontend frameworks and Go-powered APIs. You’ll start by structuring the app and important aspects such as networking, before integrating all the different parts together to build a complete web product. Next, you’ll learn how to build and ship a complete product by starting with the fundamental building blocks of creating a Go backend. You’ll apply best practices for cookies, APIs, and security, and level up your skills with the fastest growing frontend framework, Vue. Once your full stack application is ready, you’ll understand how to push the app to production and be prepared to serve customers and share it with the world. By the end of this book, you’ll have learned how to build and ship secure, scalable, and complete products and how to combine Golang with existing products using best practices.
Table of Contents (21 chapters)
1
Part 1: Building a Golang Backend
5
Part 2:Serving Web Content
9
Part 3:Single-Page Apps with Vue and Go
14
Part 4:Release and Deployment

What this book covers

Chapter 1, Building the Database and Model, looks at building our database for our sample application. We will also explore different ways to communicate with databases using Golang.

Chapter 2, Application Logging, considers how designing an application requires examining it internally without going through reams of code, and the only way to do this is by logging. We will learn how to do this by running a centralized logger that will host all of our logging information. We will also learn how to log from inside our application.

Chapter 3, Application Metrics and Tracing, considers how having logging applied inside our application will assist in troubleshooting issues when the application is running. The other thing that helps is information about the interaction of the different components inside our application, which we will also look at in this chapter.

Chapter 4, Serving and Embedding HTML Content, sees us begin work on implementing the REST endpoints needed for our financial application. The first version of the app will show simple content rendered by the backend.

Chapter 5, Securing the Backend and Middleware, notes that we need to secure our application so that we can ensure users see only the data that they should. We will discuss some of the ways we can protect our endpoints using cookies, session management, and other types of middleware available.

Chapter 6, Moving to API - First, starts by laying the groundwork for frontend applications to consume our data. We’ll introduce marshaling/unmarshaling data into custom structures and see how to set up JSON-consuming endpoints and use cURL to verify.

Chapter 7, Frontend Frameworks, discusses the state of web development, introduces the React and Vue frameworks, and sees us employ them to create a simple app that's similar to our previous one.

Chapter 8, Frontend Libraries, examines how to leverage tools and libraries to help us, as full stack developers, work fast!

Chapter 9, Tailwind, Middleware, and CORS, has us securing our app and getting it talking to our Go-powered backend.

Chapter 10, Session Management, focuses on session management while introducing state management with Vuex and how to structure apps based on user permissions.

Chapter 11, Feature Flags, introduces feature flags (sometimes called feature toggles) as a technique deployed to enable/disable certain features of the application as required, depending on a given condition. For example, if a newly deployed application containing a new feature has a bug and we know it will take time for the bug to be fixed, the decision can be made to turn off the feature without deploying any new code to do so.

Chapter 12, Building Continuous Integration, notes that while building applications is a big part of the puzzle, we need to be sure that what the team builds can be validated and tested properly. This is where continuous integration comes in. Having a proper continuous integration process is super important to ensure that everything deployed to production has been tested, verified, and checked securely.

Chapter 13, Dockerizing an Application, notes that while developing an application is one side of the coin, the other side is to make sure that it can be deployed and used by our end user. To make deployment simpler, we can package applications such that they can be run inside a container. Operationally, this allows applications to be deployed in the cloud from anywhere.

Chapter 14, Cloud Deployment, shows how deploying applications to a cloud environment is the last step in delivering features for the end user to use. Cloud deployment is complex and sometimes quite specific to particular cloud vendors. In this chapter, we will focus on deploying applications into the AWS cloud infrastructure.