Golang API, HTML (Go Template), and Mysql Starter Kit
- About Us Cleaning Pattern Go
- Features Cleaning Pattern Go
- Base Code Configuration
- Getting Started
- Author
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.
- Repository-Service Pattern
- Clean Architecture
- HTML Parser (GoTemplate)
- Support All Front-End HTML Frameworks
- Mysql/MariaDB Database
- Database Can Be Customized
- Support All HTTP Methods
- Custom API Response and Result
- Custom API Error
- API Versioning
- HTTP Basic Authentication
- JWT Authentication
- Generate JWT Token
- Verify JWT Token
- Can Be Added as Desired
- Error Handling
- Support Code Versioning
- Code Maintenance and Management
- Support for Makefile
- Support for Dockerfile
To configure the code base, it can be done by accessing the environment.
- 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
- DB_HOST : Database HostName
- DB_NAME : Database Name
- DB_USER : Database UserName
- DB_PASSWORD : Database Password
- DB_PORT : Database Port
- BASIC_AUTH_USER : Basic Authentication UserName
- BASIC_AUTH_PASSWORD : Basic Authentication Password
To get started, you can clone the repository and run the following command:
git clone https://github.com/rizwijaya/CleaningPatternGO.git
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
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