This repository contains a Golang application that provides JWT authentication using Redis for storing JWT tokens and MySQL as the database. The HTTP server is built using Gin Gonic, and Cobra CLI is integrated for command-line functionalities.
- JWT Authentication: Secure your application with JSON Web Token authentication.
- Redis Integration: Efficient storage and retrieval of JWT tokens using Redis.
- MySQL Database: Store user data securely in a MySQL database.
- Gin Gonic: A fast and lightweight HTTP web framework for Go.
- Cobra CLI: Command-line interface for easy management and configuration.
Follow these steps to set up and run the Golang JWT Authentication application:
- Golang: Make sure you have Go installed on your machine.
- Redis: Install and run a Redis server.
- MySQL: Install and configure a MySQL server.
-
Clone the repository:
git clone https://github.com/PoweredByCaffein/go-jwt.git
-
Navigate to the project directory:
cd go-jwt
-
Install dependencies:
go mod download
-
Copy the example configuration file:
cp .env.example .env
-
Update the
.env
file with your Redis and MySQL configuration.
go run main.go server