
Explore the basics of Go, its pros and cons, and learn to build a simple blog with Go and MySQL, featuring authentication, article creation, and APIs.
Build a Go project structure with assets, cmd, config, internal, and packages; initialize the module, run a hello world, then install Gin and serve localhost:8080 with a ping route.
Learn to externalize configuration in a golang project by reading values from a yaml file with the viber package, replacing hardcoded host and port and propagating app name across routes.
Organize a Go project CLI using Cobra, adding a serve command and a help command, wiring main.go to execute cmd, and leveraging a config.yaml for hosting details.
Create a config package to centralize config handling with a setter and getter that read from a YAML file, and apply it in the server to avoid code across files.
Create a routing package to initialize a router, provide a get router function, and serve the app with config, using a gen dot engine and error handling.
Create a Go serve package to streamline server setup and routing through a bootstrap process. Move route registration into internal modules and providers, then test on localhost:8080.
Create html package to render templates in gin, enabling HTML responses alongside JSON by loading templates, routes, and a global data provider for app name.
Create a static package to serve assets in your gin-based go project. Configure a router static path for /assets, then restart the server to verify the image default.jpg renders.
Integrate a free HTML template into the Go project to build the blog home page, and create shared layouts (head, nav, header, footer) with a home controller and index handler.
Learn to connect a Go app to a MySQL database using Gorm, configure a DSN and DB settings in YAML and code, and establish the connection.
Create database models for user and article in a go gin mysql gorm project. Define user fields (name, email, password), article fields (title, content, user_id) and relate articles to users.
Migrate the database schema by running go run main.go migrate to auto migrate user and article models, verify tables and fields including id, created_at, updated_at, deleted_at, and user_id.
Implement a Go seed command to populate the database with users and articles, hashing passwords with bcrypt and creating ten articles for the initial user.
Learn how the repository layer abstracts data access from business logic by implementing an Article Repository Interface and a concrete Article Repository with a list function and article limits.
Create a service layer that abstracts domain logic and coordinates controller and repository access to fetch featured articles and stories with built-in limits for the home page.
Implement a response handler to transform article and user domain models into API responses, adding image placeholders and a human readable created date for consistent, template-driven outputs.
Render the home page with dynamic feature and stories data via a range loop. Replace static cards and render id, image, title, content, and author image and name.
Configure the article show page by adding article routes and a dedicated controller, then fetch the article by id from the URL, convert it to int, and render the template.
Add a show article flow for the Go blog project: implement article service find by id, repository find by id, and controller rendering the article or not found error.
Render article details in the blog project by wiring template pages for 500 and 404 errors, and display article data including title, image, and author in the show page.
Build a blog authentication flow by adding user routes, an auth controller, and a register form with a post handler, plus an html register template and testing on localhost 8080.
Validate the register form by binding data to a request struct. Redirect to the register form on error or to the home page on success.
Implement a Go blog user creation flow with a repository and service, hash passwords with bcrypt, and persist new users to the database via create.
Learn to handle form errors in a blog project using gin and go by building a validation errors package that returns field messages for the register form.
Implement form error handling in a blog project by persisting errors in a session, flashing them to the form on redirect, and restoring them as a map for templates.
Save previously submitted form data in the session to preserve inputs after errors, then retrieve and render old name and email in the register form while omitting the password.
Finalize registration by validating email uniqueness with a service and repository check, then authenticate the user by saving the user id in the session.
Add a login route (get) and a login handler (post) to render the login form with email and password. Update templates and navigation, and verify the login flow.
Validate login request, preserve errors in the session, and authenticate the user by email and password; on success, set the auth session and go to home page.
finalize login by implementing an auth helper using the session to show login or user dropdown with name and image, and add a logout route to clear the session.
Build a blog feature by securing article creation with a Gin middleware that checks session authentication, redirects unauthenticated users to login, and applies the auth middleware to article routes.
Protect routes with auth middleware, add a store handler and create article form posting to /articles/store, and render a create article template with title and content inputs.
Validate article form (title and content), redirect with errors on failure, then store article via the service and repository linked to the user, and redirect to the article page.
This course ends by presenting a solid Go project structure with Gin, MySQL, and gorm, and a Cobra-based cli, plus internal packages, repositories, services, and authentication with html templates.
If you're looking to learn how to build robust and scalable web applications with Go, Gin, MySQL, and GORM, this is the course for you. In this course, you will learn how to build a solid and maintainable structure for your Go web applications using some of the most popular tools and frameworks in the Go ecosystem.
We will start by discussing the principles of good application design and how to implement them in Go using a layered architecture and various design patterns. You'll also learn how to set up a project structure that facilitates code organization, reuse, and testing.
Next, we'll dive into Gin, a lightweight web framework that makes it easy to handle HTTP requests and responses in a clear and concise way. You'll learn how to use Gin to create web applications.
We'll also cover MySQL, one of the most popular relational database engines, and GORM, a powerful ORM library that provides a simple and intuitive way to work with databases in Go. You'll learn how to connect your application to a MySQL database, and how to perform common database operations such as querying, inserting, updating, and deleting data.
Throughout the course, you'll work on a sample project that demonstrates all the concepts and techniques covered. By the end of the course, you'll have a solid understanding of how to build robust and scalable web applications with Go, Gin, MySQL, and GORM, and how tomaintain them over time as they evolve and grow. With these skills, you'll be well-equipped to develop high-performance and scalable web applications that can handle large amounts of traffic and data.
In summary, this course is designed to provide you with a comprehensive and practical understanding of how to build web applications with Go, Gin, MySQL, and GORM. Whether you're new to Go or an experienced developer looking to expand your skill set, this course will equip you with the knowledge and tools you need to build high-quality and maintainable web applications. So, enroll now and start your journey to becoming a proficient Go web developer!