A development boilerplate based on the Gin framework, aimed at helping developers quickly build and develop web applications.
Go Gin Cobra Viper Gorm Gin-Swagger Air Logrus Lumberjack Zap Jwt
- Fast Development: Using the Gin framework and related tools to speed up the development and iteration process of the project..
- Easy to use: Follow the project-layout specification and provide a clear and simple code structure so that even beginners can easily get started.
- Advanced CLI: Using Cobra to build modern command line tools to simplify project management and operations.
- Hot Reload: Using Air tool, support hot reload, improve development efficiency.
- Logging system: Integrated Logrus, Zap and Lumberjack to achieve all-round log recording and management.
- Database Support: Integrated Gorm, support mainstream databases such as MySQL, PostgreSQL, etc.
- Flexible Middleware: Integrate common middleware to easily implement functions such as logging, authentication, cross-domain, and flow control.
- API Document: Use Gin-Swagger to generate API documents for easy viewing and debugging of interfaces.
git clone https://github.com/sanjayheaven/ggb.git
cd ggb
go mod download
- Navigate to the
configs
directory, copy theconfig.example.yaml
file, and rename it toconfig.yaml
.
cp configs/config.example.yaml configs/config.yaml
- Modify the configuration items in the
config.yaml
file.
vi configs/config.yaml
- Run the project using air 【Recommended】
air
- Run the project using go run
go run main.go server
make build
Deploy the application using docker-compose. Ensure that Docker is installed on the server, and you are familiar with the usage of docker compose.
- Copy the
deployments/docker-compose.yml
configuration file to the project root directory. - Execute the following command to start the application
docker compose up -d
-
Star 🌟 the project
-
Welcome to submit issue. Thank you for your support
-
Help promote it on social media and recommend it to friends
-
You can also sponsor a cup of coffee on Ko-Fi or Buy Me A Coffee