# gin_web_app_scaffold **Repository Path**: shiliangxu/gin_web_app_scaffold ## Basic Information - **Project Name**: gin_web_app_scaffold - **Description**: 基于gin框架的golang web后端脚手架 - **Primary Language**: Unknown - **License**: MulanPSL-2.0 - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-09-15 - **Last Updated**: 2023-10-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: Go语言, Gin, Web ## README gin_web_app_scaffold ================================ 基于gin的golang-web后端开发脚手架 v1.0 --- ## 项目简介 go-web后端开发,开箱即用! 遵循大型web项目CLD分层理念。 支持优雅关机和平滑重启。 - 集成 gin go web框架 //github.com/gin-gonic/gin - 集成 redis 数据库 //github.com/go-redis/redis - 集成 mysql 数据库 //github.com/go-sql-driver/mysql - 集成 viper 项目配置 //github.com/spf13/viper - 集成 fsnotify 监控配置文件修改 //github.com/fsnotify/fsnotify - 集成 zap 日志 //go.uber.org/zap - 集成 lumberjack 日志切割 //gopkg.in/natefinch/lumberjack.v2 v2.2.1 - 集成 sqlx 原生sql扩展包 //github.com/jmoiron/sqlx v1.3.5 - 集成 air 文件热重载 //github.com/cosmtrek.air - 集成 swagger 自动生成接口文档 //"github.com/swaggo/gin-swagger" - 集成 jwt支持 //"github.com/dgrijalva/jwt-go" - 集成 通用雪花算法生成int64位id //"github.com/bwmarrin/snowflake" - 统一业务状态码并封装响应方法 - 持续增加中... ## 目录结构 ```` . ├── controllers -------------------------------------------//C层 ├── logic -------------------------------------------------//L层 ├── dao ---------------------------------------------------//D层 ├── models ------------------------------------------------//模型 ├── logger ------------------------------------------------//日志 ├── routes ------------------------------------------------//路由 ├── settings ----------------------------------------------//设置 ├── pkg ---------------------------------------------------//工具 ├── docs --------------------------------------------------//工具swagger自动生成 ├── main.go -----------------------------------------------//main ├── go.mod ------------------------------------------------//module ├── config.yaml -------------------------------------------//配置文件 ├── web_app_test.log ├── readme.md ./ ```` ## Getting Started ``` // Clone and execute the following command in the root directory. % go run main.go config.yaml // Visit 127.0.0.1:8081, get 'ok' on website. // Notice config.yaml and make sure mysql & redis server is running on right port. // Notice "module gin_web_app_scaffold" in go.mod,You may change that and execute % go mod tidy // 集成air之后,可直接在项目根目录执行air命令 ``` ## Prerequisites - go1.21.0 // Other versions may also be available. ## 开发计划