rizwijaya/CleaningPatternGO
Cleaning Pattern Go is a code base starter kit for API Service, HTML Parser and Mysql/MariaDB Database. Using Clean Architecture and Service-Repository Pattern.
Cleaning Pattern GO
Golang API, HTML (Go Template), and Mysql Starter Kit
Table of Contents
- About Us Cleaning Pattern Go
- Features Cleaning Pattern Go
- Base Code Configuration
- Getting Started
- Author
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.gitGetting Started with GO
Initialize the project by running the following command:
go mod init CleaningPatternGO
go mod tidyIf you want to run the project directly without creating a binary file, you can use the command:
go run main.goBut if you want to build the project with binary files, you can run the following command to build the project:
go build main.goThen, you can run the project by running the following command:
./mainGetting Started with Makefile
Initialize the project Depedencies by running the following command:
make initDownload and Install the project Depedencies by running the following command:
make installBut if you want to build the project with binary files, you can run the following command to build the project:
make runThen, you can run the following command to build the project:
make buildThen, you can run the project by running the following command:
make startCleaning Golang Binary Project with Makefile, you can following commands:
make cleanRun with nodemon by running the following command:
make run-nodemon