Web Development with Go

Learn to build real, production-grade web applications from scratch.

  • 👉 No trivial TODO apps that barely touch the complexity of a real app.
  • 👉 No frameworks that hide all the details.

In this course we build and deploy a photo sharing application complete with users, authentication, image uploads, a database, and more. We even deploy to a production server and set up automatic HTTPS.

"All you need is the standard library"

- Everyone on r/golang

I can't tell you the number of times I heard this when learning to build my first web app in Go. After a while, it started to haunt me. It isn't that this advice is incorrect; it just isn't that helpful by itself.

It felt like someone was telling me, "You can build a house, all you need is a hardware store!" And I kept hearing it over and over again.

While this advice is mostly true - you absolutely can build a web app in Go using nothing but the standard library - it wasn't helpful. It didn't get me any closer to building a real application. I was still left with questions like:

  • How should I share a database connection with my http handlers while not making it a global variable?
  • How can I securely hash a user's password and build an authentication system?
  • How should I be organizing my code? MVC? Domain Driven Design? Hexagonal? Something else?
  • What about REST? How does that fit into this all?

What I really needed was guidance. Someone to show me the correct way to build a web application so I didn't waste countless hours figuring it out myself.

Web Applications are Complex Systems

No matter how many tutorials I read, I always felt like there was something left out. Some part of the bigger picture that wasn't explained, leaving me unsure of how to proceed. Or the tutorial was oversimplified to the point that it felt useless in the grand scheme of things.

After building several TODO apps I nearly gave up. My progress was painfully slow, and every time I figure out one major problem I would be left with two new questions that weren't addressed by the oversimplified tutorials.

In the end, I was lucky. I happened to have a history building web applications using other programming languages, and with that knowledge I was able to piece things together. It wasn't quick or easy, but it all slowly started to make sense.

What if you didn't have to struggle through hundreds of tutorials?

What if you didn't have to go through the painful process I did to learn how to build web services in Go? What if you could skip reading hundreds of tutorials all teaching roughly the same thing just to get one new tidbit of information out of it? You would finally be ready to build that application you have been considering, or apply for that job you had your eye on.

Web Development with Go will help you cut through all the complexity and finally become the developer you know you should be.

"Web development with Go absolutely saved me from giving up on Go. Before finding this course I kept hitting roadblock after roadblock. I can't tell you how excited I was when I realized just how approachable and productive this course is. I went from struggling to get even the most basic tasks completed to actually building out my own app idea. I can't wait to release it!"

Web Development with Go is the course I wish I had

This course takes everything I have learned over years of building web applications and distills it into easy to consume lessons. By the end of the course you will build a complete web application, deploy it to a production server, and understand why you took every step along the way. You will also...

  • Know exactly how to initialize your database connection and share it without resorting to global variables or other hard to test anti-patterns.
  • Feel confident saying, "Yes, my authentication system is safe and secure!"
  • Understand how to organize your code, and how to weigh the trade-offs of various code structures.
  • Have clear examples of how to email users and build a complete "Forgot your password?" workflow.
  • And so much more!

This is possible because this is not your run of the mill course. It is a comprehensive breakdown of every little detail you need to know when building and deploying a real web application.

Web Development with Go spans nearly 40 hours of screencasts, and the ebook is roughly 700 pages. Even after completing the course, you will be referencing the material for years to come.

Jon does a great job of taking the large task of creating a web application and breaks it down into steps that are easy to understand and follow along with. If you want to learn how web development works at its very core I can't recommend it enough.

Liam Randall

Want to sample the course?

Watch 14 screencasts for free!

Interested in checking out a sample of the course to see if it is a good fit for you? No problem! Sign up to my mailing list below and I'll send over a course preview that includes 14 screencasts.

    Not sure if you want to provide your email address just yet? Here is the first lesson, no signup needed 😁

    What You Will Build

    and Deploy!

    Throughout the course you will be building LensLocked, a photo sharing application. Users can sign up, create galleries, and upload photos to create a gallery. After a gallery is completed it can be published, making it publicly accessibly to anyone with the URL.

    While building the application we will learn about uploading images, interacting with a PostgreSQL database, limiting access to resources you have permission to edit, and if you purchase one of the packages with bonus material we will also look at how to integrate with a third party API like Dropbox using OAuth.

    I loved the Web Development with Go course. Excellent content and very well presented. A unique opportunity to tap into the knowledge of an experienced developer and great teacher.

    Robin Brandt

    Simple Pricing with Lifetime Access.

    Trusted by over 5000 developers

    Complete Package

    The complete package includes everything you need to learn web development with Go. Over 280 screencasts spanning nearly 40 hours, written versions of every lesson, all the bonus content, access to the Web Development with Go Slack, source code, and FREE updates for life!

    Pay once, own it forever

    $299

    The Lessons

    A whole lot of them!

    Section 1: Getting Started
    A Basic Web Application (Sample)
    Troubleshooting and Slack
    Packages and Imports (Sample)
    Editors and Automatic Imports (Sample)
    The "Hello, World" Part of our Code (Sample)
    Web Requests (Sample)
    HTTP Methods (Sample)
    Our Handler Function (Sample)
    Registering our Handler Function... (Sample)
    Go Modules (Sample)
    Section 2: Adding New Pages
    Dynamic Reloading (Sample)
    Setting Header Values (Sample)
    Creating a Contact Page (Sample)
    Examining the http.Request Type (Sample)
    Custom Routing (Sample)
    URL Path vs RawPath
    Not Found Page
    The http.Handler Type
    The http.HandlerFunc Type
    Exploring Handler Conversions
    FAQ Exercises
    Section 3: Routers and 3rd Party Libraries
    Defining our Routing Needs
    Using git
    Installing Chi
    Using Chi
    Chi Exercises
    Section 4: Templates
    What are Templates?
    Why Do We Use Server Side Rendering?
    Creating Our First Template
    Cross Site Scripting (XSS)
    Alternative Template Libraries
    Contextual Encoding
    Home Page via Template
    Contact Page via Template
    FAQ Page via Template
    Template Exercises
    Section 5: Code Organization
    Code Organization
    MVC Overview
    Walking Through a Web Request with MVC
    MVC Exercises
    Section 6: Starting to Apply MVC
    Creating the Views Package
    fmt.Errorf
    Validating Templates at Startup
    Must Functions
    Exercises
    Section 7: Enhancing our Views
    Embedding Template Files
    Variadic Parameters
    Named Templates
    Dynamic FAQ Page
    Reusable Layouts
    Tailwind CSS
    Utility-first CSS
    Adding a Navigation Bar
    Exercises
    Section 8: The Signup Page
    Creating the Signup Page
    Styling the Signup Page
    Intro to REST
    Users Controller
    Decouple with Interfaces
    Parsing the Signup Form
    URL Query Params
    Exercises
    Section 9: Databases and PostgreSQL
    Intro to Databases
    Intalling Postgres
    Connecting to Postgres
    Update: Docker Container Names
    Creating SQL Tables
    Postgres Data Types
    Postgres Constraints
    Creating a Users Table
    Inserting Records
    Querying Records
    Filtering Queries
    Updating Records
    Deleting Records
    Additional SQL Resources
    Section 10: Using Postgres with Go
    Connecting to Postgres with Go
    Imports with Side Effects
    Postgres Config Type
    Executing SQL with Go
    Inserting Records with Go
    SQL Injection
    Acquire a new Record's ID
    Querying a Single Record
    Creating Sample Orders
    Querying Multiple Records
    ORMs vs SQL
    Exercises
    Syncing the Book and Screencasts Source Code
    Section 11: Securing Passwords
    Steps for Securing Passwords
    Third Party Authentication Options
    What is a Hash Function?
    Store Password Hashes, Not Encrypted or Plaintext Values
    Salt Passwords
    Learning bcrypt with a CLI
    Hashing Passwords with bcrypt
    Comparing a Password with a bcrypt Hash
    Section 12: Adding Users to our App
    Defining the User Model
    Creating the UserService
    Create User Method
    Postgres Config for the Models Package
    UserService in the Users Controller
    Create Users on Signup
    Sign In View
    Authenticate Users
    Process Sign In Attempts
    Section 13: Remembering Users with Cookies
    Stateless Servers
    Creating Cookies
    Viewing Cookies with Chrome
    Viewing Cookies with Go
    Securing Cookies from XSS
    Cookie Theft
    CSRF Attacks
    CSRF Middleware
    Providing CSRF to Templates via Data
    Custom Template Functions
    Adding the HTTP Request to Execute
    Request Specific CSRF Template Function
    Template Function Errors
    Securing Cookies from Tampering
    Cookie Exercises
    Section 14: Sessions
    Random Strings with crypto/rand
    Exploring math/rand
    Wrapping the crypto/rand package
    Why Do We Use 32 Bytes for Session Tokens?
    Defining the Sessions Table
    Stubbing the SessionService
    Sessions in the Users Controller
    Cookie Helper Functions
    Create Session Tokens
    Refactor the rand Package
    Hash Session Tokens
    Insert Sessions into the Database
    Update Existing Sessions
    Query Users via Session Token
    Deleting Session
    Sign Out Handler
    Sign Out Link
    Session Exercises
    Section 15: Improved SQL
    SQL Relationships
    Foreign Keys
    On Delete Cascade
    Inner Join
    Left, Right, and Full Outer Join
    Using Join in the SessionService
    SQL Indexes
    Creating PostgreSQL Indexes
    On Conflict
    Improved SQL Exercises
    Section 16: Schema Migrations
    What are Schema Migrations?
    How Migration Tools Work
    Installing pressly/goose
    Converting to Schema Migrations
    Schema Versioning Problem
    Run Goose with Go
    Embedding Migrations
    Go Migration Files
    Removing Old SQL Files
    Section 17: Current User via Context
    Using Context to Store Values
    Improved Context Keys
    Context Values with Types
    Storing Users as Context Values
    Reading Request Context Values
    Set the User via Middleware
    Requiring a User via Middleware
    Accessing the Current User in Templates
    Request-Scoped Values
    Section 18: Sending Emails to Users
    Password Reset Overview
    SMTP Services
    Building Emails with SMTP
    Sending Emails with SMTP
    Building an Email Service
    EmailService.Send
    Forgot Password Email
    ENV Variables
    Section 19: Completing the Authentication System
    Password Reset DB Migration
    Password Reset Service Stubs
    Forgot Password HTTP Handler
    Asynchronous Emails
    Forgot Password HTML Template
    Initializing Services with ENV Vars
    Check Your Email HTML Template
    Reset Password HTTP Handlers
    Reset Password HTML Template
    Update Password Function
    Implementing PasswordReset.Create
    Implementing PasswordReset.Consume
    Section 20: Better Errors
    Inspecting Errors
    Inspecting Wrapped Errors
    Designing the Alert Banner
    Dynamic Alerts
    Removing Alerts with JavaScript
    Detecting Existing Emails
    Accepting Errors in Templates
    Public vs Internal Errors
    Creating Public Errors
    Using Public Errors
    Better Error Handling Exercises
    Section 21: Galleries
    Galleries Overview
    Gallery Model and Migration
    Creating Gallery Records
    Querying for Galleries by ID
    Querying Galleries by UserID
    Updating Gallery Records
    Deleting Gallery Records
    New Gallery Handler
    views.Template Name Bug
    New Gallery Template
    Gallery Routing and CSRF Bug Fixes
    Create Gallery Handler
    Edit Gallery Handler
    Edit Gallery Template`
    Update Gallery Handler
    Gallery Index Handler
    Discovering and Fixing a Gallery Index Bug
    Gallery Index Template Continued
    Show Gallery Handler
    Show Gallery Template and a Tailwind Update
    Extracting Common Gallery Code
    Extra Gallery Checks with Functional Options
    Delete Gallery Handler
    Gallery Exercises
    Section 22: Images
    Images Overview
    Setting Up Test Images
    Adding the ImagesDir to the GalleryService
    Globbing Image Files
    Adding Filename and GalleryID to the Image Type
    Adding Images to the Show Gallery Page
    Show Image Handler
    Querying for a Single Image
    URL Path Escaping Image Filenames
    Adding Images to the Edit Gallery Page
    Delete Image Form
    Delete Image Service Func
    Delete Image Handler
    Checking for Filename Vulnerabilities
    Upload Image Form
    Image Upload Handler
    Creating Images in the GalleryService
    Detecting Content Type
    Rendering Content Type Errors
    Section 23: Preparing for Production
    Loading All Config via ENV
    Docker Compose Overrides
    Building Tailwind Locally
    Tailwind Via Docker
    Serving Static Assets
    Making main Easier to Test
    Running our Go Server via Docker
    Multi-Stage Docker Builds
    Tailwind Production Build
    Caddy Server via Docker
    Section 24: Deploying
    Creating a Digital Ocean Droplet
    Setting up DNS
    Installing Git on the Server
    Setting Up a Bare Git Repo
    Setting Up a Local Git Repo
    Checking Out Our Code on the Server
    Email Sending Server Setup
    Production .env File
    Install Docker in Prod
    Production Caddyfile
    Production Data Directories
    Running Our App in Prod
    Post-receive Deploy Updates
    Deploy via Git
    Logging Services
    Bonus: OAuth
    Intro to OAuth
    OAuth Example Code
    Dropbox App Setup
    Offline OAuth Demo
    OAuth Tokens
    Online vs Offline Access Types
    Redirect URIs
    OAuth Connect HTTP Handler
    Determine Redirect URI Host
    OAuth Routes and Config Setup
    OAuth Callback Handler
    Testing OAuth with API Calls
    Bonus: Dropbox Chooser
    Dropbox Chooser Overview
    Embedding the Chooser
    Images via Dropbox Form
    Chooser Success Function
    Images via URL Handler
    Downloading Images
    Create Images Without Seek
    Concurrent Downloads
    Using errgroup
    Page Specific JS

    Additional Resources

    Extra Goodies Included with the Complete Package

    700+ Page eBook

    In addition to the screencasts, the course has an eBook that covers everything except for the bonus content. If you prefer reading, want to see a slightly different take on a lesson, or need something more travel-friendly the book will be your best friend. Available in PDF, EPUB, and MOBI (Kindle) formats.

    All the Source Code

    Get access to all of the source code used in the course from start to finish. You can easily jump to code just before or after each lesson, making it easier to jump to a specific section and continue learning.

    Students-only Slack

    Worried about getting stuck? Don't be! The course includes access to a private Slack where you can chat with myself and other students. Ask questions, get help with a bug, or even discuss ways to go beyond the course materials. Many students have found this as valuable as the course itself for continuing their education.

    The best course I've seen around! This course stands out since it's more than just code snippets you'll find on other sites. It's a full blown, project-based course that guides you from start to finish. The background explanations for all the components and taking one approach over another are really helpful too.

    Chris Rivera

    Not interested in screencasts?

    Check out the packages below.

    Book + Bonus Package

    This package doesn't include screencasts for the entire course, but it does include the bonus content covering advanced API usage with OAuth and Dropbox. You'll also get the 700+ page ebook, access to the course slack, and all the source code.

    Pay once, own it forever

    $119

    Book Only Package

    If your budget is preventing you from purchasing the bonus content and screencasts, I recommend this package. It teaches everything necessary to build web applications and will be a resource you reference for years to come.

    Pay once, own it forever

    $59

    This course has taught me so much in only 5 days! If you are even a little interested in Web Development I would definitely check it out!👍

    Kayla Thomsen

    Frequently asked questions

    Can’t find the answer you’re looking for? Email me: jon@calhoun.io.

    Do you update the course?
    Yep! Not only do I make updates to keep the code in the course from breaking, I also actively take student feedback to improve the course. This is what lead to a recent re-recording of the entire course.
    Anyone who purchases will have access to all future updates.
    When was the course last updated?
    I make updates to the course regularly as new versions of Go are released. Anyone who purchases the course will have access to all future updates free of charge. You can read more here.
    Can I get a sample?
    Yep. Fill out this form and I'll send you 14 screencasts from the course. I'll also include an eBook sample.
    What is your money back guarantee?
    If you buy the course and aren't happy, email me within 30 days of purchasing and I'll issue you a refund.
    The only exceptions are repeat purchases and fraud. I do everything in my power to let honest customers try out the course, but I reserve the right to deny a refund if it appears to be fraudulent. I also do not offer more than one refund on the same course, as I still pay CC processing fees on refunds.
    If you are concerned, reach out to me and I can help answer any specific questions. I want you to be able to give the course an honest try and I am pretty easy to work with.
    How much programming experience do I need?
    Web Development with Go is designed to be approachable for both absolute beginners and professional developers alike. Each lesson explains the code in detail, and there are often additional resources to check out if you want further reading. The only real requirement is that you know (or learn) some basic Go syntax.
    Check out the samples and you will see how approachable this course is.
    Do you offer team packages?
    Yes, I do. Reach out and let me know how many developers you need access for so I can get you a custom discount.
    How long will I have access?
    The course doesn't expire. Once you purchase, you will always have access.
    If you are worried, both the screencasts and the ebook can be downloaded and backed up on your own devices. You know, just in case I get hit by a truck or something. 🚛 *beep* *beep*
    Why does the course cost so much?
    Unfortunately this course doesn't cost $10. I know that many courses on Udemy go on sale frequently for $10, so why isn't this one of those courses?
    The short answer is that charging more enables me to provide a better experience for students. It enables me to provide awesome support, free updates, and to make sure the course covers everything you need to learn to become a web developer. It also allows me to create free resources that you have likely already benefited from (like Gophercises).
    If you are on the fence, ask someone who has taken the course if it is worth the price. Over 4000 people have happily used this course to learn how to build web application using Go. If you join them, I promise you won't regret it.
    If you are on the fence I offer two cheaper packages that include a vast majority of the course content at a much cheaper price. You can upgrade later, and I offer a money back guarantee.
    Do you offer student discounts?
    Yes, but only on the Complete Package and not during my annual Black Friday sale.
    Can I upgrade later?
    Yes. Email me when you are ready to upgrade and let me know the email address you used to purchase the course.
    What formats are the videos in?
    The videos are hosted with Vimeo and are streamable through their embedded player. I also offer DRM-free, high quality 1920x1080 mp4s that you can download.
    At some point in the future I plan to change video hosts and use Mux instead to help out customers in countries where Vimeo is banned, but those updates are not released yet.

    Jon's course, Web Development with Go, is amazing. It is filled with great insights and has been an amazing resource of knowledge.

    Invest in yourself by buying this book along with the extras. You won’t regret it.

    Georges Mantzos

    About me

    Meet the fella behind the camera

    Jon Calhoun is a full stack web developer who teaches about Go,web development, testing, algorithms, and anything else he finds interesting. He spoke at the GothamGo conference about focusing on simplicity when writing software and is a panelist on the Go Time podcast.

    Previously, Jon founded EasyPost, a shipping API that many fortune 500 companies use to power their shipping infrastructure. Before that he worked at Google as a software engineer. Prior to that he studied computer science at UCF.

    You can find more of Jon's work, including other FREE courses and tutorials he has created, below.

    Jon's Courses

    • Work through programming exercises designed to teach you various aspects of programming in Go.

    • Dive into various programming algorithms and data structures, learning how to implement each in Go.

    • Learn to build real, complex web applications from start to finish using Go.

    • Learn all about testing techniques and how to apply them to real projects. A great follow-up to Web Development with Go!

    • Calhoun.io FREE

      Not a course, but I also write a bunch of Go tutorials that are available free on my website.

    Amigo. Your course KICKS ASS! Your code is clear, your delivery is clear, and I just did a few of the algorithm tutorials on your site and they too are clearly explained. Thank you!!!

    Great JOB!

    Angel Rosario

    People sometimes tweet about me

    Hopefully they don't say mean things 😬