{"id":24854694,"url":"https://github.com/umar44641/trendymart-backend","last_synced_at":"2026-04-10T15:01:58.465Z","repository":{"id":185330042,"uuid":"606293170","full_name":"UMAR44641/TrendyMart-BACKEND","owner":"UMAR44641","description":"This is the Backend for a project called TrendyMart.","archived":false,"fork":false,"pushed_at":"2023-02-26T14:51:37.000Z","size":50,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-31T15:55:05.568Z","etag":null,"topics":["atlas","authentication","authorization","express-js","middlewares","mongodb","mongoose","nodejs"],"latest_commit_sha":null,"homepage":"https://trendy-mart.vercel.app/","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/UMAR44641.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}},"created_at":"2023-02-25T03:53:15.000Z","updated_at":"2023-02-28T06:42:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"43fa120f-f3d0-4226-a19e-0861aeec724a","html_url":"https://github.com/UMAR44641/TrendyMart-BACKEND","commit_stats":null,"previous_names":["umar44641/trendymart-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UMAR44641%2FTrendyMart-BACKEND","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UMAR44641%2FTrendyMart-BACKEND/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UMAR44641%2FTrendyMart-BACKEND/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/UMAR44641%2FTrendyMart-BACKEND/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/UMAR44641","download_url":"https://codeload.github.com/UMAR44641/TrendyMart-BACKEND/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245674432,"owners_count":20654162,"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":["atlas","authentication","authorization","express-js","middlewares","mongodb","mongoose","nodejs"],"created_at":"2025-01-31T15:55:09.495Z","updated_at":"2025-12-30T20:32:58.282Z","avatar_url":"https://github.com/UMAR44641.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"API's and endpoints\r\n\r\n\r\n\r\nBaseURL=\r\n\r\n-----API ENDPOINTS-----\r\n\r\n(i)  /users/register \u003c-----\u003e {method===\u003ePOST} \u003c-----\u003e  (for registering new user) \r\n   ==request body==\r\n   {\r\n    email:String,\r\n    password:String,\r\n    city:String,\r\n    name:String,\r\n    mobile:Number,\r\n    age:Number,\r\n    gender:String\r\n    }\r\n   ==responses==\r\n     1.res = {\"message\":\"Registered successfully\"}----\u003e[successfull registration]\r\n     2.res = {\"message\":error}-----\u003e[if any error happens]\r\n     3.res = {\"message\":\"User already exists, please login\"}-----\u003eif user already exists\r\n\r\n\r\n(ii)  /users/login \u003c-----\u003e {method===\u003ePOST} \u003c-----\u003e(for logging into the account)\r\n   ==request body==\r\n   {\r\n    email:String,\r\n    password:String\r\n    }\r\n   ==responses==\r\n     1.res = {\"message\":'login successfull',\"token\":token,\"user_details\":[{email,name...}]}----\u003e[successfull login]\r\n     2.res = {\"message\":error}-----\u003e[if any error happens]\r\n     4.res = {\"message\":\"wrong password\"}-----\u003e[correct email \u0026 wrong password]\r\n     5.res = {\"message\":\"Incorrect email\"}-----\u003e[correct password \u0026 wrong email]\r\n\r\n(iii) /admins/register \u003c-----\u003e {method===\u003ePOST} \u003c-----\u003e  (for registering new admin) \r\n   ==request body==\r\n   {\r\n    email:String,\r\n    password:String,\r\n    city:String,\r\n    name:String,\r\n    mobile:Number,\r\n    age:Number,\r\n    gender:String,\r\n    secretkey:String\r\n    }\r\n   ==responses==\r\n     1.res = {\"message\":\"Admin Registered successfully\"}----\u003e[successfull registration]\r\n     2.res = {\"message\":error}-----\u003e[if any error happens]\r\n     3.res = {\"message\":\"You already have an account, please login\"}-----\u003eif user already exists\r\n\r\n(iv)  /admins/login \u003c-----\u003e {method===\u003ePOST} \u003c-----\u003e(for logging into the admin account)\r\n   ==request body==\r\n   {\r\n    email:String,\r\n    password:String\r\n    }\r\n   ==responses==\r\n     1.res = {\"message\":'Successfully logged in as admin',\"token\":token,\"admin_details\":[{email,name...}]}----\u003e[successfull login]\r\n     2.res = {\"message\":error}-----\u003e[if any error happens]\r\n     4.res = {\"message\":\"wrong password\"}-----\u003e[correct email \u0026 wrong password]\r\n     5.res = {\"message\":\"Incorrect email\"}-----\u003e[correct password \u0026 wrong email]\r\n\r\n(v)  /products/ \u003c-----\u003e {method===\u003eGET} \u003c-----\u003e(getting all the products)\r\n    \r\n    ===queries===\r\n     search=String  [it will get the items which include the string passed in search query]\r\n     category=mens || womens || kids [filters on the basis of category]\r\n     sort=asc [ascending order on price basis]\r\n     sort=desc [descending order on price basis]\r\n     minprice=Number [gets products having price larger than minprice]\r\n     maxprice=Number [gets products having price larger than maxprice]\r\n     \r\n     ===responses===\r\n     1.res = [{},{},---]     \u003c----\u003e[array containg objects]\r\n     2.res = {\"message\":error}      \u003c-----\u003e[if any error happens]\r\n\r\n\r\n(vi) /products/:id    \u003c-----\u003e {method===\u003eGET} \u003c-----\u003e(getting a single product)\r\n\r\n    ===responses===\r\n     1.res = {}     \u003c----\u003e[object containing tht product]\r\n     2.res = {\"message\":error}      \u003c-----\u003e[if any error happens]\r\n\r\n\r\n(vii) /products/upload \u003c------\u003e {method===\u003ePOST}  \u003c----\u003e (for posting a product)\r\n    \r\n    ==request body==\r\n   {\r\n    url:String,\r\n    title:String,\r\n    desc:String,\r\n    category:String,\r\n    price:Number,\r\n    cutprice:Number,\r\n    id:Number,\r\n    stock:Number\r\n    }\r\n    ===request headers===\r\n    \u003c--\u003ereq.headers.authorization=token\u003c--\u003e\r\n\r\n    ===responses===\r\n    1.res = {\"message\":\"Product uploaded successfully\"}\r\n    2.res = {\"message\":error}\r\n\r\n\r\n(viii) /products/:id \u003c------\u003e {method===\u003ePATCH}  \u003c----\u003e (for updating details of a product)\r\n    \r\n    ===request===\r\n    \u003c--\u003ereq.headers.authorization=token\u003c--\u003e\r\n    \u003c--\u003ereq.body=object containing updated details\u003c--\u003e\r\n\r\n    ===responses===\r\n    1.res = {\"message\":\"product details updated successfully\"}   \r\n    2.res = {\"message\":error}\r\n\r\n\r\n(ix) /products/:id \u003c------\u003e {method===\u003eDELETE}  \u003c----\u003e (for deleting a particular product)\r\n    \r\n    ===request===\r\n    \u003c--\u003ereq.headers.authorization=token\u003c--\u003e\r\n\r\n    ===responses===\r\n    1.res = {\"message\":\"The product has been deleted successfully\"}\r\n    2.res = {\"message\":error}\r\n\r\n\r\n(x) /cart   \u003c------\u003e  {method====\u003eGET}   \u003c----\u003e (for getting all the products in the cart of the user who is logged in)\r\n\r\n     ===request===\r\n    \u003c--\u003ereq.headers.authorization=token\u003c--\u003e\r\n\r\n    ===responses===\r\n    1.res = [{},{},---]     \u003c----\u003e[array containg objects]\r\n    2.res = {\"message\":error}     \u003c-----\u003e[if any error happens]\r\n\r\n\r\n\r\n(xi) /cart/upload   \u003c------\u003e  {method====\u003ePOST}   \u003c----\u003e (to add product to the cart)\r\n\r\n     ===request===\r\n    \u003c--\u003ereq.headers.authorization=token\u003c--\u003e\r\n      \u003c---\u003ereq.body={all the product keys}\r\n\r\n    ===responses===\r\n    1.res = {\"message\":\"quantity in cart increased by one\"}    \u003c----\u003e[if product is already in the cart]\r\n    2.res = {\"message\":\"No authorization to do this task\"}  \r\n    3.res = {\"message\":\"Product has been added to the cart\"}  \u003c--\u003e[product added to the cart]\r\n    4.res = {\"message\":error}     \u003c-----\u003e[if any error happens]\r\n\r\n\r\n(xii) /cart/delete/:id   \u003c------\u003e  {method====\u003eDELETE}   \u003c----\u003e (to remove product from the cart)\r\n\r\n     ===request===\r\n    \u003c--\u003ereq.headers.authorization=token\u003c--\u003e\r\n\r\n    ===responses===\r\n    1.res = {\"message\":\"No authorization to do this task\"}\r\n    3.res = {\"message\":\"item removed from cart\"}  \u003c--\u003e[product removed from the cart]\r\n    4.res = {\"message\":error}     \u003c-----\u003e[if any error happens]\r\n\r\n\r\n\r\n\r\n(xiii) /cart/increasequantity/:id   \u003c------\u003e  {method====\u003ePATCH}   \u003c----\u003e (to increase quantity of the product)\r\n\r\n     ===request===\r\n    \u003c--\u003ereq.headers.authorization=token\u003c--\u003e\r\n\r\n    ===responses===\r\n    1.res = {\"message\":\"No authorization to do this task\"}\r\n    3.res = {\"message\":\"quantity increased by one\"}  \u003c--\u003e[to increase quantity]\r\n    4.res = {\"message\":error}     \u003c-----\u003e[if any error happens]\r\n\r\n\r\n\r\n(xiv) /cart/decreasequantity/:id   \u003c------\u003e  {method====\u003ePATCH}   \u003c----\u003e (to decrease quantity of the product)\r\n\r\n     ===request===\r\n    \u003c--\u003ereq.headers.authorization=token\u003c--\u003e\r\n\r\n    ===responses===\r\n    1.res = {\"message\":\"No authorization to do this task\"}\r\n    3.res = {\"message\":\"quantity decreased by one\"}  \u003c--\u003e[to decrease quantity]\r\n    4.res = {\"message\":error}     \u003c-----\u003e[if any error happens]","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumar44641%2Ftrendymart-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fumar44641%2Ftrendymart-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fumar44641%2Ftrendymart-backend/lists"}