A secure user authentication service built with Golang and JWT for seamless signup and signin experiences.
Github branch with email verification support : View branch
- godotenv: Used for loading environment variables from a
.env
file. - mongo-driver: MongoDB driver for Golang.
- jwt: Golang implementation of JSON Web Tokens (JWT).
- bcrypt: A library for hashing and comparing passwords using bcrypt algorithm.
- Clone the repository:
git clone https://github.com/aswinbennyofficial/jwt-auth-golang.git
- Install dependencies:
go get github.com/joho/godotenv
go get go.mongodb.org/mongo-driver/mongo
go get github.com/golang-jwt/jwt/v5
go get golang.org/x/crypto/bcrypt
- Configure your environment variables by renaming
.env.example
into.env
go run ./cmd/main/
By default, the server will start on port 8080.