Sample crud web application project using Golang(http, templates, os, sql), Bootstrap 4, DataTables, MySQL, Docker.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
What things you need to install the software
- Golang, preferably the latest version (1.16).
- MySQL Database
- Docker (optional)
- Clone this repository
git clone https://github.com/le4ndro/gowt.git
cd gowt
- Run below command and install dependencies
go mod download
- Create database on MySQL
CREATE DATABASE gowtdb CHARACTER SET utf8 COLLATE utf8_unicode_ci;
USE gowtdb;
CREATE TABLE tools (
id int(11) NOT NULL AUTO_INCREMENT,
name varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
category varchar(80) COLLATE utf8_unicode_ci DEFAULT NULL,
url varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
rating int(11) DEFAULT NULL,
notes text COLLATE utf8_unicode_ci,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
- Create a .env file with the variables listed bellow and change values as needed
DATABASE_NAME="gowtdb"
DATABASE_USERNAME="user"
DATABASE_PASSWORD="pass"
DATABASE_SERVER="localhost"
DATABASE_PORT="3306"
- Run the application
make run
- Create an executable
make build
- Run the application
./out/bin/gowt
\out\bin\main.exe (Windows)
- To build and tag your image locally
make docker-build
- To push your image to registry
make docker-release
make docker-run
- Golang - The programming language
- Bootstrap 4 - Html framework
- jQuery - Javascript library
- DataTables - Advanced tables - Plug-in for jQuery
We use SemVer for versioning. For the versions available, see the tags on this repository.
- Leandro Souza - Initial work
This project is licensed under the MIT License - see the LICENSE file for details
- This project is in development