{"id":15435258,"url":"https://github.com/neuodev/ecart","last_synced_at":"2025-04-19T18:11:32.732Z","repository":{"id":59958345,"uuid":"351195057","full_name":"neuodev/ecart","owner":"neuodev","description":"A mobile friendly, production ready and fully featured e-commerce website. ","archived":false,"fork":false,"pushed_at":"2023-05-05T20:15:36.000Z","size":15785,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-17T04:01:42.815Z","etag":null,"topics":["javascript","mongodb","nodejs","react","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neuodev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-24T19:10:17.000Z","updated_at":"2024-09-13T17:11:52.000Z","dependencies_parsed_at":"2024-10-21T20:04:07.902Z","dependency_job_id":null,"html_url":"https://github.com/neuodev/ecart","commit_stats":{"total_commits":190,"total_committers":3,"mean_commits":"63.333333333333336","dds":0.0736842105263158,"last_synced_commit":"bb546a9c1bb86c30def20ab6abcf2144a05cd3af"},"previous_names":["neuodev/ecart"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fecart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fecart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fecart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neuodev%2Fecart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neuodev","download_url":"https://codeload.github.com/neuodev/ecart/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249760086,"owners_count":21321840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","mongodb","nodejs","react","typescript"],"created_at":"2024-10-01T18:43:14.708Z","updated_at":"2025-04-19T18:11:32.715Z","avatar_url":"https://github.com/neuodev.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# eCart\n\n- E-commerce platform that gives the client good sopping experience\n- Shopping cart, wishlist, search, advanced filters, checkout, payment, REST API, Auth\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"./wallet.png\" alt=\"Wallet\" title=\"Wallet\"/\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003e\n    \u003ca href=\"https://walletecommerce.herokuapp.com/\"\u003eLive Preview 👀\u003c/a\u003e\n\u003c/h1\u003e\n\n## Preview 📺\n\n![Home](./preview/wallet_1.png)\n![Product](./preview/wallet_2.png)\n![Wishlist](./preview/wallet_3.png)\n![Cart](./preview/wallet_4.png)\n\n\u003cdetails\u003e \n\u003csummary\u003eSee more...\u003c/summary\u003e\n\n![Checkout](./preview/wallet_5.png)\n![Cart Dialog](./preview/wallet_6.png)\n![Payment](./preview/wallet_7.png)\n![Payment](./preview/wallet_8.png)\n![Orders](./preview/wallet_9.png)\n\n\u003c/details\u003e\n\n# API\n\nFor full documentaiton try to import **[this collection](./Wallet%20e-commerce.postman_collection.json)** into your **[postman](https://www.postman.com/)**\n\n# User\n\n\u003cdetails\u003e\n\u003csummary\u003ePUT /api/v1/users/:id\u003c/summary\u003e\n\n\u003cbr /\u003e\n\nUpdate user info by the `admin`\n\n\u003cbr /\u003e\n\n**Description:** Update user account\n\n**Access:** Private/Admin\n\n### Request\n\n```ts\ntype body = {\n  firstName?: string;\n  lastName?: string;\n  email?: string;\n  isAmdin?: boolean;\n};\n```\n\n```json\n{\n  \"isAdmin\": true\n}\n```\n\n### Response\n\n```json\n{\n  \"_id\": \"6326a3633979c3a722be8411\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"email\": \"jane@wallet.io\",\n  \"isAdmin\": true\n}\n```\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eGET /api/v1/users \u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Get all users\n\n**Access:** Private/Admin\n\n### Request\n\n#### Headers\n\n`Authorization: Bearer \u003cTOKEN\u003e`\n\n### Response\n\n```json\n{\n  \"users\": [\n    {\n      \"_id\": \"6326a3633979c3a722be8411\",\n      \"firstName\": \"Jane\",\n      \"lastName\": \"Doe\",\n      \"email\": \"jane@wallet.io\",\n      \"password\": \"$2a$10$eajsr5X/E3D2B8N8anLa8O3LlF7Sj/sCquBs2xPH.n7wXBai4viI2\",\n      \"isAdmin\": false,\n      \"createdAt\": \"2022-09-18T04:49:39.687Z\",\n      \"updatedAt\": \"2022-09-18T04:49:39.687Z\",\n      \"__v\": 0\n    },\n    {\n      \"_id\": \"6326a4fda8012c4bc02d6368\",\n      \"firstName\": \"Jone\",\n      \"lastName\": \"Doe\",\n      \"email\": \"jone@wallet.io\",\n      \"password\": \"$2a$10$wKNngaZrvxMsTRQajNfzjekiLhTSZRSdAWdWkrJ1U3D8gCE9nQoZ2\",\n      \"isAdmin\": true,\n      \"createdAt\": \"2022-09-18T04:56:29.313Z\",\n      \"updatedAt\": \"2022-09-18T05:29:13.020Z\",\n      \"__v\": 0\n    }\n  ],\n  \"count\": 2\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDELETE /api/v1/users/:id \u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Delete a user by `id`\n\n**Access:** Private/Admin\n\n### Request\n\n#### Headers\n\n`Authorization: Bearer \u003cTOKEN\u003e`\n\n### Response\n\n```json\n{\n  \"message\": \"User removed\"\n}\n```\n\n\u003c/details\u003e\n\u003cdetails\u003e\n\u003csummary\u003eDELETE /api/v1/users/account \u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Delete user account by the user itself\n\n**Access:** Private/user\n\n### Request\n\n#### Headers\n\n`Authorization: Bearer \u003cTOKEN\u003e`\n\n### Response\n\n```json\n{\n  \"message\": \"User removed\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET /api/v1/users/:id \u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Get user by Id\n\n**Access:** Private/Admin\n\n### Request\n\n#### Headers\n\n`Authorization: Bearer \u003cTOKEN\u003e`\n\n### Response\n\n```json\n{\n  \"_id\": \"6326a3633979c3a722be8411\",\n  \"firstName\": \"Jane\",\n  \"lastName\": \"Doe\",\n  \"email\": \"jane@wallet.io\",\n  \"isAdmin\": false,\n  \"createdAt\": \"2022-09-18T04:49:39.687Z\",\n  \"updatedAt\": \"2022-09-18T04:49:39.687Z\",\n  \"__v\": 0\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePOST /api/v1/users/login\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Authorize user for login\n\n**Access:** Public\n\n### Request\n\n```ts\ntype Body = {\n  email: string;\n  password: string;\n};\n```\n\n```json\n{\n  \"email\": \"jone@wallet.io\",\n  \"password\": \"1234567\"\n}\n```\n\n### Response\n\n```json\n{\n  \"_id\": \"6326a4fda8012c4bc02d6368\",\n  \"firstName\": \"Jone\",\n  \"lastName\": \"Doe\",\n  \"email\": \"jone@wallet.io\",\n  \"isAdmin\": true,\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYzMjZhNGZkYTgwMTJjNGJjMDJkNjM2OCIsImlhdCI6MTY2MzQ4MDk4NCwiZXhwIjoxNjY2MDcyOTg0fQ.rv7FZMh_ScxkdvYHfBC03cEajFuViXoEtwN74FYmkRQ\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePOST /api/v1/users\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Register a new user\n\n**Access:** Public\n\n### Request\n\n```json\n{\n  \"firstName\": \"Joen\",\n  \"lastName\": \"Doe\",\n  \"email\": \"jone_1@wallet.io\",\n  \"password\": \"1234567\"\n}\n```\n\n### Response\n\n```json\n{\n  \"_id\": \"633d4c6abd2e35a18c53e777\",\n  \"firstName\": \"Joen\",\n  \"lastName\": \"Doe\",\n  \"email\": \"jone_3@wallet.io\",\n  \"isAdmin\": false,\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYzM2Q0YzZhYmQyZTM1YTE4YzUzZTc3NyIsImlhdCI6MTY2NDk2MTY0MiwiZXhwIjoxNjY3NTUzNjQyfQ.OgnvSKOiyoCziTcU9q6yElFpd0REM2BBuP6L53Loz8Q\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET /api/v1/users/account\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Get user account\n\n**Access:** Private/user\n\n### Request\n\n#### Headers\n\n`Authorization: Bearer \u003cTOKEN\u003e`\n\n### Response\n\n```json\n{\n  \"_id\": \"6326a4fda8012c4bc02d6368\",\n  \"firstName\": \"Joen\",\n  \"lastName\": \"Doe\",\n  \"email\": \"jone@wallet.io\",\n  \"isAdmin\": false,\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYzMjZhNGZkYTgwMTJjNGJjMDJkNjM2OCIsImlhdCI6MTY2MzQ3Njk4OSwiZXhwIjoxNjY2MDY4OTg5fQ.wxPGnDLvZYqyXXC5YIaUJoJqfxdeZlb96xi4Jvgtj80\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePUT /api/v1/account \u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Update user account\n\n**Access:** Private/user\n\n### Request\n\n#### Headers\n\n`Authorization: Bearer \u003cTOKEN\u003e`\n\n### Response\n\n```json\n{\n  \"_id\": \"6326a4fda8012c4bc02d6368\",\n  \"firstName\": \"Jone\",\n  \"lastName\": \"Doe\",\n  \"email\": \"jone@wallet.io\",\n  \"isAdmin\": true,\n  \"token\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjYzMjZhNGZkYTgwMTJjNGJjMDJkNjM2OCIsImlhdCI6MTY2MzQ3ODk1MywiZXhwIjoxNjY2MDcwOTUzfQ.5KCy_rocdxUDcLRVEgJdcJmAHKfP4gIOWEy9Mra4V6M\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePOST /api/v1/users/forgetpassword\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** An endpoint to send an email to user incase he forget the password\n\n**Access:** Public\n\n### Request\n\n#### Headers\n\n`Authorization: Bearer \u003cTOKEN\u003e`\n\n### Response\n\n```json\n{\n  \"success\": true,\n  \"data\": \"Email sent\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n# Product\n\n\u003cdetails\u003e\n\u003csummary\u003ePUT /api/v1/products/:id\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** UUpdate a product by `id`\n\n**Access:** Private/Admin\n\n### Request\n\n```json\n{\n  \"price\": 1200.0,\n  \"images\": [\"img_3.png\", \"img_4.png\"]\n}\n```\n\n### Response\n\n```json\n{\n  \"_id\": \"6327fa179b841ab4ec957660\",\n  \"user\": \"6326a4fda8012c4bc02d6368\",\n  \"name\": \"iPhone 13 pro max\",\n  \"images\": [\"img_1.png\", \"img_3.png\", \"img_4.png\"],\n  \"brand\": \"Apple\",\n  \"category\": [],\n  \"description\": \"The most powerful phone on the planet earth\",\n  \"rating\": 0,\n  \"numReviews\": 0,\n  \"discount\": 2,\n  \"price\": 1200,\n  \"countInStock\": 2000,\n  \"reviews\": [],\n  \"createdAt\": \"2022-09-19T05:11:51.150Z\",\n  \"updatedAt\": \"2022-09-19T05:20:08.235Z\",\n  \"__v\": 1\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePOST /api/v1/products\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Create new product\n\n**Access:** Private/Admin\n\n### Request\n\n```json\n{\n  \"name\": \"iPhone 13 pro max\",\n  \"images\": [\"img_1.png\"],\n  \"brand\": \"Apple\",\n  \"caregory\": [\"phones\"],\n  \"description\": \"The most powerful phone on the planet earth\",\n  \"discount\": 2,\n  \"price\": 1000.0,\n  \"countInStock\": 2000\n}\n```\n\n### Response\n\n```json\n{\n  \"user\": \"6326a4fda8012c4bc02d6368\",\n  \"name\": \"iPhone 13 pro max\",\n  \"images\": [\"img_1.png\"],\n  \"brand\": \"Apple\",\n  \"category\": [],\n  \"description\": \"The most powerful phone on the planet earth\",\n  \"rating\": 0,\n  \"numReviews\": 0,\n  \"discount\": 2,\n  \"price\": 1000,\n  \"countInStock\": 2000,\n  \"_id\": \"6327fa179b841ab4ec957660\",\n  \"reviews\": [],\n  \"createdAt\": \"2022-09-19T05:11:51.150Z\",\n  \"updatedAt\": \"2022-09-19T05:11:51.150Z\",\n  \"__v\": 0\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDELETE /api/v1/products/:id\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Delete a product by `ID`\n\n**Access:** Private/Admin\n\n### Headers\n\n`Authorization: Bearer \u003cTOKEN\u003e`\n\n### Responst\n\n```json\n{\n  \"messages\": \"Product Removed\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET /api/v1/products\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Get all products\n\n**Access:** Public\n\n### Response\n\n```json\n{\n  \"success\": true,\n  \"count\": 2,\n  \"products\": [\n    {\n      \"_id\": \"6327fa179b841ab4ec957660\",\n      \"user\": \"6326a4fda8012c4bc02d6368\",\n      \"name\": \"iPhone 13 pro max\",\n      \"images\": [\"img_1.png\"],\n      \"brand\": \"Apple\",\n      \"category\": [],\n      \"description\": \"The most powerful phone on the planet earth\",\n      \"rating\": 0,\n      \"numReviews\": 0,\n      \"discount\": 2,\n      \"price\": 1000,\n      \"countInStock\": 2000,\n      \"reviews\": [],\n      \"createdAt\": \"2022-09-19T05:11:51.150Z\",\n      \"updatedAt\": \"2022-09-19T05:11:51.150Z\",\n      \"__v\": 0\n    },\n    {\n      \"_id\": \"6327dea49a70962f67219b8e\",\n      \"user\": \"6326a4fda8012c4bc02d6368\",\n      \"name\": \"iPhone 13 pro max\",\n      \"images\": [\n        \"img_1.png\",\n        \"img_2.png\",\n        \"img_3.png\",\n        \"img_3.png\",\n        \"img_4.png\"\n      ],\n      \"brand\": \"Apple\",\n      \"category\": [],\n      \"description\": \"The most powerful phone on the planet earth\",\n      \"rating\": 0,\n      \"numReviews\": 0,\n      \"discount\": 2,\n      \"price\": 1200,\n      \"countInStock\": 2000,\n      \"reviews\": [],\n      \"createdAt\": \"2022-09-19T03:14:44.403Z\",\n      \"updatedAt\": \"2022-09-19T03:59:29.317Z\",\n      \"__v\": 7\n    }\n  ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET /api/v1/products/:id\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Get product by `id`\n\n**Access:** Public\n\n### Response\n\n```json\n{\n  \"_id\": \"6327fa179b841ab4ec957660\",\n  \"user\": \"6326a4fda8012c4bc02d6368\",\n  \"name\": \"iPhone 13 pro max\",\n  \"images\": [\"img_1.png\"],\n  \"brand\": \"Apple\",\n  \"category\": [],\n  \"description\": \"The most powerful phone on the planet earth\",\n  \"rating\": 0,\n  \"numReviews\": 0,\n  \"discount\": 2,\n  \"price\": 1000,\n  \"countInStock\": 2000,\n  \"reviews\": [],\n  \"createdAt\": \"2022-09-19T05:11:51.150Z\",\n  \"updatedAt\": \"2022-09-19T05:11:51.150Z\",\n  \"__v\": 0\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET /api/v1/products/top\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Get top rated products\n\n**Access:** Public\n\n### Response\n\n```json\n[\n  {\n    \"_id\": \"6327fa179b841ab4ec957660\",\n    \"user\": \"6326a4fda8012c4bc02d6368\",\n    \"name\": \"iPhone 13 pro max\",\n    \"images\": [\"img_1.png\", \"img_3.png\", \"img_4.png\"],\n    \"brand\": \"Apple\",\n    \"category\": [],\n    \"description\": \"The most powerful phone on the planet earth\",\n    \"rating\": 0,\n    \"numReviews\": 0,\n    \"discount\": 2,\n    \"price\": 1200,\n    \"countInStock\": 2000,\n    \"reviews\": [],\n    \"createdAt\": \"2022-09-19T05:11:51.150Z\",\n    \"updatedAt\": \"2022-09-19T05:20:08.235Z\",\n    \"__v\": 1\n  }\n]\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET /api/v1/products/new\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Get new published products\n\n**Access:** Public\n\n### Response\n\n```json\n[\n  {\n    \"_id\": \"6327fa179b841ab4ec957660\",\n    \"user\": \"6326a4fda8012c4bc02d6368\",\n    \"name\": \"iPhone 13 pro max\",\n    \"images\": [\"img_1.png\", \"img_3.png\", \"img_4.png\"],\n    \"brand\": \"Apple\",\n    \"category\": [],\n    \"description\": \"The most powerful phone on the planet earth\",\n    \"rating\": 0,\n    \"numReviews\": 0,\n    \"discount\": 2,\n    \"price\": 1200,\n    \"countInStock\": 2000,\n    \"reviews\": [],\n    \"createdAt\": \"2022-09-19T05:11:51.150Z\",\n    \"updatedAt\": \"2022-09-19T05:20:08.235Z\",\n    \"__v\": 1\n  }\n]\n```\n\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n# Reviews\n\n\u003cdetails\u003e\n\u003csummary\u003ePOST /api/v1/products/:id/reviews\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Add product review\n\n**Access:** Private/user\n\n### Request\n\n```json\n{\n  \"rating\": 5,\n  \"comment\": \"Very cool!\"\n}\n```\n\n### Response\n\n```json\n{\n  \"message\": \"Review added\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePUT /api/v1/products/:id/reviews\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Update product review by the user\n\n**Access:** Private/user\n\n### Request\n\n```json\n{\n  \"comment\": \"Super cool!\"\n}\n```\n\n### Response\n\n```json\n{\n  \"message\": \"Review Updated\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDELETE /api/v1/products/:id/reviews\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Delete product review by the user\n\n**Access:** Private/user\n\n### Response\n\n```json\n{\n  \"message\": \"Review Deleted\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eDELTE /api/v1/products/:productId/reviews/:reviewId\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Delete product review by the admin\n\n**Access:** Private/admin\n\n### Response\n\n```json\n{\n  \"message\": \"Review Removed\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n# Orders\n\n\u003cdetails\u003e\n\u003csummary\u003ePOST /api/v1/orders\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Create new order\n\n**Access:** Private/user\n\n### Request\n\n```json\n{\n  \"orderItems\": [\n    {\n      \"name\": \"iPhone 13 pro max\",\n      \"qty\": 1,\n      \"image\": \"img.png\",\n      \"price\": 1200.0,\n      \"product\": \"6327dea49a70962f67219b8e\"\n    }\n  ],\n  \"shippingMethod\": {\n    \"name\": \"internation shipping\",\n    \"cost\": 20.0\n  },\n  \"shippingAddress\": {\n    \"address\": \"some address\",\n    \"city\": \"New York\",\n    \"postalCode\": 1234,\n    \"country\": \"US\",\n    \"apartment\": \"apartment\",\n    \"firstName\": \"Jone\",\n    \"lastName\": \"Doe\"\n  },\n  \"paymentMethod\": \"PAYPAL\",\n  \"txPrice\": 200.0,\n  \"shippingPrice\": 250.0,\n  \"totalPrice\": 450.0\n}\n```\n\n### Response\n\n```json\n{\n  \"user\": \"6326a4fda8012c4bc02d6368\",\n  \"orderItems\": [\n    {\n      \"name\": \"iPhone 13 pro max\",\n      \"qty\": 1,\n      \"image\": \"img.png\",\n      \"price\": 1200,\n      \"product\": \"6327dea49a70962f67219b8e\",\n      \"_id\": \"632814179b841ab4ec957692\"\n    }\n  ],\n  \"shippingAddress\": {\n    \"address\": \"some address\",\n    \"city\": \"New York\",\n    \"postalCode\": \"1234\",\n    \"country\": \"US\",\n    \"apartment\": \"apartment\",\n    \"firstName\": \"Jone\",\n    \"lastName\": \"Doe\"\n  },\n  \"paymentMethod\": \"PAYPAL\",\n  \"shippingMethod\": {\n    \"name\": \"internation shipping\",\n    \"cost\": 20\n  },\n  \"taxPrice\": 0,\n  \"shippingPrice\": 250,\n  \"totalPrice\": 450,\n  \"isPaid\": false,\n  \"isDelivered\": false,\n  \"_id\": \"632814179b841ab4ec957691\",\n  \"createdAt\": \"2022-09-19T07:02:47.399Z\",\n  \"updatedAt\": \"2022-09-19T07:02:47.399Z\",\n  \"__v\": 0\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET /api/v1/orders/:id\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n**Description:** Get order by `id`\n\n**Access:** Private/user\n\n### Response\n\n```json\n{\n  \"shippingAddress\": {\n    \"address\": \"some address\",\n    \"city\": \"New York\",\n    \"postalCode\": \"1234\",\n    \"country\": \"US\",\n    \"apartment\": \"apartment\",\n    \"firstName\": \"Jone\",\n    \"lastName\": \"Doe\"\n  },\n  \"shippingMethod\": {\n    \"name\": \"internation shipping\",\n    \"cost\": 20\n  },\n  \"paymentResult\": {\n    \"id\": \"6327f1aebc834eab1742347a\",\n    \"status\": \"success\",\n    \"update_time\": \"9/19/20222 6:54 am\",\n    \"email_address\": \"jone@test.com\"\n  },\n  \"_id\": \"6327f1aebc834eab1742347a\",\n  \"user\": {\n    \"_id\": \"6326a4fda8012c4bc02d6368\",\n    \"email\": \"jone@wallet.io\"\n  },\n  \"orderItems\": [\n    {\n      \"name\": \"iPhone 13 pro max\",\n      \"qty\": 1,\n      \"image\": \"img.png\",\n      \"price\": 1200,\n      \"product\": \"6327dea49a70962f67219b8e\",\n      \"_id\": \"6327f1aebc834eab1742347b\"\n    }\n  ],\n  \"paymentMethod\": \"PAYPAL\",\n  \"taxPrice\": 0,\n  \"shippingPrice\": 250,\n  \"totalPrice\": 450,\n  \"isPaid\": true,\n  \"isDelivered\": true,\n  \"createdAt\": \"2022-09-19T04:35:58.585Z\",\n  \"updatedAt\": \"2022-09-19T04:57:19.635Z\",\n  \"__v\": 0,\n  \"paidAt\": \"2022-09-19T04:55:03.472Z\",\n  \"deliveredAt\": \"2022-09-19T04:57:19.629Z\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePUT /api/v1/orders/:id/pay\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n**Description:** Pay an order\n\n**Access:** Private/user\n\n### Request\n\n```json\n{\n  \"id\": \"6327f1aebc834eab1742347a\",\n  \"status\": \"success\",\n  \"update_time\": \"9/19/20222 6:54 am\",\n  \"payer\": {\n    \"email_address\": \"jone@test.com\"\n  }\n}\n```\n\n### Response\n\n```json\n{\n  \"shippingAddress\": {\n    \"address\": \"some address\",\n    \"city\": \"New York\",\n    \"postalCode\": \"1234\",\n    \"country\": \"US\",\n    \"apartment\": \"apartment\",\n    \"firstName\": \"Jone\",\n    \"lastName\": \"Doe\"\n  },\n  \"shippingMethod\": {\n    \"name\": \"internation shipping\",\n    \"cost\": 20\n  },\n  \"paymentResult\": {\n    \"id\": \"6327f1aebc834eab1742347a\",\n    \"status\": \"success\",\n    \"update_time\": \"9/19/20222 6:54 am\",\n    \"email_address\": \"jone@test.com\"\n  },\n  \"_id\": \"6327f1aebc834eab1742347a\",\n  \"user\": \"6326a4fda8012c4bc02d6368\",\n  \"orderItems\": [\n    {\n      \"name\": \"iPhone 13 pro max\",\n      \"qty\": 1,\n      \"image\": \"img.png\",\n      \"price\": 1200,\n      \"product\": \"6327dea49a70962f67219b8e\",\n      \"_id\": \"6327f1aebc834eab1742347b\"\n    }\n  ],\n  \"paymentMethod\": \"PAYPAL\",\n  \"taxPrice\": 0,\n  \"shippingPrice\": 250,\n  \"totalPrice\": 450,\n  \"isPaid\": true,\n  \"isDelivered\": true,\n  \"createdAt\": \"2022-09-19T04:35:58.585Z\",\n  \"updatedAt\": \"2022-09-19T07:06:27.877Z\",\n  \"__v\": 0,\n  \"paidAt\": \"2022-09-19T07:06:27.873Z\",\n  \"deliveredAt\": \"2022-09-19T04:57:19.629Z\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET /api/v1/orders/:id/deliver\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n**Description:** Set an order to be **delivered**\n\n**Access:** Private/admin\n\n### Response\n\n```json\n{\n  \"shippingAddress\": {\n    \"address\": \"some address\",\n    \"city\": \"New York\",\n    \"postalCode\": \"1234\",\n    \"country\": \"US\",\n    \"apartment\": \"apartment\",\n    \"firstName\": \"Jone\",\n    \"lastName\": \"Doe\"\n  },\n  \"shippingMethod\": {\n    \"name\": \"internation shipping\",\n    \"cost\": 20\n  },\n  \"paymentResult\": {\n    \"id\": \"6327f1aebc834eab1742347a\",\n    \"status\": \"success\",\n    \"update_time\": \"9/19/20222 6:54 am\",\n    \"email_address\": \"jone@test.com\"\n  },\n  \"_id\": \"6327f1aebc834eab1742347a\",\n  \"user\": \"6326a4fda8012c4bc02d6368\",\n  \"orderItems\": [\n    {\n      \"name\": \"iPhone 13 pro max\",\n      \"qty\": 1,\n      \"image\": \"img.png\",\n      \"price\": 1200,\n      \"product\": \"6327dea49a70962f67219b8e\",\n      \"_id\": \"6327f1aebc834eab1742347b\"\n    }\n  ],\n  \"paymentMethod\": \"PAYPAL\",\n  \"taxPrice\": 0,\n  \"shippingPrice\": 250,\n  \"totalPrice\": 450,\n  \"isPaid\": true,\n  \"isDelivered\": true,\n  \"createdAt\": \"2022-09-19T04:35:58.585Z\",\n  \"updatedAt\": \"2022-09-19T07:07:33.406Z\",\n  \"__v\": 0,\n  \"paidAt\": \"2022-09-19T07:06:27.873Z\",\n  \"deliveredAt\": \"2022-09-19T07:07:33.405Z\"\n}\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET /api/v1/orders/myorder\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n**Description:** Get user orders\n\n**Access:** Private/user\n\n### Response\n\n```json\n[\n  {\n    \"shippingAddress\": {\n      \"address\": \"some address\",\n      \"city\": \"New York\",\n      \"postalCode\": \"1234\",\n      \"country\": \"US\",\n      \"apartment\": \"apartment\",\n      \"firstName\": \"Jone\",\n      \"lastName\": \"Doe\"\n    },\n    \"shippingMethod\": {\n      \"name\": \"internation shipping\",\n      \"cost\": 20\n    },\n    \"_id\": \"6327f0ca1ad2cab4387e6024\",\n    \"user\": \"6326a4fda8012c4bc02d6368\",\n    \"orderItems\": [],\n    \"paymentMethod\": \"PAYPAL\",\n    \"taxPrice\": 0,\n    \"shippingPrice\": 250,\n    \"totalPrice\": 450,\n    \"isPaid\": false,\n    \"isDelivered\": false,\n    \"createdAt\": \"2022-09-19T04:32:10.723Z\",\n    \"updatedAt\": \"2022-09-19T04:32:10.723Z\",\n    \"__v\": 0\n  },\n  {\n    \"shippingAddress\": {\n      \"address\": \"some address\",\n      \"city\": \"New York\",\n      \"postalCode\": \"1234\",\n      \"country\": \"US\",\n      \"apartment\": \"apartment\",\n      \"firstName\": \"Jone\",\n      \"lastName\": \"Doe\"\n    },\n    \"shippingMethod\": {\n      \"name\": \"internation shipping\",\n      \"cost\": 20\n    },\n    \"paymentResult\": {\n      \"id\": \"6327f1aebc834eab1742347a\",\n      \"status\": \"success\",\n      \"update_time\": \"9/19/20222 6:54 am\",\n      \"email_address\": \"jone@test.com\"\n    },\n    \"_id\": \"6327f1aebc834eab1742347a\",\n    \"user\": \"6326a4fda8012c4bc02d6368\",\n    \"orderItems\": [\n      {\n        \"name\": \"iPhone 13 pro max\",\n        \"qty\": 1,\n        \"image\": \"img.png\",\n        \"price\": 1200,\n        \"product\": \"6327dea49a70962f67219b8e\",\n        \"_id\": \"6327f1aebc834eab1742347b\"\n      }\n    ],\n    \"paymentMethod\": \"PAYPAL\",\n    \"taxPrice\": 0,\n    \"shippingPrice\": 250,\n    \"totalPrice\": 450,\n    \"isPaid\": true,\n    \"isDelivered\": true,\n    \"createdAt\": \"2022-09-19T04:35:58.585Z\",\n    \"updatedAt\": \"2022-09-19T07:07:33.406Z\",\n    \"__v\": 0,\n    \"paidAt\": \"2022-09-19T07:06:27.873Z\",\n    \"deliveredAt\": \"2022-09-19T07:07:33.405Z\"\n  },\n  {\n    \"shippingAddress\": {\n      \"address\": \"some address\",\n      \"city\": \"New York\",\n      \"postalCode\": \"1234\",\n      \"country\": \"US\",\n      \"apartment\": \"apartment\",\n      \"firstName\": \"Jone\",\n      \"lastName\": \"Doe\"\n    },\n    \"shippingMethod\": {\n      \"name\": \"internation shipping\",\n      \"cost\": 20\n    },\n    \"_id\": \"632814179b841ab4ec957691\",\n    \"user\": \"6326a4fda8012c4bc02d6368\",\n    \"orderItems\": [\n      {\n        \"name\": \"iPhone 13 pro max\",\n        \"qty\": 1,\n        \"image\": \"img.png\",\n        \"price\": 1200,\n        \"product\": \"6327dea49a70962f67219b8e\",\n        \"_id\": \"632814179b841ab4ec957692\"\n      }\n    ],\n    \"paymentMethod\": \"PAYPAL\",\n    \"taxPrice\": 0,\n    \"shippingPrice\": 250,\n    \"totalPrice\": 450,\n    \"isPaid\": false,\n    \"isDelivered\": false,\n    \"createdAt\": \"2022-09-19T07:02:47.399Z\",\n    \"updatedAt\": \"2022-09-19T07:02:47.399Z\",\n    \"__v\": 0\n  }\n]\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eGET /api/v1/orders\u003c/summary\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n**Description:** Get all orders\n\n**Access:** Private/admin\n\n### Response\n\n```json\n{\n  \"success\": true,\n  \"count\": 3,\n  \"orders\": [\n    {\n      \"shippingAddress\": {\n        \"address\": \"some address\",\n        \"city\": \"New York\",\n        \"postalCode\": \"1234\",\n        \"country\": \"US\",\n        \"apartment\": \"apartment\",\n        \"firstName\": \"Jone\",\n        \"lastName\": \"Doe\"\n      },\n      \"shippingMethod\": {\n        \"name\": \"internation shipping\",\n        \"cost\": 20\n      },\n      \"_id\": \"6327f0ca1ad2cab4387e6024\",\n      \"user\": {\n        \"_id\": \"6326a4fda8012c4bc02d6368\"\n      },\n      \"orderItems\": [],\n      \"paymentMethod\": \"PAYPAL\",\n      \"taxPrice\": 0,\n      \"shippingPrice\": 250,\n      \"totalPrice\": 450,\n      \"isPaid\": false,\n      \"isDelivered\": false,\n      \"createdAt\": \"2022-09-19T04:32:10.723Z\",\n      \"updatedAt\": \"2022-09-19T04:32:10.723Z\",\n      \"__v\": 0\n    },\n    {\n      \"shippingAddress\": {\n        \"address\": \"some address\",\n        \"city\": \"New York\",\n        \"postalCode\": \"1234\",\n        \"country\": \"US\",\n        \"apartment\": \"apartment\",\n        \"firstName\": \"Jone\",\n        \"lastName\": \"Doe\"\n      },\n      \"shippingMethod\": {\n        \"name\": \"internation shipping\",\n        \"cost\": 20\n      },\n      \"paymentResult\": {\n        \"id\": \"6327f1aebc834eab1742347a\",\n        \"status\": \"success\",\n        \"update_time\": \"9/19/20222 6:54 am\",\n        \"email_address\": \"jone@test.com\"\n      },\n      \"_id\": \"6327f1aebc834eab1742347a\",\n      \"user\": {\n        \"_id\": \"6326a4fda8012c4bc02d6368\"\n      },\n      \"orderItems\": [\n        {\n          \"name\": \"iPhone 13 pro max\",\n          \"qty\": 1,\n          \"image\": \"img.png\",\n          \"price\": 1200,\n          \"product\": \"6327dea49a70962f67219b8e\",\n          \"_id\": \"6327f1aebc834eab1742347b\"\n        }\n      ],\n      \"paymentMethod\": \"PAYPAL\",\n      \"taxPrice\": 0,\n      \"shippingPrice\": 250,\n      \"totalPrice\": 450,\n      \"isPaid\": true,\n      \"isDelivered\": true,\n      \"createdAt\": \"2022-09-19T04:35:58.585Z\",\n      \"updatedAt\": \"2022-09-19T07:07:33.406Z\",\n      \"__v\": 0,\n      \"paidAt\": \"2022-09-19T07:06:27.873Z\",\n      \"deliveredAt\": \"2022-09-19T07:07:33.405Z\"\n    },\n    {\n      \"shippingAddress\": {\n        \"address\": \"some address\",\n        \"city\": \"New York\",\n        \"postalCode\": \"1234\",\n        \"country\": \"US\",\n        \"apartment\": \"apartment\",\n        \"firstName\": \"Jone\",\n        \"lastName\": \"Doe\"\n      },\n      \"shippingMethod\": {\n        \"name\": \"internation shipping\",\n        \"cost\": 20\n      },\n      \"_id\": \"632814179b841ab4ec957691\",\n      \"user\": {\n        \"_id\": \"6326a4fda8012c4bc02d6368\"\n      },\n      \"orderItems\": [\n        {\n          \"name\": \"iPhone 13 pro max\",\n          \"qty\": 1,\n          \"image\": \"img.png\",\n          \"price\": 1200,\n          \"product\": \"6327dea49a70962f67219b8e\",\n          \"_id\": \"632814179b841ab4ec957692\"\n        }\n      ],\n      \"paymentMethod\": \"PAYPAL\",\n      \"taxPrice\": 0,\n      \"shippingPrice\": 250,\n      \"totalPrice\": 450,\n      \"isPaid\": false,\n      \"isDelivered\": false,\n      \"createdAt\": \"2022-09-19T07:02:47.399Z\",\n      \"updatedAt\": \"2022-09-19T07:02:47.399Z\",\n      \"__v\": 0\n    }\n  ]\n}\n```\n\n\u003c/details\u003e\n\n\u003cbr /\u003e\n\n# Database Model\n\n## User\n\n```ts\ntype User = {\n  firstName: string;\n  lastName: string;\n  email: string;\n  password: string;\n  isAdmin: boolean;\n  resetPasswordToken: string;\n  resetPasswordExpire: string;\n  createAt: Date;\n  updatedAt: Date;\n};\n```\n\n## Product\n\n```ts\ntype Product = {\n  user: User;\n  name: string;\n  images: string[];\n  brand: string;\n  category: string[];\n  description: string;\n  reviews: Reviews[];\n  rating: number;\n  numReviews: number;\n  discount: number;\n  price: number;\n  countInStock: number;\n  createdAt: Date;\n  updatedAt: Date;\n};\n```\n\n## Review\n\n```ts\ntype Reivew = {\n  name: string;\n  rating: number;\n  comment: string;\n  user: User;\n  createdAt: Date;\n  updatedAt: Date;\n};\n```\n\n## Order\n\n```ts\ntype OrderItem = {\n  name: string;\n  qty: number;\n  image: string;\n  price: number;\n  product: Product;\n};\ntype Order = {\n  user: User;\n  orderItems: OrderItem[];\n  shippingAddress: {\n    address: string;\n    city: string;\n    postalCode: string;\n    country: string;\n    apartment: string;\n    firstName: string;\n    lastName: string;\n  };\n  paymentMethod: string;\n  shippingMethod: {\n    name: string;\n    cost: string;\n  };\n  paymentResult: {\n    id: string;\n    status: string;\n    update_time: Date;\n    email_address: string;\n  };\n  taxPrice: number;\n  shippingPrice: number;\n  totalPrice: number;\n  isPaid: boolean;\n  paidAt: Date;\n  isDelivered: boolean;\n  deliveredAt: Date;\n  createdAt: Date;\n  updatedAt: Date;\n};\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuodev%2Fecart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneuodev%2Fecart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneuodev%2Fecart/lists"}