2nd edition (video format) is almost completed. There's a 50% discount available now.

Need a fast and scalable web API, Go is a great choice

Learn how to build an API-first web app in Go from scratch through to taking online payments with Stripe.


Buy now $39 $19.50

If you've never thought of using Go for a web API let me teach you. It's easy, quick and it's fun!

I'm Dominic St-Pierre

My blog | @dominicstpierre

Together we'll ensure you acquire all the knowledge you'll need to go on your own and build a web backend application with Go. We'll dive deep into the building blocks of a typical web app using only Go's standard library.

I've built two successful SaaS applications in the last four years using these techniques. They are LeadFuze and Roadmap and I use the same stack, techniques and process that'll I teach in this book.

Go is a fantastic language. You'll be productive in less than one week. Its simplicity will surprise you. Go is a first-class option to build cloud-native backend API and processes. You'll be able to apply the concrete knowledge you'll learn in this course to your day-to-day programming tasks.

Pre-requisites

The book assumes you already have Go setup and that you've followed some getting started tutorials and written at least one function by yourself in Go.
Basics knowledge of the HTTP requests/responses life-cycle would be helpful. Knowing what a REST API is, HTTP methods, JSON format. The book would be best if you've already built a web application in another language. In short, if you're beginning your web development journey, this might not be the right book for you.

Get a free sample chapter

You can take a look at chapter 8: Billing and subscription for free. Submit your email address and you'll get instant access to the sample chapter PDF.
Get the free sample chapter

 

Your web engine in ~100 lines of code

I'm one of those that believe that Go's HTTP package is more than enough to craft a simple and lightweight web engine without any 3rd party dependencies.

We create an engine package capable of handling your future needs including middleware and basic things like a logger, json parsing and decoding and a router.

No matter what your position regarding the use of existing frameworks or routers, the topics covered can help you better understand how web servers works and the life-cycle of HTTP requests and their responses.

Buy now

We use Go's interface for the data package

When I initially came up with the table of contents for the book I picked MongoDB as the database for no particular reason other than the ease of changing the data model.

That created some debate in the community. I decided to create the data package with both implementations for MongoDB and PostgreSQL. There's also an in-memory data store used for integration tests.

This chapter shows excellent use of Go's interface, and hopefully, you will reuse the concepts elsewhere in your future applications. We're also covering build tags to compile specific implementations of the data package.

Buy now

I'm here to help.

I've continued the project and turned it into an open source Go library. I'm already using the library into my projects. If you want to discuss the book or the evolving library, feel free to join the GitHub repository.

You may see this as after sale support. I'm very interested in talking with you and know more about your projects. I'm always happy to help if I can.

I've created two screencasts video of me using the book's content to rebuild the book website. That project did not complete, but the videos are still there to compliment the book. I'm always adding content that was not part of the original package at no extra cost.

Buy now

 

Table of content

Here's what you'll find inside the book.

1. Let's Go

Create a simple web application to get started with Go.

2. A ~100 line web engine

We craft a tiny foundation with no dependencies.

3. Tests are important

Balance speed of development against the importance of tests.

4. The data package

MongoDB or PostgreSQL, we're doing both so you pick your favorite.

5. API-first my friend

Your users want an API, give them it on day 1.

6. Authorization middleware

How users are created and how they can authenticate & authorize requests.

7. API throttling, limits

Make sure you prevent abusive usage of your API.

8. Billing and subscriptions

We use Stripe to build a full real-world billing system.

9. Emails & background tasks

Go routines in all their glory, no need for external processes.

10. Capture and replay

Log failed requests and run them against your dev environment.

11. Webhooks

You'll have important events occurring, let your users react.

12. Lessons learned since 2008

I talk about mistakes, what worked and what did not work with the products I built.

 

Purchase option

Build a SaaS app in Go

Book + Source Code

145+ pages PDF and ePub version
local Git repo with branches for each chapter
2 videos (53 minutes)

2nd edition (videos course)

28 lessons, more than 4.5 hours of videos
Revised content started in 2021
Adding new modules

$39 $19.50

 

I'll not email you regarding anything else other than the book

I will send you email on updates related to the book.

 

Thank you so much. I started writing this book in October 2017 and realized it is tough to write a book with accompanying source code and keep everything concise.

I would appreciate any feedback, comments, testimonials, and shares you can do.

Happy coding.