Let’s Build a Go version of Laravel

Let’s Build a Go version of Laravel

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 129 lectures (19h 20m) | 6.51 GB

Build a reusable Go module and command line application that makes building a web application simple, fast and secure.

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

What you’ll learn

  • 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
Table of Contents

Introduction
1 Introduction
2 A bit about me
3 How to ask for help
4 Install Go
5 Install VS Code
6 Install Make

Getting Started with the Celeritas Module
7 Setting up project structure
8 Keeping our application and package in sync with Make
9 Starting work on Celeritas
10 Creating application folders
11 Creating and reading the .env file
12 Creating logs
13 Setting up Celeritas configuration
14 Getting a simple web server up and running

Rendering Pages
15 Implementing a page renderer in the Celeritas package (for Go templates)
16 A note about configuration
17 Trying out the Go render functionality
18 Cleaning up Celeritas
19 Adding Jet support to our page rendering package
20 Rendering a Jet Template
21 Working with Jet Templates

Testing
22 Testing the render package
23 Writing more tests for the render package
24 Simplifying our tests using Table Tests

Sessions
25 Implementing Sessions in Celeritas
26 Choosing and Installing a session package
27 Adding session middleware
28 Verifying that sessions work with myapp
29 Reading data from the session and passing it to the Jet template
30 Writing tests for the session package
31 Checking our Coverage

Installing MariaDB, Postgres, and Redis using Docker
32 Installing Docker
33 Bringing up and tearing down a development environment using docker-compose

Adding support for Postgres to Celeritas
34 Getting started with Postgres
35 Building a Postgres connection string and connecting to the database
36 Trying out our database connection
37 Adding ORM like functionality to our application with upperdb
38 Creating a real users table and a user model
39 Additional database functions for the User type
40 Finishing up the database functions for the User model
41 Inserting a user
42 Testing other database functions on the User model
43 Creating a login page and handler
44 Creating the post handler for logging in
45 Adding functions to the Tokens model

Testing Models
46 Writing tests for models.go
47 Getting started with our integration tests
48 Creating tables in our test docker image, and running some tests
49 Continuing to write integration tests
50 Finishing up our integration tests
51 Cleaning up our tests

Starting work on the Celeritas Command Line application
52 Setting up a simple CLI package in Celeritas
53 Adding support for migrations to the Celeritas package
54 Starting work on make migration in our CLI application
55 Using templates in our CLI
56 Trying out our make migration functionality
57 Running migrations
58 Trying out our make migrate commands with the Celeritas CLI
59 Getting started with Implementing make auth functionality
60 Trying out the make auth functionality
61 Continuing with the make auth functionality in our command line program
62 Creating simple auth middleware, and adding it to the make auth command
63 Installing our auth middleware with the celeritas command line utility
64 Trying out our improved make auth functionality
65 Implementing make handler functionality
66 Implementing make model functionality
67 Adding database stores to our sessions package
68 Adding support for database session store to the celeritas project
69 Supporting MySQLMariaDB withmake auth

Validation
70 Creating a validation package
71 Trying out our validation
72 Adding validation to models
73 Trying out our model validation
74 Building a simple form and performing validation on it
75 Building our PostForm handler with validation

Helper utilities
76 Helper functions for the routes file
77 Helper functions for handlers

Response Utilities, Encryption, and More
78 JSON, XML, and other response types
79 Creating handlers for our response types
80 Creating the routes and links for our response types
81 EcryptionDecryption
82 Generating and getting our encryption key
83 Trying out our encryption functionality

Implementing a Redis cache
84 Installing the necessary package and getting started
85 Connecting to Redis
86 Completing the rest of the cache functions
87 Testing the cache package
88 Trying out the cache in myapp
89 Finishing up our cache page in myapp

An Aside Redis sessions, CSRF, and disabling debugging info
90 Adding a Redis store to our sessions package
91 CSRF Protection
92 Speeding up templates

Implementing a BadgerDB cache
93 Installing the necessary package and implementing necessary functions
94 Updating setup test.go to create a Badger database for our tests
95 Writing and running tests for our Badger cache
96 Connecting to Badger
97 Trying out the Badger cache

Sending Email
98 Getting started sending email using SMTP
99 Adding the necessary packages, and completing sending email via SMTP
100 Sending email using Mailgun, SparkPost and more
101 Connecting Celeritas to our mailer package
102 Trying out or mailer package
103 Sending mail using an API
104 Adding make mail to the CLI
105 Testing mail

Remember me & Password Resets
106 Setting up models and middleware for remember me functionality
107 Updating the auth handlers for remember me functionality
108 Trying out the remember me functionality
109 Password resets
110 Handling a password reset request
111 Sending a password reset link via email
112 Validating our signed link, and displaying the password reset form
113 Resetting the user’s password
114 Updating the make auth functionality in the Celeritas CLI
115 go-laravel-2120-remember-2

Implementing celeritas new myapp
116 Starting work on celeritas new in the CLI
117 Sanitizing the project name
118 Cloning a (currently non-existent) repository right in Go
119 Creating a skeleton application
120 Pushing our skeleton application to GitHub
121 Trying out the code that clones a remote GitHub repository
122 Removing the .git directory and creating a .env file
123 Creating the correct Makefile
124 Update go.mod
125 Update imports in .go files
126 Running go mod tidy
127 Pushing our Celeritas project to GitHub
128 Trying out our make new functionality

Where to go from here
129 Where to go from here

Homepage