Skip to content

Basic boilerplate for Gin that uses JWT authentication with middlewares

License

Notifications You must be signed in to change notification settings

LydiaTrack/gin-jwt-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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}

About

Basic boilerplate for Gin that uses JWT authentication with middlewares

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages