All Projects → qq1060656096 → gapp

qq1060656096 / gapp

Licence: MIT license
go gin应用

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects
Makefile
30231 projects

Projects that are alternatives of or similar to gapp

pink-lady
a template project of gin app.
Stars: ✭ 44 (+4.76%)
Mutual labels:  gin
gin-api-boilerplate
A Go RESTful API server with gin and docker
Stars: ✭ 16 (-61.9%)
Mutual labels:  gin
HelloGin
Gin,Vue,Redis,Mysql,Xorm,FastDFS, Hello Gin ! 项目适合入门Gin
Stars: ✭ 62 (+47.62%)
Mutual labels:  gin
gmsec
golang micro service base on gin. golang 微服务集成框架
Stars: ✭ 141 (+235.71%)
Mutual labels:  gin
go-web-demo
基于gin的go web框架。包含log、mysql、redis、httpClient、grpcClient、hystrix 等组件,swagger、pprof集成。
Stars: ✭ 72 (+71.43%)
Mutual labels:  gin
kuu
Modular Go Web Framework based on GORM and Gin.
Stars: ✭ 15 (-64.29%)
Mutual labels:  gin
web-marisa
🍄 白丝魔理沙网页版
Stars: ✭ 65 (+54.76%)
Mutual labels:  gin
blog
后端api采用go语言框架gin编写,前端使用vue + element ui编写
Stars: ✭ 45 (+7.14%)
Mutual labels:  gin
spike
Golang Use Gin Framework implementation of the project
Stars: ✭ 20 (-52.38%)
Mutual labels:  gin
go-docker
Sample code and dockerfiles accompanying the blog post The Ultimate Guide to Writing Dockerfiles for Go Web-apps
Stars: ✭ 89 (+111.9%)
Mutual labels:  gin
laya-template
服务基本框架,template
Stars: ✭ 13 (-69.05%)
Mutual labels:  gin
go-fastapi
Create an API and get Swagger definition for free
Stars: ✭ 76 (+80.95%)
Mutual labels:  gin
ego
Go微服务.A simple and component-based microservice kit for go.
Stars: ✭ 765 (+1721.43%)
Mutual labels:  gin
logger
Gin middleware/handler to logger url path using rs/zerolog
Stars: ✭ 119 (+183.33%)
Mutual labels:  gin
fizz
🍋 Gin wrapper with OpenAPI 3 spec generation
Stars: ✭ 139 (+230.95%)
Mutual labels:  gin
goblog
使用golang写的个人博客mirrored from https://gitlab.com/xiayesuifeng/goblog.git
Stars: ✭ 26 (-38.1%)
Mutual labels:  gin
watchman
📆 更夫(watchman)是一款可视化的定时任务配置 Web 工具,麻麻不用担心我漏掉任何更新啦!
Stars: ✭ 40 (-4.76%)
Mutual labels:  gin
easy-gin
一套基于 Gin 框架的 MVC 脚手架,使用 govendor 包管理
Stars: ✭ 74 (+76.19%)
Mutual labels:  gin
go-realworld-example-app
Exemplary real world application built with Go, Gin, and go-pg
Stars: ✭ 48 (+14.29%)
Mutual labels:  gin
mir
Mir is a toolkit for register method handler to http engine router(eg: gin,echo,iris,mux,httprouter) use struct tag info.
Stars: ✭ 42 (+0%)
Mutual labels:  gin

gapp

go gin框架应用脚手架, 帮助你快速搭建golang项目

名称 是否支持
数据库 支持
日志分割 支持
.env配置 支持
多主题(themes)模板 支持
多版本api 支持
多版本app 支持

开发命令

# 编译所有平台二进制可执行文件
make all

# 编译所有平台二进制可执行文件,并制定可执行文件名
make all appName=devGapp
make all appName=stageGapp
make all appName=gapp

# 开发时运行
make dev

# 清空编译二进制文件
make clear

gapp使用说明

  1. gapp使用了那些golang第三方库
  2. gapp目录结构
  3. 安装gapp
  4. gapp配置
  5. 运行gapp
  6. 示例文件

1. gapp使用了那些第三方库

框架: gin -> 文档

数据库: gorm -> 文档

.env配置: godotenv -> 文档

2. gapp目录结构

gapp                  应用根目录
├─dev                  开发者存放项目相关开发信息
├─gapp                  应用根目录
│  ├─langs              核心语言包目录
│  ├─models             模型目录
│  ├─pkg                公共库目录
│  │  ├─util                通用包目录
│  ├─resources          资源目录
│  │  ├─themes              主题(themes)目录
│  │  │  ├─default              默认主题(default)目录
│  │  │  ├─default_mobile       默认手机主题(default_mobile)目录
│  ├─routers            路由目录
│  │  ├─api_router.go       接口路由配置文件
│  │  ├─app_router.go       网页应用路由配置文件
│  │  ├─router.go           路由配置文件
│  │  ├─api                 接口目录
│  │  │  ├─v1                   v1接口开发目录
│  │  │  │  ├─demo                示例接口目录
│  │  │  │  │  ├─simple.go          简单请求示例
│  │  │  │  │  ├─gorm.go            gorm操作数据库(db)示例
│  │  │  │  │  ├─gorm_raw_sql.go    gorm raw sql 原生sql操作数据库(db)示例
│  │  │  ├─ ...                 vn接口开发目录
│  │  ├─app                 网页应用目录
│  │  │  ├─v1                   v1网页应用开发目录
│  │  │  │  ├─demo                  示例网页应用开发目录
│  │  │  │  │  ├─simple_html.go         简单网页应用示例
│  │  │  ├─ ...                 vn网页应用开发目录
│  │  ├─var                 变量目录(其内容在系统正常运行期间会不断更改的文件)
│  │  │  ├─log                  日志存放目录
│  │  ├─Vendor              第三方类库目录
│  ├─.env               配置文件
│  ├─example.env        示例配置文件
│  ├─LICENSE.txt        授权协议文件
│  ├─Makefile         	makefile文件
│  ├─README.txt         README文件
│  └─main.go            入口文件

3. 安装gapp

  1. 查看GOPATH路径: go env 命令查看 GOPATH 路径
  2. 下载gapp: git clone https://github.com/qq1060656096/gapp.git
  3. sql导入MySQL数据库
DROP TABLE IF EXISTS `demo_user`;
CREATE TABLE `demo_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `user` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  `pass` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT '',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Table structure for user
-- ----------------------------
DROP TABLE IF EXISTS `user`;
CREATE TABLE `user` (
  `id` int(11) NOT NULL DEFAULT '0',
  `name` varchar(255) CHARACTER SET utf8mb4 NOT NULL DEFAULT ''
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
  `uid` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `pass` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '密码',
  `created_at` int(20) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updated_at` int(20) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  `deleted_at` int(20) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
  PRIMARY KEY (`uid`)
) ENGINE=InnoDB AUTO_INCREMENT=100 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Table structure for users_accounts
-- ----------------------------
DROP TABLE IF EXISTS `users_accounts`;
CREATE TABLE `users_accounts` (
  `uid` int(11) unsigned NOT NULL,
  `account_name` varchar(128) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '账户',
  `account_type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '账户类型: 1->手机号码, 2 -> 邮箱, 3 -> 微信',
  `created_at` int(20) unsigned NOT NULL DEFAULT '0' COMMENT '创建时间',
  `updated_at` int(20) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间',
  `deleted_at` int(20) unsigned NOT NULL DEFAULT '0' COMMENT '删除时间',
  UNIQUE KEY `uniq_uaa` (`uid`,`account_name`,`account_type`,`deleted_at`) USING BTREE COMMENT '唯一索引',
  UNIQUE KEY `uniq_index` (`account_name`,`account_type`,`deleted_at`) USING BTREE COMMENT '唯一索引',
  KEY `idx_uid` (`uid`) USING BTREE COMMENT '用户uid'
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

4. 配置文件

  1. 进入目录: cd gapp
  2. 创建配置: cp example.env .env
  3. 配置数据

5. 运行gapp

# 运行gapp
bin/mac/64/gapp

6. gapp示例

# gorm model操作数据库
gapp/routers/api/v1/demo/gorm.go

# gorm 执行原生sql
gapp/routers/api/v1/demo/gorm_raw_sql.go

# 接口演示get post put delete
gapp/routers/api/v1/demo/simple.go

# 网页模板示例
gapp/routers/app/v1/demo/simple_html.go
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].