/ggb

Go Gin Boilerplate. A development boilerplate based on the Gin framework, aimed at helping developers quickly build and develop web applications.

Primary LanguageGoMIT LicenseMIT

Go Gin Boilerplate

GitHub go.mod Go version CI License

πŸ“˜ Documents

🎬 Introduction

A development boilerplate based on the Gin framework, aimed at helping developers quickly build and develop web applications.

πŸ‘€ Keywords

Go Gin Cobra Viper Gorm Gin-Swagger Air Logrus Lumberjack Zap Jwt

✨ Features

  • 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.

πŸš€ Quick Start

git clone https://github.com/sanjayheaven/ggb.git
cd ggb
go mod download

Configuration Setup

  • Navigate to the configs directory, copy the config.example.yaml file, and rename it to config.yaml.
cp configs/config.example.yaml configs/config.yaml
  • Modify the configuration items in the config.yaml file.
vi configs/config.yaml

Run the Application

  • Run the project using air 【Recommended】
air
  • Run the project using go run
go run main.go server

πŸ”¨ Build

make build

πŸͺ€ Deployment

docker-compose

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

🀝 Support

  • Star 🌟 the project

  • Welcome to submit issue. Thank you for your support

  • Help promote it on social media and recommend it to friends

    Twitter Facebook WhatsApp Telegram

  • You can also sponsor a cup of coffee on Ko-Fi or Buy Me A Coffee

    Buy Me a Coffee at ko-fi.com Buy Me A Coffee