Categorygithub.com/ShabnamHaque/go-jwt
module
0.0.0-20240902075909-1dbc22a3f683
Repository: https://github.com/shabnamhaque/go-jwt.git
Documentation: pkg.go.dev

# README

JWT Authentication and Validation in Go

A Backend Application with authentication and validation that maintains and addresses a MongoDB Database.

Table of Contents

  1. Introduction- Features
  2. Installation
  3. License
  4. Contact

Introduction - Features

Password Encryption - implements hashing of user passwords.

Maintain access points (User or Admin) - special access privilege using tokens.

Last updated time, created-at time, token, refresh token,userId etc.

Special access of all available users to the Admin.

Only the user themselves or the admin can access Logging in to access the user data.

Installation

Prerequisites

The libraries required are

github.com/go-playground/validator/v10
github.com/joho/godotenv
github.com/xdg-go/pbkdf2
go.mongodb.org/mongo-driver
# Example for Go installation
$ go version

Installing the Project

# Clone the repository
$ git clone https://github.com/ShabnamHaque/go-jwt.git

# Navigate to the project directory
$ cd go-jwt

# Install dependencies
$ go mod tidy

# Run the project
$ go run main.go


### File Structure
C:.
│   .env
│   go.mod
│   go.sum
│   main.go
│   
├───controllers
│       userController.go
│       
├───database
│       databaseConnection.go
│       
├───helpers
│       AuthHelper.go
│       TokenHelper.go
│
├───middleware
│       authMiddleware.go
│
├───models
│       userModel.go
│
└───routes
        authRouter.go
        userRouter.go
  

### Configuration of .env file
PORT=[..]
MONGODB_URL=[...]
SECRET_KEY="xyz"

License

This project is licensed under the MIT License.

Contact

Mail - [email protected]

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author