game-library-auth

module
v0.0.0-...-c00eb94 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2025 License: MIT

README

game-library-auth

Introduction

game-library-auth is an authentication service for the game-library web application. It is responsible for user authentication and authorization.

This service is part of a game-library web application:

  • game-library - main service for fetching, storing, and providing games data
  • current service handles authentication and authorization
  • game-library-ui - UI representation service

Table of Contents

Installation

Prerequisites: go, Docker, Make. To set up the service, follow these steps:

  1. Clone the repository:

    git clone https://github.com/OutOfStack/game-library-auth.git
    cd game-library-auth
    
  2. Set up the database:

    make drunpg # runs postgres server with 'auth' db in docker container
    make migrate # applies all migrations to database
    
  3. Generate key pair for local JWT signing:

    make keygen # creates private/public key pair files
    
  4. Create the app.env file based on app.example.env and update it with your local configuration settings.

  5. Get Google API Client ID for Google OAuth and set it in app.env: https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid

  6. Build and run the service:

    make build
    make run
    

Refer to the List of Make Commands for a complete list of commands.

Usage

After installation, you can use the following Make commands to develop the service:

  • make test: Runs tests for the whole project.
  • make generate: Generates documentation for Swagger UI.
  • make lint: Runs golangci-lint for code analysis.

Refer to the List of Make Commands for a complete list of commands.

Tech Stack

  • Data storage with PostgreSQL.
  • Tracing with Zipkin.
  • Log management with Graylog.
  • Code analysis with golangci-lint.
  • CI/CD with GitHub Actions and deploy to Kubernetes (microk8s) cluster.

Configuration

Documentation

API documentation is available via Swagger UI. To generate the documentation, run:

make generate

List of Make Commands

Main Commands
build      builds app
build-mng  builds manage app
run        runs app
test       runs tests for the whole project
generate   generates docs for Swagger UI
lint       runs golangci-lint
cover      outputs tests coverage
Database Commands
drunpg     runs postgres server with 'auth' db in docker container
migrate    applies all migrations to database (reads from config file)
rollback   roll backs one last migration of database (reads from config file)
Key Management
keygen     creates private/public key pair files
Docker Commands
dbuildauth builds auth app docker image
dbuildmng  builds manage app docker image
drunauth   runs auth app in docker container

License

MIT License

Directories

Path Synopsis
cmd
Package docs Code generated by swaggo/swag.
Package docs Code generated by swaggo/swag.
internal
handlers/mocks
Package handlers_mocks is a generated GoMock package.
Package handlers_mocks is a generated GoMock package.
web
pkg
log

Jump to

Keyboard shortcuts

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