bixlabs / authentication

A module in Go for authentication
1 stars 0 forks source link

Go Report Card CircleCI GitHub release (latest by date including pre-releases)

Requirements

Installation, please read this before running anything.

$ make

Go Modules

Creating an API through gin-gonic

$ make run

How to generate API documentation

How to make build of a main.go file and run it on Linux.

$ make build

or

$ go build -o ./tmp/auth-server ./api/main.go

Building for MacOS

$ make build-for-mac

Building for Windows

$ make build-for-windows

How to run format

How to run the linter

$ golangci-lint run

Logging framework

How to handle environment variables

How to run the tests

$ make test

or

$ go test -cover -v ./...

How to see test coverage

$ make coverage
$ make coverage-html

Storage

TL;DR How to run/build

Docker

Getting Started

At the time of configuration we used Docker version 19.03.1 and Docker Compose version 1.24.1

Prerequisites

In order to run this container you'll need docker and docker-compose installed. You will also need to configure the .env in the root of the project, please read the environment section.

Usage

To run the container you should run:

$ make docker-run

If you need to build the image:

$ make docker-build

Behind the scenes we are using docker-compose, but you could build and run the same configuration using docker:

$ docker build -f build/package/Dockerfile -t authentication_api .
$ docker run -d --env-file=.env -p 9000:9000 --name authentication_api authentication_api

Notes

If you want more information about all the folders being used in this project please refer to the original template. Thanks for the authors of this one!