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.
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)
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.
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.
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.
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.