Save 30% until December 31st 2018, get your copy today before the deal ends!

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 $49 $35

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 build a strong, API-first, reusable codebase suitable for building a SaaS or vanilla web application. By the end of the book you'll have a solid framework to use as the starting point for future projects.

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. We'll dive deep in to the excellent Golang HTTP package and you'll learn useful knowledge that can be used with any other language.


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.

Sign up to our mailing list and I’ll send you a preview chapter. I’ll also send you updates when there's new version available, but nothing else. I won’t send you any emails that don’t relate directly to this book. You can unsubscribe at any time.


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.

After your purchase, you'll receive an invitation to join a private Discourse community where I can help with anything related to the book. You'll also receive additional content, live streaming video from me and can share about your project if you want.

You can think of this as after sale support and a place where I continue to build on top of the engine we created in the book.

I'll live stream the development of a fictitious real-world SaaS that uses the techniques and concepts taught in the book. These will be live videos without editing. They are not screencasts.

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
access to the private forum

$49 $35


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.