A simple e-commerce application
API is deployed locally
yarn install
to install packages..env
.
.env.sample
for sample variable keysdocker-compose up
to build the docker containr and run the application.base_url
is at http://localhost/api/v1
url - http://localhost/api/v1/users
method: POST
request body: {
"firstName": "firstName",
"firstName": "firstName",
"email": "[email protected]",
"password": "1234567890",
"phone": "08012345678800"
}
url - http://localhost/api/v1/users
method: GET
request body: {
"email": "[email protected]",
"password": "1234567890",
}
url - http://localhost/api/v1/products
method: POST
Authorization: Bearer {{token}}
request body: {
"name": "53\" Smart TV",
"category": "electronics",
"description": "Smart TV",
"price": "85,000"
}
url - http://localhost/api/v1/products
method: GET
url - http://localhost/api/v1/product/{{productId}}
method: GET
url - http://localhost/api/v1/cart
method: GET
Authorization: Bearer {{token}}
url - http://localhost/api/v1/cart
method: POST
Authorization: Bearer {{token}}
request body: {
"productId": "productId",
"quantity": 1
}
url - http://localhost/api/v1/cart
method: PATCH
Authorization: Bearer {{token}}
request body: {
"productId": ["productId-1", "productId-2", ...]
}
url - http://localhost/api/v1/order
method: GET
Authorization: Bearer {{token}}
url - http://localhost/api/v1/order
method: POST
Authorization: Bearer {{token}}
request body: {
"cartId": "cart-id"
}
url - http://localhost/api/v1/fulfill/{{orderId}}
method: POST
Authorization: Bearer {{token}}
url - http://localhost/api/v1/order/{{orderId}}
method: DELETE
Authorization: Bearer {{token}}
http://localhost/api/v1
in Postman to access the application endpoints.babe-node helps to compile es6 codes to es5 before for production deployment.