This project is written purely in Go Language. Gin (Http Web Frame Work) is used in this project. PostgreSQL Database is used to manage the data.
Gin-Gonic: This whole project is built on Gin frame work. Its is a popular http web frame work.
go get -u github.com/gin-gonic/gin
PostgreSQL: PostgreSQL is a powerful, open source object-relational database. The data managment in this project is done using PostgreSQL. ORM tool named GORM is also been used to simplify the forms of queries for better understanding.
go get -u gorm.io/gorm
go get -u gorm.io/driver/postgres
Package validator implements value validations for structs and individual fields based on tags.
github.com/go-playground/validator/v10
JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.
github.com/golang-jwt/jwt/v4
air
http://localhost:8000/api/v1/docs/index.html
http://localhost:8000/api/v1/auth/register
POST
Parameter | Type | Description |
---|---|---|
email |
string | Email ID of the user |
password |
string | Password of the user |
POST http://localhost:8000/api/v1/auth/register
-H "Content-Type: application/json"
-d '{
"email" : "[email protected]",
"password" : "12345",
}'
HTTP Code: 200 OK
"message": "User successfully registered."
}
http://localhost:8000/api/v1/auth/login
POST
Parameter | Type | Description |
---|---|---|
email |
string | Email ID of the user |
password |
string | Password of the user |
POST http://localhost:8000/api/v1/auth/login
-H "Content-Type: application/json"
-d '{
"email" : "[email protected]",
"password" : "12345",
}'
HTTP Code: 200 OK
{
"message": "User login successfully"
}