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. Table of Contents Welcome to Full Stack Go Building Blocks of the Go Language Go Concurrency Frontend with React.js Building a Frontend for GoMusic RESTful Web APIs in Go with the Gin Framework Advanced Web Go Applications with Gin and React Testing and Benchmarking Your Web API Introduction to Isomorphic Go with GopherJS Where to Go from Here? Cover Title Page Copyright and Credits Dedication About Packt Contributors Table of Contents Preface Section 1: The Go Language Chapter 1: Welcome to Full Stack Go What is full stack development? What will we build? The application architecture The outline of this book Chapter 2: Building Blocks of the Go Language Technical requirements Go's playground Setting up Go's workspace Packages, variables, data types, and pointers Packages Variables and data types Pointers Functions and closures Functions – the basics Functions – accessing functions from other packages Closures Go data structures Arrays Slices Maps Struct Methods Type embedding Interfaces Conditional statements and loops The if statement The switch statement Loops Panics, recovers, and defers Summary Questions Further reading Chapter 3: Go Concurrency What is concurrency? Goroutines Go channels Regular channels Buffered channels The select statement The sync package The simple mutex The read-write mutex Wait groups Summary Questions Further reading Section 2: The Frontend Chapter 4: Frontend with React.js Prerequisites and technical requirements The GoMusic project Node.js and the npm HTML, CSS, and Bootstrap Project code The React framework How to construct React applications Setting up the project Installing React Preparing the new project JSX and React elements React components React application design Props State Initializing the state object Setting our state Developer tools Summary Questions Further reading Chapter 5: Building a Frontend for GoMusic Prerequisites and technical requirements Building GoMusic Main pages The navigational menu The Products and Promotions pages The About page Modal dialog windows and handling credit cards The Buy Item modal window outline Credit card handling with React and Stripe Creating a child React component to host Stripe elements Making use of Stripe elements to handle credit card information Submitting a credit card token to the backend Creating a parent StripeProvider component The Sign in and Register modal windows Handling forms in the React framework The Sign in page The Registration form User pages The orders page The user page navigational menu Putting it all together – routes Summary Questions Further reading Section 3: Web APIs and Middleware in Go Chapter 6: RESTful Web APIs in Go with the Gin Framework Technical requirements RESTful APIs Overview The client-server architecture URLs HTTP methods The Gin framework Models and the database layer Models The database layer interface Implementing RESTful APIs using the Gin framework Defining routes Creating handlers Getting a full list of available products Getting a list of promotions Sign in new users or add new users Sign out requests Getting orders for a specific user Charging a credit card Putting it all together Summary Questions Further reading Chapter 7: Advanced Web Go Applications with Gin and React Technical requirements The database layer Relational databases Setting up The customer table The orders table The products table ORM GORM Implementing the database layer Middleware Custom middleware Security Certificates and private keys Establishing trust between the client and the server Agreeing on, and using an encryption key Supporting HTTPS in Gin Password hashing Implementing password hashing Comparing the password Credit card handling Credit card handling at the backend Revisiting the frontend code The app structure Interactions between the frontend and the backend Using cookies Deploying the frontend application Summary Questions Further reading Chapter 8: Testing and Benchmarking Your Web API Testing in Go Mocking Creating a mock db type Unit testing in Go Table-driven development Benchmarking Summary Questions Further reading Chapter 9: Introduction to Isomorphic Go with GopherJS Technical requirements GopherJS fundamentals GopherJS types Object types Calling JavaScript functions from your Go code GopherJS commands Go bindings Exporting code Go Methods Goroutines GopherJS with React The project The project application's architecture Building the React application in Go Building a custom component Summary Questions Further reading Chapter 10: Where to Go from Here? Cloud-native applications Microservices Containers Serverless applications Continuous delivery React Native What is React Native? React.js versus React Native Similarities between React.js and React Native Differences between React.js and React Native Expo Summary Questions Other Books You May Enjoy Index Create a real-world application in Go and explore various frameworks and methodologies for full-stack development Key Features Organize your isomorphic codebase to enhance the maintainability of your application Build web APIs and middleware in the Go language by making use of the popular Gin framework Implement real-time web application functionality with WebSockets 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. Downloading the example code for this book You can download the exampl .. 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 then 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 Go programming has been rapidly adopted by developers for building web applications. With its ecosystem growing in size and its stable architecture, Go offers a library 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 ...