We may earn an affiliate commission when you visit our partners.
Course image
Trevor Sawler

Laravel is one of the most popular web web application frameworks in the PHP world, and with good reason. It's easy to use, well designed, and lets developers work on their applications without worrying about re-inventing the wheel every time they start a project. Go, often referred to as Golang, is one of the most popular programming languages in the world, and has been used to create systems at Netflix, American Express, and many other well known companies. It's extremely fast, type safe, and designed from the ground up to be used on the web.

Read more

Laravel is one of the most popular web web application frameworks in the PHP world, and with good reason. It's easy to use, well designed, and lets developers work on their applications without worrying about re-inventing the wheel every time they start a project. Go, often referred to as Golang, is one of the most popular programming languages in the world, and has been used to create systems at Netflix, American Express, and many other well known companies. It's extremely fast, type safe, and designed from the ground up to be used on the web.

This course is all about taking some of the most useful features found in Laravel, and implement similar functionality in Go. Since Go is compiled and type safe, web applications written in this language are typically much, much faster, and far less error prone that a similar application written in Laravel/PHP.

The key features we'll work on in this course include:

  • Implementing an Object Relation Mapper (ORM) that is database agnostic, and offers much of the functionality found in Laravel's Eloquent ORM.

  • A fully functional Database Migration system

  • Building a fully featured user authentication system that can be installed with a single command, which includes:

    • A password reset system

    • Session based authentication (for web based applications)

    • Token based authentication (for APIs and systems built with front ends like React and Vue)

  • A fully featured templating system (using both Go templates and Jet templates)

  • A complete caching system that supports Redis and Badger

  • Easy session management, with cookie, database (MySQL and Postgres), Redis stores

  • Simple response types for HTML, XML, JSON, and file downloads

  • Form validation

  • JSON validation

  • A complete mailing system which supports SMTP servers, and third party APIs including MailGun, SparkPost, and SendGrid

  • A command line application which allows for easy generation of emails, handlers, database models

  • Finally, the command line application will allow us to create a ready-to-go web application by tying a single command: celeritas new <myproject>

The only requirements for this course are:

  • A basic understanding of Go

  • A basic understanding of SQL databases

  • A Windows, Mac, or Linux computer

  • An internet connection

  • Docker

  • Visual Studio Code (or the IDE of your choice)

Enroll now

What's inside

Learning objectives

  • How to build a reusable package in go
  • How to integrate multiple database types into a go application
  • How to build a complete user authentication system (web and api) in go
  • How to build a caching system using go and redis
  • How to implement a caching system using go and badgerdb
  • How to build a command line tool that writes code for you
  • How to automate database migrations in go
  • How to integrate multiple template rendering engines into a single application
  • How to write unit tests in go
  • How to write integration tests in go

Syllabus

Introduction

A brief overview of this course.

I've been at this for quite a while. Here is a brief biography.

You are probably going to want help at some point. Here's how to go about getting it.

Read more

We need Go installed, so let's take care of that.

You may already have a development environment set up, but if not, Visual Studio Code will do the job.

Make is a tool that controls the generation of executables and other non-source files of a program from the program's source files. Let's install it.

Let's get our project structure set up and initialized.

Let's use a Makefile to keep things up to date and easy to manage.

Let's start making our Celeritas package useful for web applications

Let's call our celeritas package from our application and create some folders

Let's create a .env file and read it's values into the application's environment

Let's add some loggers, and try accessing information from our celeritas package from myapp

We are going to need a lot of configuration information for the celeritas package, so let's set up a type and share it with the entire module.

Let's implement a web server in our celeritas package, and start it from the myapp project

Let's build a render package that handles Go and Jet templates

Let's try rendering a standard Go template from myapp, just to make sure our code works.

Sometimes I don't get enough caffeine, and I write messy code. Let's fix that.

Let's add support for rendering Jet templates to the celeritas package

Let's make sure our code to render a Jet template works as expected

Let's change our default renderer to Jet, and change our home page template

Testing is very important. Let's write some tests for the render package.

Let's finish testing the render package

Our test for the Page function is rather long. Let's simplify it by using table tests.

Let's update our home page to make testing functionality easier.

Let's set up an easy to configure session package for Celeritas.

Our session needs to be loaded and saved on every request. Let's create and use some middleware that does just that.

Let's verify that we can write to and read from the session, and pass data to our Jet template.

It's important to keep our tests up to date, so let's write a test for our session package.

Let's check our test coverage.

Let's install Docker and make our lives much easier.

Let's use docker-compose to bring up our databases (and Redis).

Let's write some code to open a connection to a Postgres database using the jack/pgx driver.

Let's write some code to build a data source name (DSN), and connect Celeritas to Postgres

Let's try out a simple test route in myapp that reads information from the database and writes it to the browser window.

Most people who use frameworks expect to have an easy to use means of interacting with the database. Let's get started working on that functionality.

Let's create a user model that allows us to work with users easily by attaching functions to the model that interact with the database.

Let's write some additional functions for the User model, allowing us to insert, update, and delete users easily.

Let's write the last functions for the User model, to handle common tasks associated with authentication and user management.

Let's try creating a test route to insert a user.

Let's try out some of our User functions using test routes.

Let's try out our user.go functions by logging a user in.

Let's complete the login process.

Let's write some simple unit tests for models.go.

Let's get started with the code to set up our integration tests.

Let's finish up TestMain, verify that our docker image is up, and write some tests.

Let's keep writing integration tests for our User and Token data models.

Let's finish up our integration tests.

Just a bit of housekeeping.

Let's take the first steps to build our command line application.

Let's add support for running database migrations to the celeritas package.

Let's get started implementing a "make migration" command in the CLI.

Let's write the code to execute up and down migrations

Let's get started making setting up an authentication system easy for users of the Celeritas package.

Let's try out our "make auth" command and see if it works.

Let's make sure we copy over the data models for user and token when we run make auth from our command line utility.

Let's create some authentication middleware that we'll install using the command line application.

Let's update our command line utility to install the authentication middleware.

Let's make sure that our middleware is installed correctly.

Let's improve our command line application to allow for creating stub handlers.

Let's make it easy for our users to generate data models from the CLI.

Let's add support for storing sessions in the database to the CLI.

Let's add support for storing sessional data in Postgres.

Let's add support for "make auth" with MariaDB/MySQL.

Let's update our /update-user route to use our validation package.

Let's make it easy to add validation right to our models.

Let's try out the validation rules we attached to the user model.

Let's make it trivial for end users to generate JSON, XML, file download, and error responses.

Let's create handlers for json, xml, and file download response types.

Let's try out our response types.

Let's create encryption and decryption functions in Celeritas that we can use in any project that imports it.

Let's add an AES key generator to our CLI, and get the key in Celeritas so that we can use it.

Let's create a very simple route that tests our encryption functionality.

Let's install the basic package and get started implementing a cache for Celeritas.

Let's set up the code necessary to connect Celeritas to Redis, and add a Cache type.

Let's write the rest of the necessary functions for our Redis cache.

The easiest way to test our cache package is with unit tests. Let's write some.

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Bridges the gap between PHP's Laravel framework and Go, allowing developers familiar with Laravel to leverage their knowledge in a Go environment
Develops a command-line application for generating emails, handlers, and database models, streamlining the development process
Implements an Object Relation Mapper (ORM) that is database agnostic, providing flexibility in database selection
Requires a basic understanding of SQL databases, which may pose a challenge for developers without prior database experience
Requires Docker, which may require additional setup and configuration for developers unfamiliar with containerization
Builds a fully featured user authentication system with password reset, session-based, and token-based authentication, enhancing application security

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Build a go web framework

According to learners, this course offers a comprehensive and practical guide to building a modern web application framework in Go, similar in concept to Laravel. Students appreciate the deep dive into core web development concepts like ORMs, authentication, session management, and testing, implemented from scratch in Go. The instructor is highly praised for their expertise and clear explanations. Many find the process of building the "Celeritas" framework throughout the course to be extremely valuable for understanding Go's capabilities in web development and for creating reusable, high-performance components. Some note that while the course provides a strong foundation, the subject matter is complex and requires a solid understanding of Go basics, as mentioned in the prerequisites.
Requires basic Go knowledge as stated.
"Make sure you have the basic Go knowledge recommended; it's not a beginner Go course."
"While the instructor is clear, the topics move quickly if you're not already comfortable with Go."
"A basic understanding of SQL and web concepts is definitely needed to keep up."
"This course is perfect if you're already coding in Go but want to learn framework patterns."
Includes unit, integration tests and CLI.
"The sections on testing (unit and integration) were very helpful and often overlooked in other courses."
"Building the command line tool alongside the framework is a great practical addition."
"I learned valuable patterns for structuring tests and using the Go testing framework."
"The CLI makes the generated framework much more user-friendly."
Covers many essential web development topics.
"The course covers a wide range of topics essential for web development: auth, ORM, sessions, caching, testing, CLI."
"I was impressed by the depth of coverage on implementing features like database migrations and validation."
"Learning about different template engines and caching systems (Redis, Badger) was very useful."
"The scope of features implemented in the framework is quite broad and realistic."
Teaches highly applicable web development skills.
"The skills learned here are directly applicable to building real-world web applications in Go."
"I feel much more confident building web services and APIs after taking this course."
"Covers essential components like auth, database interaction, and caching that are needed in almost any project."
"The focus on testing and CLI tools adds great practical value."
Instructor is knowledgeable and explains well.
"The instructor clearly knows their stuff and explains complex topics in an understandable way."
"I found the instructor's teaching style engaging and easy to follow."
"Their insights into design choices and trade-offs were particularly valuable."
"The instructor's experience shines through, making the course feel very authoritative."
Build a complex web framework step-by-step.
"Building a web framework from scratch is a fantastic way to learn Go web development deeply."
"I really enjoyed the process of creating 'Celeritas'. It showed me how all the pieces fit together."
"The practical approach of building a full framework helps solidify concepts much better than isolated examples."
"Learning to build an ORM, authentication, and other components taught me so much about system design in Go."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in Let's Build a Go version of Laravel with these activities:
Review Basic SQL Concepts
Solidify your understanding of SQL fundamentals before diving into database interactions within the Go framework.
Browse courses on SQL Databases
Show steps
  • Review SQL syntax and commands.
  • Practice writing basic SQL queries.
  • Familiarize yourself with database concepts.
Brush Up on Go Fundamentals
Reinforce your Go programming skills to ensure a smooth learning experience when building the Laravel-like framework.
Browse courses on Go Programming
Show steps
  • Review Go syntax and data types.
  • Practice writing simple Go programs.
  • Familiarize yourself with Go's standard library.
Read 'The Go Programming Language'
Deepen your understanding of Go by studying a comprehensive guide that covers all aspects of the language.
Show steps
  • Read the book cover to cover.
  • Work through the examples in the book.
  • Try the exercises at the end of each chapter.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Contribute to an Open Source Go Project
Gain practical experience by contributing to an open-source Go project, reinforcing your understanding of Go and software development best practices.
Show steps
  • Find an open-source Go project on GitHub.
  • Identify an issue to work on.
  • Submit a pull request with your changes.
Write a Blog Post on Go ORMs
Solidify your understanding of ORMs by researching and writing a blog post comparing different Go ORM libraries.
Show steps
  • Research different Go ORM libraries.
  • Compare the features and performance of each library.
  • Write a blog post summarizing your findings.
Study 'Building Web Apps with Go'
Enhance your web development skills in Go by studying a practical guide that covers essential topics.
Show steps
  • Read the book cover to cover.
  • Work through the examples in the book.
  • Try the exercises at the end of each chapter.
Build a REST API with Go
Apply your knowledge by building a REST API using Go, reinforcing your understanding of web development concepts and Go's standard library.
Show steps
  • Design the API endpoints.
  • Implement the API using Go's standard library.
  • Test the API endpoints.

Career center

Learners who complete Let's Build a Go version of Laravel will develop knowledge and skills that may be useful to these careers:
Backend Developer
A Backend Developer builds and maintains the server-side logic and databases that power web applications. This course directly relates to the work of a Backend Developer, as it focuses on building a web application framework in Go, including an Object Relational Mapper, a database migration system, user authentication, templating, caching, and session management. The course's deep dive into creating these core components helps build a strong understanding of the underlying systems that a Backend Developer works with every day. The skills in this course enable a developer to write faster and more reliable code, which are crucial elements in the role of a Backend Developer.
Software Engineer
A Software Engineer designs, develops, and tests software systems and applications. This course can help train a software engineer to write more performant code using Go. The focus on building a complete web framework in Go, including features like an ORM, database migrations, and user authentication, provides an understanding of many aspects of software engineering. The course also emphasizes testing, both unit and integration, as well as how to use Docker, all skills that are very valuable for a Software Engineer. The course material directly relates to the kind of work a software engineer does daily.
Web Application Developer
A Web Application Developer builds and maintains web applications. This course focuses on building a web application framework in Go, which is directly applicable to this role. The course's coverage of rendering pages, session management, database integration, and form validation provides a strong foundation for a Web Application Developer. This course also provides instruction in building a command-line tool for generating code, which can streamline development processes, a helpful element for a Web Application Developer.
API Developer
An API Developer specializes in building and maintaining Application Programming Interfaces (APIs) that allow different software systems to communicate. This course directly applies to the role of an API Developer. This course covers building a variety of tools and features using Go, including token-based authentication, which is vital for building secure APIs. The course also covers creating JSON response types and form validation which are both necessary in the world of API development. The skills taught in this course are fundamental for an API Developer.
Full-Stack Developer
A Full Stack Developer works on both the front-end and back-end of web applications. This course provides valuable back-end experience, particularly with building core components like ORMs, authentication systems, and templating. The course also covers integration with different databases and caching mechanisms. These skills are valuable for a Full Stack Developer to be able to contribute across the full software development lifecycle. Although this course is not focused on the front-end, the skills developed in the back-end development portion of this course provide a strong foundation.
Systems Architect
A Systems Architect designs the structure of computer systems, including hardware, software, and networks. While this course does not cover hardware or networking, it does provide valuable knowledge of how to structure software systems, including a focus on the design of a complete web application framework. The course emphasizes building reusable components, integrating different systems, and creating systems which can be tested. These aspects are directly relevant to the role of a systems architect and provide a solid base. This course may be useful for a Systems Architect.
Software Architect
A Software Architect is a lead software engineer tasked with designing the high-level structure of a wide variety of software systems. This course focuses on designing a cohesive, testable, and maintainable software system, providing a helpful perspective for a Software Architect. The course is highly relevant to a Software Architect as it demonstrates how to design and build a complete web framework, with multiple key features, such as an ORM, various database integrations, and user authentication. The focus on writing both unit and integration tests is also useful to a software architect. This course may help a Software Architect.
Solutions Architect
A Solutions Architect designs and implements technology solutions to solve business problems. This course is focused on building a web framework in Go, and this kind of knowledge can be invaluable in evaluating technology choices. A solutions architect may work with web applications, and the knowledge of the inner workings of a framework like this can be very valuable. The course may be helpful for a Solutions Architect.
Database Engineer
A Database Engineer designs, implements, and maintains databases. While this course focuses on building a web application framework, it provides very helpful knowledge of interacting with databases using an ORM. The course also provides instruction on database migrations, which are a critical skill to develop for a Database Engineer. The course also explores integrating with multiple databases, including Postgres and MySQL. This course may help a Database Engineer.
DevOps Engineer
A DevOps Engineer is involved in software development and IT operations. This course includes building and using Docker, as well as using a command line interface to automate database migrations. These tools are vital for a DevOps Engineer. While the course is not entirely focused on operations, some of the content may be useful for a DevOps Engineer.
Technical Lead
A Technical Lead is responsible for guiding a team of developers and making key technical decisions. This course gives a deep dive into a web framework's implementation details, which can be useful for a Technical Lead. The course's instruction on how to build several features of a framework, especially the ORM, authentication engine, and testing tools, would give a Technical Lead a deeper knowledge of similar systems. A Technical Lead may find this course to be useful.
Cloud Engineer
A Cloud Engineer focuses on cloud computing technologies, including the design, implementation, and management of cloud-based systems. This course covers the use of Docker, which is a critical tool for cloud deployments. Additionally, the course's focus on building and integrating with databases, and also with caching systems like Redis, is helpful for a Cloud Engineer. This course may be useful for a Cloud Engineer.
Security Engineer
A Security Engineer works to protect software and systems from threats. This course covers important security concepts, particularly in the authentication system. In particular, the course works on token-based authentication and password resets, and these skills are helpful for a Security Engineer. This course may be useful for a Security Engineer.
Data Engineer
A Data Engineer focuses on designing and building systems which store and process data. This course includes learning how to use SQL databases, which is very useful for a Data Engineer. The course also includes instruction on how to work with a variety of databases, including PostgreSQL and MySQL. This course may be useful for a Data Engineer.
Mobile Application Developer
A Mobile Application Developer builds applications for mobile devices. While this course focuses on back-end development, the API development aspects, including the creation of token-based authentication and JSON response types, can be valuable for a Mobile Application Developer who needs to build a back-end for their mobile app. This course may be useful for a Mobile Application Developer.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in Let's Build a Go version of Laravel.
Comprehensive guide to the Go programming language. It covers all aspects of the language, from basic syntax to advanced topics such as concurrency and networking. It is commonly used as a textbook in academic institutions. Reading this book will provide a solid foundation for understanding the Go code used in this course.
Provides a practical guide to building web applications using Go. It covers topics such as routing, templating, and database interaction. It valuable resource for learning how to apply Go to web development. This book adds more depth to the course by providing real-world examples and best practices.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser