{"id":15994302,"url":"https://github.com/pixelhandler/ecomapi","last_synced_at":"2025-07-02T14:36:39.828Z","repository":{"id":3190172,"uuid":"4222861","full_name":"pixelhandler/ecomapi","owner":"pixelhandler","description":"See Post at: http://pixelhandler.com/blog/2012/02/09/develop-a-restful-api-using-node-js-with-express-and-mongoose/","archived":false,"fork":false,"pushed_at":"2012-05-04T08:21:25.000Z","size":363,"stargazers_count":11,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T11:48:27.616Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://ecomapi.herokuapp.com/#list","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"darknessomi/musicbox","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pixelhandler.png","metadata":{"files":{"readme":"README.markdown","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":"2012-05-04T08:14:09.000Z","updated_at":"2017-05-14T04:55:55.000Z","dependencies_parsed_at":"2022-08-20T10:10:41.225Z","dependency_job_id":null,"html_url":"https://github.com/pixelhandler/ecomapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pixelhandler/ecomapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fecomapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fecomapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fecomapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fecomapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pixelhandler","download_url":"https://codeload.github.com/pixelhandler/ecomapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pixelhandler%2Fecomapi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263157473,"owners_count":23422633,"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":[],"created_at":"2024-10-08T07:08:19.152Z","updated_at":"2025-07-02T14:36:39.798Z","avatar_url":"https://github.com/pixelhandler.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Build a RESTful api using node - ecommerce example\n\n## API for ecommerce application\n\n### Design\n\n* Simple API design and pragmatic REST - only 2 base URLs per resource  \n* Keep verbs out of your base URLs  \n* Our HTTP verbs are POST, GET, PUT, and DELETE (CRUD - Create, Read, Update, Delete)  \n* Concrete names are better than abstract\n\nExample : two resources (/products and /products/1) and the four HTTP verbs\n\n\u003ctable\u003e\n    \u003ctr\u003e\n        \u003cth\u003eResource\u003c/th\u003e\n        \u003cth\u003ePost\u003cbr\u003e(create)\u003c/th\u003e\n        \u003cth\u003eGet\u003cbr\u003e(read)\u003c/th\u003e\n        \u003cth\u003ePut\u003cbr\u003e(update)\u003c/th\u003e\n        \u003cth\u003eDelete\u003cbr\u003e(delete)\u003c/th\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e/products\u003c/td\u003e\n        \u003ctd\u003ecreate a new product\u003c/td\u003e\n        \u003ctd\u003elist products\u003c/td\u003e\n        \u003ctd\u003ebulk update products\u003c/td\u003e\n        \u003ctd\u003edelete all products\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n        \u003ctd\u003e/products/1234\u003c/td\u003e\n        \u003ctd\u003eerror\u003c/td\u003e\n        \u003ctd\u003eshow 1234\u003c/td\u003e\n        \u003ctd\u003eif exists update 1234, else error\u003c/td\u003e\n        \u003ctd\u003edelete 1234\u003c/td\u003e\n    \u003c/tr\u003e\n\u003c/table\u003e\n\n\n### Nouns\n\n#### Products\n\n**Product:**\n\n    Id,  \n    Title,  \n    Description,  \n    Image URL,  \n    Categories: [ { Name } ],  \n    Style Number,  \n    Colors: [  \n      {  \n        Name,  \n        Images: [  \n          { Size, URL }  \n        ],  \n        Sizes: [  \n          { Size, Available, SKU, Price }  \n        ],  \n      }  \n    ]\n\n**Urls:**\n\n* /products *- list*  \n* /products/:id *- single*  \n\n\n### Data: MongoDB using Mongoose with Express framework running with Node.js\n\nModels are defined by passing a Schema instance to [mongoose.model][mongoosejs model].\n\n\n### References\n\n* [API design nouns are good, verbs are bad][nouns are good verbs are bad]\n* [Models are defined by passing a Schema instance to mongoose.model][mongoosejs model]\n* [SchemaTypes take care of validation, casting, defaults, and other general options in our models][schema types]\n* [Embedded documents are documents with schemas of their own that are part of other documents][embedded documents]\n* [Backbone Todo boilerplates demonstrating integration with Node.js, Express, MongoDB][backbone boilerplates]\n\n[nouns are good verbs are bad]: http://blog.apigee.com/detail/restful_api_design_nouns_are_good_verbs_are_bad/ \"API design nouns are good, verbs are bad\"\n\n[mongoosejs model]: http://mongoosejs.com/docs/model-definition.html \"Models are defined by passing a Schema instance to mongoose.model\"\n\n[schema types]: http://mongoosejs.com/docs/schematypes.html \"SchemaTypes take care of validation, casting, defaults, and other general options in our models\"\n\n[embedded documents]: http://mongoosejs.com/docs/embedded-documents.html \"Embedded documents are documents with schemas of their own that are part of other documents\"\n\n[backbone boilerplates]: https://github.com/addyosmani/backbone-boilerplates \"Backbone Todo boilerplates demonstrating integration with Node.js, Express, MongoDB\"\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelhandler%2Fecomapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpixelhandler%2Fecomapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpixelhandler%2Fecomapi/lists"}