Categorygithub.com/Harsh1s/GoKart
repositorypackage
0.0.0-20231202055313-17ad297221c5
Repository: https://github.com/harsh1s/gokart.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# README

GoKart

Ecommerce Project With Golang

# You can start the project with below commands
docker-compose up -d
go run main.go
  • SIGNUP FUNCTION API CALL (POST REQUEST)

http://localhost:8000/users/signup

{
  "first_name": "Harsh",
  "last_name": "Raj",
  "email": "[email protected]",
  "password": "harshraj",
  "phone": "+8585858585"
}

Response :"Successfully Signed Up!!"

{
  "email": "[email protected]",
  "password": "harshraj"
}

response will be like this

{
  "_id": "***********************",
  "first_name": "harsh",
  "last_name": "raj",
  "password": "$2a$14$UIYjkTfnFnhg4qhIfhtYnuK9qsBQifPKgu/WPZAYBaaN17j0eTQZa",
  "email": "[email protected]",
  "phone": "+8585858585",
  "token": "eyJc0Bwcm90b25vbWFpbC5jb20iLCJGaXJzdF9OYW1lIjoiam9zZXBoIiwiTGFzdF9OYW1lIjoiaGVybWlzIiwiVWlkIjoiNjE2MTRmNTM5ZjI5YmU5NDJiZDlkZjhlIiwiZXhwIjoxNjMzODUzNjUxfQ.NbcpVtPLJJqRF44OLwoanynoejsjdJb5_v2qB41SmB8",
  "Refresh_Token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJFbWFpbCI6IiIsIkZpcnLCJVaWQiOiIiLCJleHAiOjE2MzQzNzIwNTF9.ocpU8-0gCJsejmCeeEiL8DXhFcZsW7Z3OCN34HgIf2c",
  "created_at": "2023-10-09T08:14:11Z",
  "updtaed_at": "2023-10-09T08:14:11Z",
  "user_id": "61614f539f29be942bd9df8e",
  "usercart": [],
  "address": [],
  "orders": []
}
{
  "product_name": "HP Pavilion 14",
  "price": 1500,
  "rating": 10,
  "image": "pavilion.jpg"
}

Response : "Successfully added our Product Admin!!"

Response

[
  {
    "Product_ID": "6153ff8edef2c3c0a02ae39a",
    "product_name": "hppavilion14",
    "price": 1500,
    "rating": 10,
    "image": "pavilion.jpg"
  },
  {
    "Product_ID": "616152679f29be942bd9df8f",
    "product_name": "dellxps13",
    "price": 900,
    "rating": 5,
    "image": "xps.jpg"
  },
  {
    "Product_ID": "616152ee9f29be942bd9df90",
    "product_name": "iphone13",
    "price": 1700,
    "rating": 4,
    "image": "iphone.jpg"
  },
  {
    "Product_ID": "616152fa9f29be942bd9df91",
    "product_name": "asusvivobook14",
    "price": 1000,
    "rating": 7,
    "image": "vivobook.jpg"
  },
  {
    "Product_ID": "616153039f29be942bd9df92",
    "product_name": "acerpredator",
    "price": 3000,
    "rating": 10,
    "image": "acer.jpg"
  }
]
  • Search Product by regex function (GET REQUEST)

defines the word search sorting http://localhost:8000/users/search?name=al

response:

[
  {
    "Product_ID": "616152fa9f29be942bd9df91",
    "product_name": "HP Pavilion 14",
    "price": 1500,
    "rating": 10,
    "image": "1.jpg"
  },
  {
    "Product_ID": "616153039f29be942bd9df92",
    "product_name": "Dell XPS 13",
    "price": 300,
    "rating": 10,
    "image": "1.jpg"
  }
]
{
  "house_name": "white house",
  "street_name": "white street",
  "city_name": "washington",
  "pin_code": "332423432"
}