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
For Payment I have used the test case of Razorpay.
github.com/razorpay/razorpay-go
Package validator implements value validations for structs and individual fields based on tags.
github.com/go-playground/validator/v10
The twilio-go helper library lets you write Go code to make HTTP requests to the Twilio API and get the OTP. This is open source library.
github.com/twilio/twilio-go/rest/api/v2010
Gomail is a simple and efficient package to send emails. It is well tested and documented.
gopkg.in/mail.v2
JSON Web Tokens are an open, industry standard RFC 7519 method for representing claims securely between two parties.
github.com/golang-jwt/jwt/v4
go run main.go
API platforms Postman is used to run all the API's Provided by this project
https://documenter.getpostman.com/view/29263042/2s9YsM9qqS
You can test the API's using Postman. Use this postman collection to test the API's, all the documentation you needed is provided in the following.
Below is the APIs used in the application and some examples along with it.
http://localhost:8000/user/register
POST
Parameter | Type | Description |
---|---|---|
username |
string | Last name of the user |
email |
string | Email ID of the user |
password |
string | Password of the user |
phonenumber |
Intiger | Phone number of the user |
POST http://localhost:8000/user/register
-H "Content-Type: application/json"
-d '{
"username" : "Tony",
"email" : "tony@yopmail.com",
"password" : "12345",
"phonenumber": 9087867817
}'
HTTP Code: 200 OK
{
"message": "Go to /register/validate"
}
http://localhost:8000/user/register/validate
POST
Parameter | Type | Description |
---|---|---|
otp |
Intiger | Otp of the user |
email |
string | Email of the user |
POST http://localhost:8000/user/register/validate
-H "Content-Type: application/json" \
-d '{
"otp" : "1904",
"email" : "tony@yopmail.com"
}'
HTTP Code: 200 OK
{
"Message": "New User Successfully Registered"
}
http://localhost:8000/user/login
POST
Parameter | Type | Description |
---|---|---|
email |
string | Email ID of the user |
password |
string | Password of the user |
POST http://localhost:8000/user/register/validate
-H "Content-Type: application/json" \
-d '{
"email" : "tony@yopmail.com",
"password" :"12345"
}'
HTTP Code: 200 OK
{
"message": "User login successfully"
}