Skip to content

nurefendi/auth-service-using-golang

Repository files navigation

Auth Service with Golang, Fiber, GORM, and MariaDB

Description

This authentication service is built using Golang with the Fiber framework, utilizing GORM as the ORM, and MariaDB as the primary database.

Features

  • User registration
  • User login with JWT
  • Authentication middleware
  • Refresh token
  • User management

Prerequisites

Ensure you have installed:

Installation

  1. Clone the repository:
    git clone https://github.com/nurefendi/auth-service.git
    cd auth-service
  2. Create a .local.env or .production.env file and add the database configuration:
    DB_USER=root
    DB_PASSWORD=yourpassword
    DB_HOST=localhost
    DB_PORT=3306
    DB_NAME=auth_db
    JWT_SECRET=your_secret_key
  3. Run MariaDB database:
    docker run --name mariadb -e MYSQL_ROOT_PASSWORD=yourpassword -e MYSQL_DATABASE=auth_db -p 3306:3306 -d mariadb
  4. Install dependencies:
    go mod tidy
  5. Run database migrations:
    go run main.go migrate
  6. Start the application:
    go run main.go

API Endpoints

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages