Skip to content

An authentication system written in Go that uses Keycloak as identity manager.

License

Notifications You must be signed in to change notification settings

Melom01/go-auth-system

Repository files navigation

AUTH SYSTEM (codename: sentinel)

OVERVIEW

This project implements an authentication system using Golang, with the following technologies:

  • Router: Mux
  • Database: PostgreSQL
  • Authentication Provider: Keycloak
  • Tokens: JWT (JSON Web Tokens)
  • Protocol: OAuth2

FEATURES

  1. CRUD operations on the users database
  2. OTP functionality via email

PROJECT STRUCTURE

.
├── apperror                        #            
├── config                          #
├── controller                      #
├── database                        #
├── emailer                         #
│   └── templates                   #
├── logger                          #    
├── middleware                      #
├── model                           #
├── routing                         #
├── service                         #
├── tests                           #
│   ├── config_test                 #
│   ├── logger_test                 #
│   └── utils_test                  #    
│       └── mock_data               #
├── utils                           #
├── go.mod                          #
├── go.sum                          #
├── main.go                         #
└── README.md                       #  

INSTALLATION

Prerequisites:

Clone the repository

git clone https://github.com/Melom01/go-auth-system.git
cd go-auth-system

Set up dependencies

Install Go modules:

go mod tidy

CONFIGURATION

Update the config.json file with your personal configuration

USAGE

Run the application

go run main.go

Sort imports

Making the sort_imports.sh script executable

Before running the script for the first time, you need to make it executable. You can do this by running the following command in your terminal:

chmod +x sort_imports.sh

This step is only required once.

Running the script

After making the script executable, you can sort all imports throughout the application by running:

./sort_imports.sh

The script will automatically process all Go files, excluding any specified patterns (e.g., files with _gen.go in the di folder). Once completed, you will see a confirmation message.

LICENSE

This project is licensed under the MIT License. See the LICENSE file for details.

About

An authentication system written in Go that uses Keycloak as identity manager.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published