https://github.com/aswinbennyofficial/jwt-auth-golang
A secure user auth service built with Golang and JWT for seamless signup and signin experiences with email verification support.
https://github.com/aswinbennyofficial/jwt-auth-golang
go golang jwt jwt-authentication mongodb
Last synced: 2 months ago
JSON representation
A secure user auth service built with Golang and JWT for seamless signup and signin experiences with email verification support.
- Host: GitHub
- URL: https://github.com/aswinbennyofficial/jwt-auth-golang
- Owner: aswinbennyofficial
- License: mit
- Created: 2024-01-08T12:25:09.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-13T08:46:50.000Z (over 1 year ago)
- Last Synced: 2025-01-19T09:43:26.879Z (4 months ago)
- Topics: go, golang, jwt, jwt-authentication, mongodb
- Language: Go
- Homepage:
- Size: 43.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# jwt-auth-golang
A secure user authentication service built with Golang and JWT for seamless signup and signin experiences.
Github branch with email verification support : [View branch](https://github.com/aswinbennyofficial/jwt-auth-golang/tree/%40aswinbennyofficial/feature/MagicLinkVerification)
## Dependencies
- [godotenv](https://github.com/joho/godotenv): Used for loading environment variables from a `.env` file.
- [mongo-driver](https://go.mongodb.org/mongo-driver/mongo): MongoDB driver for Golang.
- [jwt](https://github.com/golang-jwt/jwt/v5): Golang implementation of JSON Web Tokens (JWT).
- [bcrypt](https://golang.org/x/crypto/bcrypt): A library for hashing and comparing passwords using bcrypt algorithm.## Installation
1. Clone the repository:
```bash
git clone https://github.com/aswinbennyofficial/jwt-auth-golang.git
```2. Install dependencies:
```bash
go get github.com/joho/godotenv
```
```bash
go get go.mongodb.org/mongo-driver/mongo
``````bash
go get github.com/golang-jwt/jwt/v5
``````bash
go get golang.org/x/crypto/bcrypt
```3. Configure your environment variables by renaming `.env.example` into `.env`
## Usage
### Running the application```bash
go run ./cmd/main/
```
By default, the server will start on port 8080.