This project serves as a practical resource for grasping the foundational aspects of developing a web application in Go. It provides insights into the practical application of structs and demonstrates the seamless integration of Go with a local Postgres database, enabling comprehensive CRUD (Create, Read, Update, Delete) operations.
By studying this application, you can learn the following topics related to Go programming:
-
Create a Web Application with Go:: Get hands-on experience in creating a web application using the Go programming language.
-
Server and Product Struct: Understand how to set up the server and define the product struct for your web application.
-
Connecting to Database - Postgres: Learn how to connect your Go application to a local Postgres database, enabling data storage and retrieval.
-
Refactoring and New Product Page: Explore the process of refactoring code for improved maintainability and adding a new product page to your web application.
-
Deleting Products and Partials: Implement functionality to delete products and work with partials to enhance the user experience.
-
Updating and Editing Products: Enable users to update and edit product information within your Golang Store.
To run the Golang Store application, follow these steps:
-
Ensure you have Go installed on your system. If not, you can download and install it from the official Go website.
-
Make sure you have a local Postgres database set up and running.
-
Open a terminal or command prompt and navigate to the project directory.
-
Run the following command to start the application:
go run main.go
This will execute the
main.go
script, which contains the Golang Store application. The application will start a server. -
Check the Golang Store in your browser by navigating to the following address:
Here, you can add, edit, and delete products in the Golang Store.
-
To stop the application and the server, use the Ctrl + C keyboard shortcut in the terminal or command prompt where the application is running.
This project is licensed under the MIT License. See the LICENSE file for details.
🛠 🥋 Software Engineer