For Initialize DataBase Use :
Note: If You Want To Run Server in shop.ir change serverConfigure[bin/index.js] To Https
Note: Init Admin & User Data : Username : 09369514975 | Password : 123456
You Can Use This Mode For Send Token in Header Insteadof Send Token in Cookies
Body :
- uName : String (Required)
- uLastName : String (Required)
- uPhoneNumber : String (Required)
- uPassword : String (Required)
- uEmail
Response : {
"limitedToken": ""
}
Save limitedToken In our native db or localstorage for Next Part (Verify)
- limitedToken : "You received this value in the previous step" HEADER || COOKIES
- SmsCode : String (Required) BODY
Response
- Token : ""
- uPhoneNumber : String (Required),
- uPassword : String (Required),
Response
- Token : ""
- uPhoneNumber : String (Required)
Response : {
"limitedToken": ""
}
Save limitedToken In our native db or localstorage for Next Part (ChangePassword/Verify)
- limitedToken : "You received this value in the previous step" HEADER || COOKIES
- SmsCode : String (Required) || BODY
- limitedToken : "You received this value in the previous step" HEADER || COOKIES
- NewPassword : String (Required)
*** We Will Not Get You Token in this step ***
- Token : String (Required) || req.cookies.Token || req.cookies.limitedToken
- Header | Cookies : { Token : String (Required) }
- Body : { uPhoneNumber : String }
- {UseCredentials}
- uName Or uLastName Or uBirthday(1379/10/04) OR uAddress Example :
{
uName : 'John' ,
uBirthday : '1370/04/22'
}
- {UseCredentials}
- search : String
- provider : String (Provider English Name)
- category : String (Category English Name)
- categoryChild : String (Category Child English Name)
- brand : String (This Category Brand)
- min : Number
- max : Number
- page : Number
- sort : date | BuyCount | ViewCount
Example : /api/v1/Products/mobile {
search : 'گلک',
brand : ["sumsung" , "hp"] ,
available : true ,
min : 50000000
}
Response
status : 200 ,
message : '' ,
data : {
"Products" : {
"docs" : [returnedProducts]
"total": 1,
"limit": 20,
"page": 1,
"pages": 1
} ,
"Categories" : {
"subCategory": "electronic-devices",
"childs": [
{
"PersianName": "لب تاب",
"EnglishName": "laptop"
},
{
"PersianName": "گوشی",
"EnglishName": "mobile"
}
]
} ,
"Brands" : [
{ name : "hp" } , { name : "sumsung" }
]
}
}
Use EnglishTitle Or id
- EnglishTitle : String
- id : String
Response : {
InterView : [
{
"shortIntro": "",
"image": ""
},
{
"desc1": "",
"thumbnail": ""
},
{
"desc2": "",
"thumbnail": ""
}
] ,
Features : [
{key : "" , value : ""}
]
}
- No body just use : /api/v1/Comments/:EnglishName
- {Use Credential}
- productEnglishName ,
- Body
- {Use Credential}
- productName : String (Required)
- familiar : String
{useCredential}
- EnglishName : String (Require)
{useCredential} Response :
- Title : (Persian Title)
- productName : (English Title)
- count : (Count Off this in Basket)
{useCredential}
- EnglishName : String (Require)
- operation : mm Or pp (mm = -- And pp = ++) if count == 1 this is Usually delete from cart
{useCredential}
- price : Number
- address : String (Required)
- name : String
- lastName : String
- phoneNumber1 : String
- phoneNumber2 : String
Response : {
"data": {
"TokenForStartPayment": "bb1ce0a8e6f35cea78404e211363e904",
"UrlForStartPayment": "/api/v1/bb1ce0a8e6f35cea78404e211363e904"
}
}
**Redirect To This Address : /api/v1/StartPayment/{TokenForStartPayment} **
- For Example : http://shop.ir:4750/api/v1/Page/about initPages : about - contact
Response : {
pageName : "English Title" ,
pageTitle : 'Persian Title' ,
pageBody : 'Body (Description)'
}
- No Body Just Get it
Response : {
Sliders : [] // This is For Slider
constantSlider1 : '' , // Right Slider 1
constantSlider2 : '' , // Right Slider 2
}
- {Use Credential}
- {Use Credential}
- date : "1396/03/10" (String)
- time : 10 (Int)
Response : {
data : {
Sliders : [
'' , '' , '' //This is Just Threesome
] ,
constantSlider1 : '' ,
constantSlider2 : ''
}
}
- get : alias => find(params , option)
- getOne : alias => findOne(params , option)
- set : alias => updateOne(params , SetTo)
- new : alias => new db(params)
- delOne : alias => deleteOne(params)
Example ->
async function GetProduct(){
await UTILS.get('Product' , {'Title' : 'MyTitle'})
}
- zeroValidator (PhoneNumber) => Convert Imported Arg To PhoneNumber Whitout 0
- GenerateIntroduceCode (count) => Get A Count And Return a unique code
- jwtSign (params) CALLBACK(err , result) => Convert Params To Jwt
- decodeJWT (token) CALLBACK(err , result) => Parse token in Argument
- ApiResponse (res , status , message , data = [] ) => For Get Response To Api
This is Just Return A Persian Name For Response in Panel And In API
This is Logger Of Project We Use Morgan And Winston Together Example :
LOGGER.info()
LOGGER.error()
LOGGER.warn()