{"id":23067209,"url":"https://github.com/dinushchathurya/nodejs-ecommerce-api","last_synced_at":"2025-07-05T02:06:27.809Z","repository":{"id":45498337,"uuid":"339286262","full_name":"dinushchathurya/nodejs-ecommerce-api","owner":"dinushchathurya","description":"This full E-Commerce API build using Express and Mongo. Here it contains all the required functionalities of a full-fledged E-commerce API like User registration, User Login, Category Add, Edit \u0026 Delete, Product Add, Edit, Delete, Add product feature image \u0026 Add product images, Order creation and etc...","archived":false,"fork":false,"pushed_at":"2024-04-03T08:49:37.000Z","size":114,"stargazers_count":79,"open_issues_count":2,"forks_count":37,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-07-04T02:55:35.704Z","etag":null,"topics":["e-commerce","ecommerce","ecommerce-api","express","mongo","mongoose","multer","node","node-express","node-express-mongo","node-express-mongodb","node-js","nodejs","nodejs-server"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/dinushchathurya.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}},"created_at":"2021-02-16T04:38:29.000Z","updated_at":"2025-06-24T20:55:26.000Z","dependencies_parsed_at":"2022-07-15T07:00:32.439Z","dependency_job_id":null,"html_url":"https://github.com/dinushchathurya/nodejs-ecommerce-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/dinushchathurya/nodejs-ecommerce-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinushchathurya%2Fnodejs-ecommerce-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinushchathurya%2Fnodejs-ecommerce-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinushchathurya%2Fnodejs-ecommerce-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinushchathurya%2Fnodejs-ecommerce-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dinushchathurya","download_url":"https://codeload.github.com/dinushchathurya/nodejs-ecommerce-api/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dinushchathurya%2Fnodejs-ecommerce-api/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263648368,"owners_count":23494007,"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":["e-commerce","ecommerce","ecommerce-api","express","mongo","mongoose","multer","node","node-express","node-express-mongo","node-express-mongodb","node-js","nodejs","nodejs-server"],"created_at":"2024-12-16T05:16:19.560Z","updated_at":"2025-07-05T02:06:27.788Z","avatar_url":"https://github.com/dinushchathurya.png","language":"JavaScript","readme":"# Node.js E-Commerce API \n\nThis full E-Commerce API build using Express and Mongo. Here it contains all the required functionalities of a full-fledged E-commerce API like User registration, User Login, Category Add, Edit \u0026 Delete, Product Add, Edit, Delete, Add product feature image \u0026 Add product images, Order creation and etc...\n\n## Setup\n \n```\n    $ git clone https://github.com/dinushchathurya/nodejs-ecommerce-api.git\n    $ cd nodejs-ecommerce-api\n    $ npm install\n```\n  - Duplicate and database.configexample.js as database.confi.js and fill in environment variables\n\n  ### Run The Service\n  ```\n  $ nodemon app.js\n  ```\n## API Endpoints\n\n## User Routes\n\n### * Create User\n\n`POST |  /api/v1/users/register` \n\n| Key       | Value          |\n| --------- | -----------    |\n| name      | Admin          |\n| email     | admin@admin.com|\n| password  | password       |\n| phone     | +947187520     |\n| isAdmin   | true           |\n| street    | Main Street    |\n| apartment | Block C        |\n| zip       | 10870          |\n| city      | Colombo        |\n| country   | SriLanka       |\n\n### * Login User\n\n`POST |  /api/v1/users/login` \n\n| Key        | Value          |\n| ---------  | -----------    |\n| email      | admin@admin.com|\n| password   | password       |\n\n### * Get Users\n\n`GET |  /api/v1/users` \n\n### * Get Single Users\n\n`GET |  /api/v1/users/{id}` \n\n### * Delete User\n\n`DELETE |  /api/v1/users/{id}` \n\n### * Get Users Count\n\n`GET |  /api/v1/users/get/count` \n\n## Category Routes\n\n### * Create Category\n\n`POST |  /api/v1/categories` \n\n| Key   | Value      |\n| ------| ---------- |\n| name  | Category 1 |\n| icon  | icon-health|\n| color | #55879     |\n\n### * Get Categories\n\n`GET |  /api/v1/categories` \n\n### * Get Single Category\n\n`GET |  /api/v1/categories/{id}` \n\n### * Update Category\n\n`PUT |  /api/v1/categories/{id}` \n\n| Key   | Value      |\n| ------| ---------- |\n| name  | Category 1 |\n| icon  | icon-health|\n| color | #55879     |\n\n### * Delete Category\n\n`DELETE |  /api/v1/categories/{id}`\n\n## Product Routes\n\n### * Create Product\n\n`POST |  /api/v1/products` \n\n| Key            | Value           |\n| ---------      | -----------     |\n| name           | Product 1       |\n| description    | Description     |\n| richDescription| Rich Description|\n| image          | image           |\n| brand          | Brand 1         |\n| price          | 50              |\n| category       | {category_id}   |\n| countInStock   | 100             |\n| rating         | 4.5             |\n| numReviews     | 40              |\n| isFeatured     | true            |\n\n### * Get Products\n\n`GET |  /api/v1/products` \n\n###  * Get Single Category\n\n`GET |  /api/v1/products/{id}` \n\n###  * Get Prodcut Counts\n\n`GET |  /api/v1/products/get/count` \n\n###  * Get Featured Prodcut Counts\n\n`GET |  /api/v1/products/get/featured/{count}`\n\n### * Upload Galley Images\n\n`POST |  /api/v1/products/gallery-images/{id}`\n| Key            | Value           |\n| ---------      | -----------     |\n| images         | Array of images |\n\n### * Update Product\n\n`PUT |  /api/v1/products` \n| Key            | Value           |\n| ---------      | -----------     |\n| name           | Product 1       |\n| description    | Description     |\n| richDescription| Rich Description|\n| image          | image           |\n| brand          | Brand 1         |\n| price          | 50              |\n| category       | {category_id}   |\n| countInStock   | 100             |\n| rating         | 4.5             |\n| numReviews     | 40              |\n| isFeatured     | true            |\n\n### * Delete Product\n\n`DELETE |  /api/v1/products/{id}`\n\n## Orders Routes\n\n### * Create Order\n\n`POST |  /api/v1/orders` \n```\n{\n\t\"orderItems\":[\n\t\t{\n\t\t\t\"quantity\": 3,\n\t\t\t\"product\" : \"602e9c348e700335d8532b14\"\n\t\t},\n\t\t\t{\n\t\t\t\"quantity\": 2,\n\t\t\t\"product\" : \"602bde0161fcc409fc149734\"\n\t\t}\n\t],\n\t\"shippingAddress1\" : \"No 45,Park Street\",\n\t\"shippingAddress2\" : \"No 46,Main Street\",\n\t\"city\" : \"Colombo\",\n\t\"zip\" : \"10600t\",\n\t\"country\" : \"Sri Lanka\",\n\t\"phone\" : \"+94717185748\",\n\t\"user\" : \"602e9b718e700335d8532b13\"\n}\n```\n### * Get Orders\n\n`GET |  /api/v1/orders` \n\n### * Get Single Order\n\n`GET |  /api/v1/orders/{id}` \n\n### * Get Total Order Count\n\n`GET |  /api/v1/orders/get/count`\n\n### * Get Total Sales\n\n`GET |  /api/v1/orders/get/totalsales`\n\n### * Get User Order\n\n`GET |  /api/v1/orders/get/usersorders/{userid}`\n\n### * Update Single Order\n\n`PUT |  /api/v1/orders/{id}` \n\n### * Delete Single Order\n\n`DELETE |  /api/v1/orders/{id}` \n\n## Author\n[Dinush Chathurya](https://dinushchathurya.github.io/)\n\n## License\n\nCopyright (c) 2020 \u003ca href=\"https://dinushchathurya.github.io/\"\u003eDinush Chathurya\u003c/a\u003e and \u003ca href=\"https://codingtricks.io/\"\u003ecodingtricks.io\u003c/a\u003e\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE\nLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION\nOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION\nWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n## Blog\n\nhttps://codingtricks.io/\n\n\n## \n\n\u003cp \u003e\u003ch2 align=\"center\"\u003eHappy\u003ci class=\"fa fa-heart\" style=\"color:red;\"\u003e\u003c/i\u003e Coding\u003ci class=\"fa fa-code\" style=\"color:orange;\"\u003e \u003c/i\u003e\u003c/h2\u003e\u003c/p\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinushchathurya%2Fnodejs-ecommerce-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdinushchathurya%2Fnodejs-ecommerce-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdinushchathurya%2Fnodejs-ecommerce-api/lists"}