项目作者: mulutbrah

项目描述 :
E-Commerce based on NUXT (SSR) Project Example
高级语言: JavaScript
项目地址: git://github.com/mulutbrah/Nuxt-gamestation.git
创建时间: 2019-08-24T15:17:43Z
项目社区:https://github.com/mulutbrah/Nuxt-gamestation

开源协议:

下载


e-commerce

Register :

  1. URL: http://127.0.0.1:3000/register
  2. METHOD : POST
  3. Authenticated Required : NO
  4. Authorized Required : NO
  5. Data Input :
  6. {
  7. name: "nobita",
  8. email: "nobita@mail.com",
  9. password: "nobita"
  10. }
  11. Response Status : 201
  12. Data Output :
  13. {
  14. "_id": "5ccf109c227c7e1387ab12f1",
  15. "name": "nobita",
  16. "email": "nobita@mail.com",
  17. "password": "$2a$10$BwEf3Bwsa8PJfliNr7UVOOoHPU0z8ucUdyt9JyJzM4KU3hdTwxHTW",
  18. "__v": 0
  19. }
  20. Response Status : 400 Bad Request
  21. Output :
  22. "User validation failed: name: Name is required, email: Email is required, password: Password is required"
  23. Response Status : 500
  24. Output :
  25. "Internal Server Error"

Login :

  1. URL: http://127.0.0.1:3000/login
  2. METHOD : POST
  3. Authenticated Required : NO
  4. Authorized Required : NO
  5. Data Input :
  6. {
  7. email: "lennon@gmail.com",
  8. password: "lennon"
  9. }
  10. Response Status : 200
  11. Data Output :
  12. {
  13. "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjVjZDY2MjM1YjM5NWYxNDNmNzU5YzY3YiIsImVtYWlsIjoibmFydXRvQGdtYWlsLmNvbSIsImlhdCI6MTU1NzYxOTUwNywiZXhwIjoxNTU3NzA1OTA3fQ.ybuqEKrYVIzCJBGP6QjzD1Lcrd-lS08q5BOwNtnNFCo",
  14. "currentUser": {
  15. "userId": "5cd66235b395f143f759c67b",
  16. "name": "lennon",
  17. "email": "lennon@gmail.com"
  18. }
  19. }
  20. Response Status : 400 Bad Request
  21. Output :
  22. {
  23. "err": "email/password wrong!"
  24. }
  25. Response Status : 500
  26. Output :
  27. "Internal Server Error"

list User :

  1. http://127.0.0.1:3000/users
  2. METHOD : GET
  3. Authenticated Required : NO
  4. Authorized Required : NO
  5. Response Status : 200
  6. [
  7. {
  8. "_id": "5cd66235b395f143f759c67b",
  9. "name": "lennon",
  10. "email": "lennon@gmail.com",
  11. "password": "$2a$10$NrYHAA94S/uCtYl2VsGqz.pbXqPqMbYtx.HyiaRbyMxy4VMu6JAoe",
  12. "__v": 0
  13. },
  14. {
  15. "_id": "5cd76100aaa5a74b2da055f6",
  16. "name": "nobita",
  17. "email": "nobita@gmail.com",
  18. "password": "$2a$10$.rsdx6VQImhJZ/e6hdgSAOtImrilnlGc80XU2RozzqfGzuBQr944i",
  19. "__v": 0
  20. },
  21. {...},{...}
  22. ]
  23. Response Status : 500
  24. Output :
  25. "Internal Server Error"

Find By Id :

  1. http://127.0.0.1:3000/users/5cd76100aaa5a74b2da055f6
  2. METHOD : GET
  3. Authenticated Required : NO
  4. Authorized Required : NO
  5. Data Input :
  6. {
  7. name: "lennon",
  8. email: "lennon@gmail.com"
  9. }
  10. Response Status : 200
  11. {
  12. "_id": "5cd66235b395f143f759c67b",
  13. "name": "lennon",
  14. "email": "lennon@gmail.com",
  15. "password": "$2a$10$NrYHAA94S/uCtYl2VsGqz.pbXqPqMbYtx.HyiaRbyMxy4VMu6JAoe",
  16. "__v": 0
  17. }
  18. Response Status : 500
  19. Output :
  20. "Internal Server Error"

Update By Id :

  1. http://127.0.0.1:3000/users/5cd76100aaa5a74b2da055f6
  2. METHOD : PUT
  3. Authenticated Required : NO
  4. Authorized Required : NO
  5. Response Status : 200
  6. {
  7. "_id": "5cd66235b395f143f759c67b",
  8. "name": "nobita",
  9. "email": "nobita@gmail.com",
  10. "password": "$2a$10$NrYHAA94S/uCtYl2VsGqz.pbXqPqMbYtx.HyiaRbyMxy4VMu6JAoe",
  11. "__v": 0
  12. }
  13. Response Status : 500
  14. Output :
  15. "Internal Server Error"

list Product:

  1. http://localhost:3000/products
  2. METHOD : GET
  3. Authenticated Required : NO
  4. Authorized Required : NO
  5. Response Status : 200
  6. [
  7. {
  8. "_id": "5cd6d56b2fc1c94b08fde8c9",
  9. "title": "naruto21",
  10. "content": "nartuo211111111",
  11. "created_at": "2019-05-11T14:00:11.801Z",
  12. "author": {
  13. "_id": "5cd66235b395f143f759c67b",
  14. "name": "naruto",
  15. "email": "naruto@gmail.com",
  16. "password": "$2a$10$NrYHAA94S/uCtYl2VsGqz.pbXqPqMbYtx.HyiaRbyMxy4VMu6JAoe",
  17. "__v": 0
  18. },
  19. "featured_image": "",
  20. "__v": 0
  21. },
  22. {...},{...},{...}
  23. ]
  24. Response Status : 500
  25. Output :
  26. "Internal Server Error"

Create Product :

  1. http://localhost:3000/products
  2. METHOD : POST
  3. Authenticated Required : YES
  4. Authorized Required : NO
  5. Data Input :
  6. {
  7. name: "White Album",
  8. price: 1000000000
  9. }
  10. Response Status : 200
  11. Data Output :
  12. {
  13. "_id": "5cd767ebaaa5a74b2da055fc",
  14. "name": "White Album",
  15. "price": "1000000000",
  16. "__v": 0
  17. }
  18. Response Status : 400 Bad Request
  19. Output :
  20. "Product validation failed: title: Name is required, price: Price is required"
  21. Response Status : 400 Bad Request
  22. Output :
  23. "Token wrong!"
  24. Response Status : 500
  25. Output :
  26. "Internal Server Error"

Delete Product :

  1. http://localhost:3000/products/5cd767ebaaa5a74b2da055fc
  2. METHOD : DELETE
  3. Authenticated Required : YES
  4. Authorized Required : YES
  5. Response Status : 200
  6. {
  7. "_id": "5cd767ebaaa5a74b2da055fc",
  8. "name": "White Album",
  9. "price": "1000000000",
  10. "__v": 0
  11. }
  12. Response Status : 404
  13. Output :
  14. {
  15. "msg": "You dont have access"
  16. }
  17. Response Status : 400 Bad Request
  18. Output :
  19. "Token wrong!"
  20. Response Status : 500
  21. Output :
  22. "Internal Server Error"

Update Product :

  1. http://localhost:3000/products/5cd6d56b2fc1c94b08fde8c9
  2. METHOD : PUT
  3. Authenticated Required : YES
  4. Authorized Required : YES
  5. Response Status : 200
  6. "Success"
  7. Response Status : 404
  8. Output :
  9. {
  10. "msg": "You dont have access"
  11. }
  12. Response Status : 400 Bad Request
  13. Output :
  14. "Token wrong!"
  15. Response Status : 500
  16. Output :
  17. "Internal Server Error"

list Carts:

  1. http://localhost:3000/carts
  2. METHOD : GET
  3. Authenticated Required : YES
  4. Authorized Required : NO
  5. Response Status : 200
  6. [
  7. {
  8. "_id": "5cd6d56b2fc1c94b08fde8c9",
  9. "title": "naruto21",
  10. "content": "nartuo211111111",
  11. "created_at": "2019-05-11T14:00:11.801Z",
  12. "author": {
  13. "_id": "5cd66235b395f143f759c67b",
  14. "name": "naruto",
  15. "email": "naruto@gmail.com",
  16. "password": "$2a$10$NrYHAA94S/uCtYl2VsGqz.pbXqPqMbYtx.HyiaRbyMxy4VMu6JAoe",
  17. "__v": 0
  18. },
  19. "featured_image": "",
  20. "__v": 0
  21. },
  22. {...},{...},{...}
  23. ]
  24. Response Status : 500
  25. Output :
  26. "Internal Server Error"

Create Product :

  1. http://localhost:3000/carts
  2. METHOD : POST
  3. Authenticated Required : YES
  4. Authorized Required : NO
  5. Data Input :
  6. {
  7. name: "White Album",
  8. price: 1000000000
  9. }
  10. Response Status : 200
  11. Data Output :
  12. {
  13. "_id": "5cd767ebaaa5a74b2da055fc",
  14. "name": "White Album",
  15. "price": "1000000000",
  16. "__v": 0
  17. }
  18. Response Status : 400 Bad Request
  19. Output :
  20. "Product validation failed: title: Name is required, price: Price is required"
  21. Response Status : 400 Bad Request
  22. Output :
  23. "Token wrong!"
  24. Response Status : 500
  25. Output :
  26. "Internal Server Error"

Delete Cart :

  1. http://localhost:3000/products/5cd767ebaaa5a74b2da055fc
  2. METHOD : DELETE
  3. Authenticated Required : YES
  4. Authorized Required : YES
  5. Response Status : 200
  6. {
  7. "_id": "5cd767ebaaa5a74b2da055fc",
  8. "name": "White Album",
  9. "price": "1000000000",
  10. "__v": 0
  11. }
  12. Response Status : 404
  13. Output :
  14. {
  15. "msg": "You dont have access"
  16. }
  17. Response Status : 400 Bad Request
  18. Output :
  19. "Token wrong!"
  20. Response Status : 500
  21. Output :
  22. "Internal Server Error"

Delete Carts Belongs :

  1. http://localhost:3000/carts/belongs/5cd767ebaaa5a74b2da055fc
  2. METHOD : DELETE
  3. Authenticated Required : YES
  4. Authorized Required : YES
  5. Response Status : 200
  6. {
  7. "_id": "5cd767ebaaa5a74b2da055fc",
  8. "name": "White Album",
  9. "price": "1000000000",
  10. "__v": 0
  11. }
  12. Response Status : 404
  13. Output :
  14. {
  15. "msg": "You dont have access"
  16. }
  17. Response Status : 400 Bad Request
  18. Output :
  19. "Token wrong!"
  20. Response Status : 500
  21. Output :
  22. "Internal Server Error"

List Transactions :

  1. http://localhost:3000/transactions
  2. METHOD : GET
  3. Authenticated Required : YES
  4. Authorized Required : YES (ADMIN)
  5. Response Status : 200
  6. "Success"
  7. Response Status : 404
  8. Output :
  9. {
  10. "msg": "You dont have access"
  11. }
  12. Response Status : 400 Bad Request
  13. Output :
  14. "Token wrong!"
  15. Response Status : 500
  16. Output :
  17. "Internal Server Error"

List User Transactions :

  1. http://localhost:3000/transactions/user-transaction
  2. METHOD : GET
  3. Authenticated Required : YES
  4. Authorized Required : NO
  5. Response Status : 200
  6. "Success"
  7. Response Status : 404
  8. Output :
  9. {
  10. "msg": "You dont have access"
  11. }
  12. Response Status : 400 Bad Request
  13. Output :
  14. "Token wrong!"
  15. Response Status : 500
  16. Output :
  17. "Internal Server Error"

Create Transaction :

  1. http://localhost:3000/transactions
  2. METHOD : POST
  3. Authenticated Required : YES
  4. Authorized Required : NO
  5. Data Input :
  6. {
  7. name: "White Album",
  8. price: 1000000000
  9. }
  10. Response Status : 200
  11. Data Output :
  12. {
  13. "_id": "5cd767ebaaa5a74b2da055fc",
  14. "name": "White Album",
  15. "price": "1000000000",
  16. "__v": 0
  17. }
  18. Response Status : 400 Bad Request
  19. Output :
  20. "Product validation failed: title: Name is required, price: Price is required"
  21. Response Status : 400 Bad Request
  22. Output :
  23. "Token wrong!"
  24. Response Status : 500
  25. Output :
  26. "Internal Server Error"

Update Transaction Status:

  1. http://localhost:3000/transactions/delivered
  2. METHOD : PATCH
  3. Authenticated Required : YES
  4. Authorized Required : YES
  5. Response Status : 200
  6. {
  7. "_id": "5cd767ebaaa5a74b2da055fc",
  8. "name": "White Album",
  9. "price": "1000000000",
  10. "__v": 0
  11. }
  12. Response Status : 404
  13. Output :
  14. {
  15. "msg": "You dont have access"
  16. }
  17. Response Status : 400 Bad Request
  18. Output :
  19. "Token wrong!"
  20. Response Status : 500
  21. Output :
  22. "Internal Server Error"

e-commerce

Free Software, Yeah!