{"id":26757050,"url":"https://github.com/luisfuentech/shoppago-marketplace-api","last_synced_at":"2025-03-28T15:34:35.147Z","repository":{"id":44076633,"uuid":"205377043","full_name":"LuisFuenTech/shoppago-marketplace-api","owner":"LuisFuenTech","description":null,"archived":false,"fork":false,"pushed_at":"2022-12-11T04:09:05.000Z","size":1591,"stargazers_count":0,"open_issues_count":5,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-04-20T20:00:38.168Z","etag":null,"topics":["hacktoberfest"],"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/LuisFuenTech.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":"2019-08-30T12:22:50.000Z","updated_at":"2024-04-20T20:00:38.169Z","dependencies_parsed_at":"2023-01-26T15:00:42.897Z","dependency_job_id":null,"html_url":"https://github.com/LuisFuenTech/shoppago-marketplace-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisFuenTech%2Fshoppago-marketplace-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisFuenTech%2Fshoppago-marketplace-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisFuenTech%2Fshoppago-marketplace-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuisFuenTech%2Fshoppago-marketplace-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LuisFuenTech","download_url":"https://codeload.github.com/LuisFuenTech/shoppago-marketplace-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246054711,"owners_count":20716415,"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":["hacktoberfest"],"created_at":"2025-03-28T15:34:34.503Z","updated_at":"2025-03-28T15:34:35.141Z","avatar_url":"https://github.com/LuisFuenTech.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shoppago Marketplace API\n\nThis API is for manage a fake marketplace called [Shoppago](https://shoppago-market.herokuapp.com/) The products provide for the API was getting by web scrapping, then were saved into my database, in other words, I created my resources for comsuming the API for the web application. The data was taken from alibaba.\n\n## Getting started\n\nAnyone can consume the API, just following the next HTTP request. All those request return a JSON file.\n\n### Products:\n\n- GET [https://shoppago-market.herokuapp.com/api/product/products](https://shoppago-market.herokuapp.com/api/product/products) : return the list (array) of all products in stock.\n- GET [https://shoppago-market.herokuapp.com/api/products-category](https://shoppago-market.herokuapp.com/api/products-category) : return list (array) of products related with its category.\n- GET [https://shoppago-market.herokuapp.com/api/product/search?words[]={word1}\u0026words[]={word2}](https://shoppago-market.herokuapp.com/api/product/search?words[]=xbox\u0026words[]=nintendo) : this receive a array of words via query string, then return all products that match.\n- GET [https://shoppago-market.herokuapp.com/api/product/:id](https://shoppago-market.herokuapp.com/api/product/5d6decfaa3fdb3241c3ba103) : return a product detail if the you provide and id.\n  Response of the GET request:\n\n```\n{\n  \"_id\": \"5d6dfea65a32800ec4f9a83b\",\n  \"name\": \"Hot Selling High\",\n  \"description\": \"Hot Selling High Speed Charging Dock Charging Station for Xbox One/One X/One S Controller\",\n  \"price\": \"$4.99\",\n  \"priceFormated\": 4.99,\n  \"quantity\": 100,\n  \"image\": \"https://sc02.alicdn.com/kf/HTB1yFizayDxK1Rjy1zcq6yGeXXaV/Hot-Selling-High-Speed-Charging-Dock-Charging.jpg_300x300.jpg\",\n  \"createdAt\": \"2019-09-03T05:48:22.811Z\",\n  \"updatedAt\": \"2019-09-03T05:48:22.811Z\",\n  \"__v\": 0\n}\n```\n\n- POST [https://shoppago-market.herokuapp.com/api/product](https://shoppago-market.herokuapp.com/api/) : return add new product created. The body of request must be:\n\n```\n{\n\tname: String,\n\tdescription: String,\n\tprice: String,\n\tpriceFormated: Number,\n\tquantity: Number,\n\timage: String,\n\tcategory: String\n}\n```\n\n_Note:_ Before create a product, category given have to be created first. Parameter _image_ is a url of the image o thumbnail os the product.\n\n- PUT [https://shoppago-market.herokuapp.com/api/product/:id](https://shoppago-market.herokuapp.com/api/product/5d6decfaa3fdb3241c3ba103) : Update a product if an valid id is given, the return the product updated. POST and PUT request have the same body structure.\n- DELETE [https://shoppago-market.herokuapp.com/api/product/:id](https://shoppago-market.herokuapp.com/api/product/:id5d6d067c08ea1e216463d268) : return the product delete.\n\n### Categories\n\n- GET [https://shoppago-market.herokuapp.com/api/category/:name](https://shoppago-market.herokuapp.com/api/category/gadgets) : return all products (array) related with the category given.\n  Response of the GET request:\n\n```\n[\n  {\n    \"_id\": \"5d6df45b261ed0226c95444d\",\n    \"product\": {\n      \"_id\": \"5d6df45a261ed0226c95444c\",\n      \"name\": \"EasyPAG Wood Desktop\",\n      \"description\": \"EasyPAG Wood Desktop Bookshelf Assembled Countertop Bookcase Adjustable Literature Display Rack\",\n      \"price\": \"$8.20\",\n      \"priceFormated\": 8.2,\n      \"quantity\": 100,\n      \"image\": \"https://sc01.alicdn.com/kf/HTB1LiVdeEuF3KVjSZK9q6zVtXXaJ/EasyPAG-Wood-Desktop-Bookshelf-Assembled-Countertop-Bookcase.jpg_300x300.jpg\",\n      \"createdAt\": \"2019-09-03T05:04:26.387Z\",\n      \"updatedAt\": \"2019-09-03T05:04:26.387Z\"\n    },\n    \"category\": {\n      \"_id\": \"5d6de63d8dd9ed2298f98262\",\n      \"name\": \"furniture\",\n      \"createdAt\": \"2019-09-03T04:04:13.386Z\",\n      \"updatedAt\": \"2019-09-03T04:04:13.386Z\"\n    },\n    \"createdAt\": \"2019-09-03T05:04:27.085Z\",\n    \"updatedAt\": \"2019-09-03T05:04:27.085Z\",\n    \"__v\": 0\n  }\n]\n```\n\n- POST [https://shoppago-market.herokuapp.com/api/category](https://shoppago-market.herokuapp.com/api/category) : return a new category created. The body request must be:\n\n```\n{\n\tname: String\n}\n```\n\n### Shopping\n\n- GET [https://shoppago-market.herokuapp.com/api/shopping/cart/:id](https://shoppago-market.herokuapp.com/api/shopping/cart/5d6e37fd627d3029c0bae122) : return a shopping cart by its id.\n\n```\n{\n  \"products\": [\n    \"5d6decfaa3fdb3241c3ba106\"\n  ],\n  \"_id\": \"5d6e37fd627d3029c0bae122\",\n  \"createdAt\": \"2019-09-03T09:53:01.283Z\",\n  \"updatedAt\": \"2019-09-03T09:53:01.283Z\",\n  \"__v\": 0\n}\n```\n\n- POST [https://shoppago-market.herokuapp.com/api/shopping](https://shoppago-market.herokuapp.com/api/shopping) : creates and return a shopping cart.\n- POST [https://shoppago-market.herokuapp.com/api/shopping/product](https://shoppago-market.herokuapp.com/api/shopping/product) : Add a product into a shopping cart. Body request:\n\n```\n{\n\tproductId: ObjectId(),\n\tshoppingId: ObjectId()\n}\n```\n\n- POST [https://shoppago-market.herokuapp.com/api/shopping/buy](https://shoppago-market.herokuapp.com/api/shopping/buy) : complete the purchase and send and email with details. Body request:\n\n```\n{\n\tcart: JSON Array (products),\n\tsubtotal: Number,\n\temail: String\n}\n```\n\n- DELETE [https://shoppago-market.herokuapp.com/api/shopping/product/shoppingId?productId={id}](https://shoppago-market.herokuapp.com/api/shoppingId) : delete a product from a shopping cart. The shopping cart id must be sent by url params and the product id by query string.\n\n## Running the app\n\n### Requirements\n\nYou must install [NodeJS](https://nodejs.org/en/). No need install MongoDB because the API use a DB on cloud.\n\n### Installing\n\n1. Download the repo like a zip or copy the web url, open your terminal and type _git clone url_of_this_repo_.\n2. Get into the api folder\n3. Use your terminal to run `npm i \u0026\u0026 npm start`, then you could see a log message _Connected to database, Server's working on port 8080_ (The port must be free for use).\n4. If you want to run on development enviroment, you must to install _nodemon_ and run `npm run dev` (Optional).\n\n## Technology\n\nThis API was build with:\n\n- [Node JS](https://nodejs.org/en/)\n- [MongoDB](https://www.mongodb.com/)\n- [Express JS](https://expressjs.com/)\n- [SendGrid API](https://sendgrid.com/). For sending email\n- [React JS](https://reactjs.org/). The client application reside into Node App, when a request is invalid, you'll see a motivated message :'), but I explain you in this [repo](https://github.com/LuisFuenTech/shoppago-marketplace)\n\n### Developed with ♥ by Luis Fuentes\n\n- [Instagram](https://www.instagram.com/luisfuentech/)\n- [Twitter](https://twitter.com/luisfuentech)\n  _I hope for becoming be part of your family, Condor Labs. Let's fly together so high as we can!_\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisfuentech%2Fshoppago-marketplace-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluisfuentech%2Fshoppago-marketplace-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluisfuentech%2Fshoppago-marketplace-api/lists"}