All Projects → yhagio → go_api_boilerplate

yhagio / go_api_boilerplate

Licence: MIT license
🐶Go (Golang)🚀REST / GraphQL API + Postgres boilerplate

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go api boilerplate

go-12factor-example
Example the 12factor app using golang
Stars: ✭ 20 (-84.25%)
Mutual labels:  gin, gorm, gin-gonic
Logrus
Hooks for logrus logging
Stars: ✭ 110 (-13.39%)
Mutual labels:  gin, gorm
httpsign
Signing HTTP Messages Middleware
Stars: ✭ 54 (-57.48%)
Mutual labels:  gin, gin-gonic
Zendea
A free, open-source, self-hosted forum software written in Go 官方QQ群:656868
Stars: ✭ 116 (-8.66%)
Mutual labels:  gin, gorm
Duckygo
一个同时支持Session以及JWT的高性能高可用 Golang Restful API 脚手架 !
Stars: ✭ 57 (-55.12%)
Mutual labels:  gin, gorm
Ginbro
Converting a MySQL database'schema to a RESTful golang APIs app in the fastest way
Stars: ✭ 97 (-23.62%)
Mutual labels:  gin, gorm
Golang Gin Realworld Example App
Exemplary real world application built with Golang + Gin
Stars: ✭ 1,780 (+1301.57%)
Mutual labels:  gin, gorm
Snake
🐍 一款小巧的基于Go构建的开发框架,可以快速构建API服务或者Web网站进行业务开发,遵循SOLID设计原则
Stars: ✭ 615 (+384.25%)
Mutual labels:  gin, gorm
Gosql
golang orm and sql builder
Stars: ✭ 141 (+11.02%)
Mutual labels:  gin, gorm
Cmall Go
golang写的电子商城的API接口
Stars: ✭ 167 (+31.5%)
Mutual labels:  gin, gorm
Goilerplate
Clean Boilerplate of Go, Domain-Driven Design, Clean Architecture, Gin and GORM.
Stars: ✭ 173 (+36.22%)
Mutual labels:  gin, gorm
Goforum
Let's go a forum
Stars: ✭ 23 (-81.89%)
Mutual labels:  gin, gorm
Wblog
基于gin+gorm开发的个人博客项目
Stars: ✭ 763 (+500.79%)
Mutual labels:  gin, gorm
Ugin
UGin is an API boilerplate written in Go (Golang) with Gin Framework.
Stars: ✭ 110 (-13.39%)
Mutual labels:  gin, gorm
Go Gin Api
基于 Gin 进行模块化设计的 API 框架,封装了常用功能,使用简单,致力于进行快速的业务研发。比如,支持 cors 跨域、jwt 签名验证、zap 日志收集、panic 异常捕获、trace 链路追踪、prometheus 监控指标、swagger 文档生成、viper 配置文件解析、gorm 数据库组件、gormgen 代码生成工具、graphql 查询语言、errno 统一定义错误码、gRPC 的使用 等等。
Stars: ✭ 730 (+474.8%)
Mutual labels:  gin, gorm
Ultimate Go
This repo contains my notes on working with Go and computer systems.
Stars: ✭ 1,530 (+1104.72%)
Mutual labels:  gin, gorm
requestid
Request ID middleware for Gin Framework
Stars: ✭ 115 (-9.45%)
Mutual labels:  gin, gin-gonic
Go Admin
基于Gin + Vue + Element UI的前后端分离权限管理系统脚手架(包含了:多租户的支持,基础用户管理功能,jwt鉴权,代码生成器,RBAC资源控制,表单构建,定时任务等)3分钟构建自己的中后台项目;文档:https://doc.go-admin.dev Demo: https://www.go-admin.dev Antd beta版本:https://preview.go-admin.dev
Stars: ✭ 5,439 (+4182.68%)
Mutual labels:  gin, gorm
Go Gin Example
An example of gin
Stars: ✭ 4,992 (+3830.71%)
Mutual labels:  gin, gorm
Gin bbs
Gin BBS App
Stars: ✭ 123 (-3.15%)
Mutual labels:  gin, gorm

Build Status codecov MIT Licence Open Source Love

Go (Golang) REST / GraphQL API Boilerplate

Note: in demo, I disabled email

Used libraries:


  • Components Diagram

diagram image

  • See Swagger Doc http://localhost:3000/swagger/index.html

swagger image

  • See GraphQL Playground http://localhost:3000/graphql

graphql image


Features

  • User Auth functionality (Signup, Login, Forgot Password, Reset Password)
  • JWT Authentication
  • REST API
  • GraphQL API
  • Gorm (Golang SQL DB ORM) with Postgres implementation and auto migration
  • Configs via environmental variables
  • Email notification (Welcome email, Reset password email)
  • Swagger REST API documentation
  • GraphQL playground
  • Unit tests
  • Dependency injection

Run locally

Create .env at root, i.e.

MAILGUN_API_KEY=key-b9jksfh8s9843uhfsdhds
MAILGUN_DOMAIN=xxxxx.mailgun.org

EMAIL_FROM=support@go_api_boilerplate.com

DB_HOST=localhost
DB_PORT=5432
DB_USER=your-user
DB_PASSWORD=your-password
DB_NAME=local-dev-db

JWT_SIGN_KEY=secret
HAMC_KEY=secret
PEPPER=secret

ENV=development

APP_PORT=3000
APP_HOST=http://localhost

Run

# Terminal 1
docker-compose up        # docker-compose up (Run postgres)
docker-compose down      # docker-compose down (Shutdown postgres)

# Terminal 2
go run github.com/99designs/gqlgen -v # Generate Graphql stuff
swag init -g app/app.go               # Generates Swagger
go run *.go                           # Run application
go test -v -cover ./...               # Run go test

Todo

  • Input Validations
  • Custom Error messages
  • Logger
  • More unit tests

maybe?

  • gRPC
  • Redis Streams
  • Redis PubSub
  • WebSocket
  • MongoDB

Contribution

Welcome for suggestions

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