Exemplary real world application built with Golang + Gin
Switch branches/tags
Clone or download
wangzitian0 Merge pull request #7 from itssujan/master
Updating readme with additional instructions for getting crypto
Latest commit d5d6955 Aug 26, 2018


RealWorld Example App

Build Status codecov License: MIT GoDoc

Golang/Gin codebase containing real world examples (CRUD, auth, advanced patterns, etc) that adheres to the RealWorld spec and API.

This codebase was created to demonstrate a fully fledged fullstack application built with Golang/Gin including CRUD operations, authentication, routing, pagination, and more.

How it works

├── gorm.db
├── hello.go
├── common
│   ├── utils.go        //small tools function
│   └── database.go     //DB connect manager
└── users
    ├── models.go       //data models define & DB operation
    ├── serializers.go  //response computing & format
    ├── routers.go      //business logic & router binding
    ├── middlewares.go  //put the before & after logic of handle request
    └── validators.go   //form/json checker

Getting started

Install the Golang


Environment Config

make sure your ~/.*shrc have those varible:

➜  echo $GOPATH
➜  echo $GOROOT
➜  echo $PATH

Install Govendor & Fresh

I used Govendor manage the package, and Fresh can help build without reload



go get -u github.com/kardianos/govendor
go get -u github.com/pilu/fresh
go get -u golang.org/x/crypto/...


➜  govendor sync
➜  govendor add +external
➜  fresh


➜  go test -v ./... -cover


  • More elegance config
  • Test coverage (common & users 100%, article 0%)
  • ProtoBuf support
  • Code structure optimize (I think some place can use interface)
  • Continuous integration (done)