E-commerce project with microservice architecture using Go, Gin-Gonic, Postgres, Mongo and Docker.
The auth service handle the login with JWT Token and user creation, also create the roles and permissions for access control.
Techs: Go, Chi, Postgres
Header for all the POST routes except the /login:
Header |
Value |
Content-Type |
application/json |
Authorization |
Bearer jwt-token |
Header for the GET routes:
Header |
Value |
Authorization |
Bearer jwt-token |
Header |
Type |
Content-Type |
application/json |
{
"email": "email@gmail.com",
"password": "strongPassword123"
}
{
"name": "read-permission",
"description": "Grant access to create a permission"
}
GET /permissions/${permissionId}
Param |
Type |
permissionId |
uuid |
{
"name": "read-permission",
"description": "Grant access to read a permission"
}
{
"name": "John Doe",
"password": "strongPassword123",
"email": "test@gmail.com"
}
{
"userId": "bd42b8fd-5ba1-482b-8b3e-13b77095a7d7",
"roleId": "5658b58d-b749-4a74-bb71-483324eb0705"
}
{
"name": "Admin1",
"description": "Admin role"
}
{
"roleId": "5658b58d-b749-4a74-bb71-483324eb0705",
"permissionId": "c523de53-8b8e-47fa-a751-15f0e678f8d9"
}
{
"name": "Product Test",
"description": "This is a test product",
"image_url": "https://example.com/image.jpg",
"price": 19.99,
"quantity": 10,
"department_id": 1
}
Find all products (with pagination)
GET /api/v1/products?page=0&pageSize=10
Param |
Type |
page |
number |
pageSize |
number |
GET /api/v1/products/${id}
Find product by department id
GET /api/v1/products/department/${departmentId}
Param |
Type |
departmentId |
uuid |