This is a GO GIN POSTGRES API Template built with Go and the Gin framework. It allows user registration, login, and access to user information with JWT-based authentication. you can custom this API as you need. I'll update this template little by little when I have a chance.
- User registration with password hashing
- User login with JWT token generation
- Example of Basic Crud
- JWT-based authentication middleware
- Testing API with get User
- Clone the repository:
git clone https://github.com/gunavault/Go-Gin-Postgres-template.git cd Go-Gin-Postgres-template
- Install Dependency:
go mod tidy
- Copy .env.example and make adjustment on your .env
- Create a PostgreSQL database and Ensure the required uuid-ossp extension is enabled for UUID generation.
- run the query from
query.sql
- run the code :
go run main.go
- POST
/login
- POST
/register
- GET
/users
- GET
/user/username
You can find more the endpoint at thunderclient collection thunder-collection_Go Gin postgres API template.json