Skip to content

Simple Gin Starter project with some industry standard tools setup

License

Notifications You must be signed in to change notification settings

thomasmendez/go-template-simple-server

Repository files navigation

GoLang Gin Starter Project

Simple Gin Starter project with some industry standard tools setup

Run Locally

Clone Repository or Use Template

Clone this repository git clone https://github.com/thomasmendez/go-template-simple-server.git or click 'Use this template' in the Github UI to use the current project as a template.

Install Go

Install the latest version of Go here

Verify Go is installed by checking the Go version with go version

Install Makefile

This project uses the Makefile in order to easily run sets of commands. The commands can also be run invidually using the commands listed for the makefile command

Install Dependencies

Run make tidy in order to run the Go commands needed to install releated dependencies properly

Setup Environment Variables

Create a .env file from the .env.example file and modify the environment variables as needed

Build

To build the project run make build

Build and Deply with Docker

Note: Make sure Docker is running on your machine

The microservice can be build and deployed with make docker

API documentation can be viewed at http://localhost:8081/api/swagger

Application can stop running by pressing ctrl+c on the terminal

Tests

Unit Tests

To run the unit test for the project, run make test

Libraries Used

Gin

Gin is a high performance web framework in Golang

Viper

Viper is a highly flexible configuration library

Zap

Zap fast, structured, leveled logging in Golang

Testify

Testify is an assertion library. Can also be used for mocking and building testing suites

Tools Used

Swagger

Swagger is used as API documentation

Can be modified in the swagger/swagger.yaml file

Docker

Docker allows you to build and run this microservice

Husky

Husky allows you to run scripts in the git lifecyle

This project is configured to run test before making a successful commit

Modify the pre-commit hook with commands you wish to run before committing

About

Simple Gin Starter project with some industry standard tools setup

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published