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
- CRUD operations on the users database
- OTP functionality via email
.
├── 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 #
- Go (version 1.23+)
- PostgreSQL
- Keycloak
git clone https://github.com/Melom01/go-auth-system.git
cd go-auth-system
Install Go modules:
go mod tidy
Update the config.json
file with your personal configuration
go run main.go
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.
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.
This project is licensed under the MIT License. See the LICENSE file for details.