Using Gin frame work and Postgress database testing Simple web application written in golang using postgres database
Package used for this WebApp
GORM |
https://gorm.io/ |
For Database opration |
GIN |
https://gin-gonic.com/ |
For HTTP web framework |
CRYPTO |
https://pkg.go.dev/golang.org/x/crypto@v0.8.0 |
Password encryption and decryption |
JWT |
https://pkg.go.dev/github.com/golang-jwt/jwt |
For implementation of JSON Web Tokens. |
GODOTENV |
https://github.com/joho/godotenv |
For loads env vars from a .env file |
User token is saved as USERTOKEN
Admin token is seved as ADMINTOKEN
LogIn
SignUp
Edit Profile
User Profile Viewer
LogIn
SignUp
Add Admi
List All User
Edit User
Delete User
1. Run your server eg: local server with postgres database
2. Give the database details to .env file
3. go run main.go
* Use this route for working eg: localhost://8080/login
Admin route
POST /adminlogin
POST /addadmin
GET /userview
GET /deleteuser
PUT /edituser
User route
POST /signup
POST /login
GET /userprofile
PUT /useredit
user = “your postgres username” password = “password of your postgres user” database = “your server name” localhost = “your host”
PORT = 8080 DATABASE = “host=localhost user=”user” password=”password” dbname=”database” port=”port” sslmode=disable”
// User key // You can edit the key
SCRECTKEY = AHDBHSIHSNNSGHSHSJHJ
ADMINKEY = KAHNDKJDHBMKJSNND
Upcomming Function
Upcomming Functionality