Skip to content

Latest commit

 

History

History
159 lines (127 loc) · 4.67 KB

README.md

File metadata and controls

159 lines (127 loc) · 4.67 KB

Cleaning Pattern GO

Cleaning Pattern GO

Golang API, HTML (Go Template), and Mysql Starter Kit


Table of Contents


About Us

Cleaning Pattern Go is a basic code that is made with the concept and pattern of the Repository-Service Pattern and the Clean Architecture.

Cleaning Pattern Go uses a Mysql database that can be customized according to your needs. In addition, it is also equipped with an HTML Parser so that you can use HTML directly such as HTML, CSS and other Front-End Frameworks such as Bootstraap, CSS Tailwind and many more.

HTML Parser is an part of Cleaning Pattern GO in one service that makes it easy to use without requiring many services to run.


Features

Pattern
  • Repository-Service Pattern
  • Clean Architecture
Front-End
  • HTML Parser (GoTemplate)
  • Support All Front-End HTML Frameworks
Database
  • Mysql/MariaDB Database
  • Database Can Be Customized
API
  • Support All HTTP Methods
  • Custom API Response and Result
  • Custom API Error
  • API Versioning
Authentication
  • HTTP Basic Authentication
  • JWT Authentication
    • Generate JWT Token
    • Verify JWT Token
  • Can Be Added as Desired
Other
  • Error Handling
  • Support Code Versioning
  • Code Maintenance and Management
  • Support for Makefile
  • Support for Dockerfile

Base Code Configuration

To configure the code base, it can be done by accessing the environment.

Setup Apps
  • APP_MODE : Application Mode is debug or production
  • APP_NAME : Application Name
  • APP_PORT : Application In Running Port
  • APP_URL : Application URL
  • APP_SECRET : Secret Key Token Cookie and JWT
Setup Database
  • DB_HOST : Database HostName
  • DB_NAME : Database Name
  • DB_USER : Database UserName
  • DB_PASSWORD : Database Password
  • DB_PORT : Database Port
Basic HTTP Authentication
  • BASIC_AUTH_USER : Basic Authentication UserName
  • BASIC_AUTH_PASSWORD : Basic Authentication Password

Getting Started

To get started, you can clone the repository and run the following command:

git clone https://github.com/rizwijaya/CleaningPatternGO.git
Getting Started with GO

Initialize the project by running the following command:

go mod init CleaningPatternGO
go mod tidy

If you want to run the project directly without creating a binary file, you can use the command:

go run main.go

But if you want to build the project with binary files, you can run the following command to build the project:

go build main.go

Then, you can run the project by running the following command:

./main
Getting Started with Makefile

Initialize the project Depedencies by running the following command:

make init

Download and Install the project Depedencies by running the following command:

make install

But if you want to build the project with binary files, you can run the following command to build the project:

make run

Then, you can run the following command to build the project:

make build

Then, you can run the project by running the following command:

make start

Cleaning Golang Binary Project with Makefile, you can following commands:

make clean

Run with nodemon by running the following command:

make run-nodemon

Author

Rizqi Wijaya
Contact Me:

LinkedIn Gmail Instagram