Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 785 Bytes

README.md

File metadata and controls

34 lines (25 loc) · 785 Bytes

Gin JWT Boilerplate

This is a basic and easy to use boilerplate for a Golang project using Gin and JWT.

Features

  • JWT Authentication
  • JWT Authorization
  • Bearer Token
  • Refresh Token
  • User CRUD
  • User Login
  • User Logout
  • MongoDB Database
  • Docker TestContainers

Requirements

Each package contains a readme with more information about the package.

Usage

Create a .env file in the internal/service directory and add the following environment variables:

MONGODB_URI={YOUR_MONGODB_URI}
DB_NAME={YOUR_DB_NAME}
JWT_SECRET={YOUR_JWT_SECRET}
JWT_EXPIRES_IN_HOUR={YOUR_JWT_EXPIRES_IN_HOUR}
JWT_REFRESH_EXPIRES_IN_HOUR={YOUR_JWT_REFRESH_EXPIRES_IN_HOUR}