go-gin-project

module
v0.0.0-...-8b35975 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2021 License: MIT

README

Introduction

Welcome to my project

Development


Preresquites

  • Go >=1.13

  • Docker

  • Dbmate

  • Makefile

Get the project

$ git clone https://github.com/nqtinh/go-gin-project.git

Install dependencies

  • With go :
$ make init
  • With dbmate ( Homebrew ) :
$ brew install dbmate

Environment setup

  • Create a config/app.yaml file with content:

      dsn: "postgres://postgres:postgres@localhost:5434/api?sslmode=disable"
      redis_client_host: "localhost"
      redis_client_port: 6377
    

How to start

Main database setup
  • Run docker-compose.yaml to prepare PostgreSQL and Redis.

    $ make setup-db
    
  • Run PostgreSQL migration:

    $ make migration-db
    

Develop

  • Run server main.

    $ make dev
    
  • Run generate mock test.

    $ make generate-test
    
  • Run test.

    $ make test
    
  • Generate swagger.

    $ make serve-swagger
    

Requirements:

    1. Create a new user
    1. Login user
    1. Create a new account

Directories

Path Synopsis
cmd
Package classification awesome.
Package classification awesome.
v1
middlewares
jwt
pkg
app
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL