To run the app:
- clone this repository to your machine
- change your directory to marketplace-gin/server
go run .
OR
docker run -p 8080:5500 berik23/marketplacegin
- Product Routes:
- User Routes:
- Cart Routes:
- Order Routes:
- Shop Routes:
Reminder: Use the token in the response body of Sign In route in the authorization header to get access to the protected routes.
- User object:
{
"email": "berik@gmail.com",
"fullName": "Berik Bazarbayev",
"username": "berik23",
"password": "test1234"
}
- To sign in:
{
"email": "berik@gmail.com",
"password": "test1234"
}
- Shop object:
{
"userId": "6374b5ea3c0201a319270cac",
"shopName": "Berik's Shop",
"shopAddress":
{
"details": "B",
"building": "221",
"street": "Baker",
"area":
{
"city": "London",
"country": "UK"
}
}
}
- Address object:
{
"details": "no details",
"building": "149",
"street": "Daehak-ro",
"area":
{
"city": "Daejeon",
"country": "Korea"
}
}
- Content object:
{
"pID" : "63757a935c8d6c0d92d7aaf6",
"itemID" : "63757a935c8d6c0d92d7aaf7",
"quantity" : 5
}
- Order object:
{
orderContent:
{
"pID" : "63757a935c8d6c0d92d7aaf6",
"itemID" : "63757a935c8d6c0d92d7aaf8",
"quantity" : 5
}
shippingAddress:
{
"details": "no details",
"building": "149",
"street": "Kabanbai batyr",
"area":
{
"city": "Astana",
"country": "Kazakhstan"
}
}
}
- Status object:
{
"status": "Order Shipped"
}
- Guest (unauthorized) users:
- can view al products
- can view particular product
- can view products by category
- can search products
- can sign in
- can sign up
- Signed in (authorized) users:
- all above
- can add/update/delete products in/to cart
- can buy products directly
- can buy products from cart
- can add/edit/update addresses
- can view order history
- can monitor order status
- can update/delete account
- Sellers:
- all above
- can add/update/delete products
- can view list of orders their shop received
- can change order status (shipped, canceled, processed and etc.)
- productID
- productName
- description
- category
- images (array of URLs)
- items (array) :
- itemID
- color
- size (can be used as options)
- instock (amount that can be ordered)
- price
- discount
- productID
- itemID
- quantity
- userID
- username
- fullname
- password
- addresses (array)
- cart (array of contents)
- orders (array of orders)
- userID (owner of shop)
- shop name
- shop address
- products (array of products shop sells)
- orders (array of orders shop received)
- orderID
- order content
- shipping address
- order status (array of statuses):
- status
- time status created at
- details
- building
- street
- area:
- city
- country