{"info":{"_postman_id":"1c2b2298-4fd7-431b-a3c5-8f08adb07f2f","name":"DesignHub","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","toc":[],"description":"<html><head></head><body></body></html>","owner":"35384124","collectionId":"1c2b2298-4fd7-431b-a3c5-8f08adb07f2f","publishedId":"2sAYdfqWRK","public":true,"customColor":{"top-bar":"FFFFFF","right-sidebar":"303030","highlight":"155dfc"},"publishDate":"2025-03-17T12:28:50.000Z"},"item":[{"name":"Authentication","item":[{"name":"Register","id":"53b57dc5-9583-492e-9336-e194ff733f87","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"Lokitha\",\r\n    \"email\": \"lokitha@gmail.com\",\r\n    \"password\": \"1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/auth/register","description":"<p>Registers a new user. Expects a JSON body with user details (username, email, password). Returns a success message if the registration is successful.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","auth","register"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"d2379fae-a15b-44c5-b468-f5c99290a9a4","name":"Register","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"username\": \"Lokitha\",\r\n    \"email\": \"lokitha@gmail.com\",\r\n    \"password\": \"1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/auth/register"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"http://localhost:5173"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"30"},{"key":"ETag","value":"W/\"1e-lHzIf3o0Mt42k+FlG0abxkrvmbo\""},{"key":"Date","value":"Thu, 27 Feb 2025 13:49:16 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"\"User registered successfully\""}],"_postman_id":"53b57dc5-9583-492e-9336-e194ff733f87"},{"name":"Login","id":"8adb6b18-97f5-44de-a3b9-1afd7a81a01a","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"lokitha@gmail.com\",\r\n    \"password\": \"1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/auth/login","description":"<p>Authenticates a user. Expects a JSON body with email and password. Returns authentication tokens if successful.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","auth","login"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"5cbdcb3d-feaa-4388-b8e2-18100a4356d2","name":"Login","originalRequest":{"method":"POST","header":[],"body":{"mode":"raw","raw":"{\r\n    \"email\": \"lokitha@gmail.com\",\r\n    \"password\": \"1234\"\r\n}","options":{"raw":{"language":"json"}}},"url":"http://localhost:3000/api/v1/auth/login"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"http://localhost:5173"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"439"},{"key":"ETag","value":"W/\"1b7-RFcwdCETZrvQBk/tkRtj8yiPmD4\""},{"key":"Date","value":"Thu, 27 Feb 2025 13:51:06 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Imxva2l0aGFAZ21haWwuY29tIiwiaWF0IjoxNzQwNjY0MjY2LCJleHAiOjE3NDA2NjQzMjZ9.gJknM_drUEcR3e_XGDPIXDBTkt1YfFNxZ6QPlAQWu7Q\",\n    \"refreshToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Imxva2l0aGFAZ21haWwuY29tIiwiaWF0IjoxNzQwNjY0MjY2LCJleHAiOjE3NDEyNjkwNjZ9.YwkCz3M8P_Myozz58yWRO6zavjj1LnQWX-mJM6Kby-0\",\n    \"user\": {\n        \"id\": 1,\n        \"username\": \"Lokitha\",\n        \"email\": \"lokitha@gmail.com\"\n    }\n}"}],"_postman_id":"8adb6b18-97f5-44de-a3b9-1afd7a81a01a"},{"name":"Refresh Token","id":"858ce655-999d-4ead-8297-7deaa69ce053","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"url":"http://localhost:3000/api/v1/auth/refresh-token","description":"<p>Refreshes the authentication token. Expects an authorization header with the refresh token. Returns a new authentication token if successful.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","auth","refresh-token"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"c39d92df-ce91-4510-bfbb-41bc4b40659c","name":"Refresh Token","originalRequest":{"method":"POST","header":[],"url":"http://localhost:3000/api/v1/auth/refresh-token"},"status":"OK","code":200,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"http://localhost:5173"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"187"},{"key":"ETag","value":"W/\"bb-B4R1sh17egbrjvXmxovvxAh7L0I\""},{"key":"Date","value":"Thu, 27 Feb 2025 13:51:38 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"accessToken\": \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6Imxva2l0aGFAZ21haWwuY29tIiwiaWF0IjoxNzQwNjY0Mjk4LCJleHAiOjE3NDA2NjQzNTh9.MvO1Cz-7KKEKSV1-F9-gcrlBYLrXF_xw3U8A6q2hApM\"\n}"}],"_postman_id":"858ce655-999d-4ead-8297-7deaa69ce053"}],"id":"2cf6b727-c9fd-4de6-8682-4c1f8a3e7e98","_postman_id":"2cf6b727-c9fd-4de6-8682-4c1f8a3e7e98","description":""},{"name":"Component","item":[{"name":"Save Component","id":"34529393-42e6-4483-a093-996a51af2fe7","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"tit","value":"","type":"text","uuid":"6961d9ab-5361-46c5-9515-acc649225e97"},{"key":"title","value":"A simple button","type":"text","uuid":"2f9d01b8-1e60-4d13-8203-7c93516660c1"},{"key":"code","value":"const btn = () => {\n  return (\n    <button></button>\n  )\n}","type":"text","uuid":"6fae5b44-66f7-4f34-a367-f3c9090835c6"},{"key":"description","value":"A button component.","type":"text","uuid":"d0e964f9-44e4-437e-ad28-5167756b0635"},{"key":"tags","value":"[{\"name\": \"simple\"}]","type":"text","uuid":"4640745c-6e34-4222-bdc4-4d21eb68a93a"},{"key":"userId","value":"1","type":"text","uuid":"b9eb6e43-dfff-4e6c-9a74-e460a693146f"},{"key":"image","type":"file","uuid":"ac8fef4d-ef5b-4f98-9383-04c86686ceda","src":"/C:/Users/ljani/Downloads/1_hyxNvPZmKjIdc0ZQdEv6qw.png"}]},"url":"http://localhost:3000/api/v1/component","description":"<p>Creates a new component with the provided details such as title, code, description, tags, and user ID. Optionally, an image file can be uploaded.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","component"],"host":["localhost"],"query":[],"variable":[]}},"response":[{"id":"22a151ca-25da-4f2c-b651-e32b06f8e7a6","name":"Save Component","originalRequest":{"method":"POST","header":[],"body":{"mode":"formdata","formdata":[{"key":"tit","value":"","type":"text","uuid":"6961d9ab-5361-46c5-9515-acc649225e97"},{"key":"title","value":"A simple button","type":"text","uuid":"2f9d01b8-1e60-4d13-8203-7c93516660c1"},{"key":"code","value":"const btn = () => {\n  return (\n    <button></button>\n  )\n}","type":"text","uuid":"6fae5b44-66f7-4f34-a367-f3c9090835c6"},{"key":"description","value":"A button component.","type":"text","uuid":"d0e964f9-44e4-437e-ad28-5167756b0635"},{"key":"tags","value":"[{\"name\": \"simple\"}]","type":"text","uuid":"4640745c-6e34-4222-bdc4-4d21eb68a93a"},{"key":"userId","value":"1","type":"text","uuid":"b9eb6e43-dfff-4e6c-9a74-e460a693146f"},{"key":"image","type":"file","uuid":"ac8fef4d-ef5b-4f98-9383-04c86686ceda","src":"/C:/Users/ljani/Downloads/1_hyxNvPZmKjIdc0ZQdEv6qw.png"}]},"url":"http://localhost:3000/api/v1/component"},"status":"Created","code":201,"_postman_previewlanguage":"json","header":[{"key":"X-Powered-By","value":"Express"},{"key":"Access-Control-Allow-Origin","value":"http://localhost:5173"},{"key":"Vary","value":"Origin"},{"key":"Access-Control-Allow-Credentials","value":"true"},{"key":"Content-Type","value":"application/json; charset=utf-8"},{"key":"Content-Length","value":"324"},{"key":"ETag","value":"W/\"144-JkNLc58ajT+tpyBLyN9w1/EGPm0\""},{"key":"Date","value":"Thu, 27 Feb 2025 14:09:53 GMT"},{"key":"Connection","value":"keep-alive"},{"key":"Keep-Alive","value":"timeout=5"}],"cookie":[],"responseTime":null,"body":"{\n    \"id\": 1,\n    \"title\": \"A simple button\",\n    \"code\": \"const btn = () => {\\n  return (\\n    <button></button>\\n  )\\n}\",\n    \"description\": \"A button component.\",\n    \"createdAt\": \"2025-02-27T14:09:53.716Z\",\n    \"userId\": 1,\n    \"image\": \"http://localhost:3000/uploads/component_1.png\",\n    \"user\": {\n        \"username\": \"Lokitha\"\n    },\n    \"tags\": {\n        \"name\": \"simple\"\n    },\n    \"username\": \"Lokitha\"\n}"}],"_postman_id":"34529393-42e6-4483-a093-996a51af2fe7"},{"name":"Update Component","id":"539b1b2b-4079-4865-9b5d-5c555ee6bd94","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"PUT","header":[],"body":{"mode":"formdata","formdata":[{"key":"tit","value":"","type":"text","uuid":"6961d9ab-5361-46c5-9515-acc649225e97"},{"key":"title","value":"A simple header","type":"text","uuid":"2f9d01b8-1e60-4d13-8203-7c93516660c1"},{"key":"code","value":"const h1 = () => {\n  return (\n    <h1></h1>\n  )\n}","type":"text","uuid":"6fae5b44-66f7-4f34-a367-f3c9090835c6"},{"key":"description","value":"A header component.","type":"text","uuid":"d0e964f9-44e4-437e-ad28-5167756b0635"},{"key":"tags","value":"[{\"name\":\"simple\"},{\"name\":\"header\"}]","type":"text","uuid":"4640745c-6e34-4222-bdc4-4d21eb68a93a"},{"key":"userId","value":"1","type":"text","uuid":"b9eb6e43-dfff-4e6c-9a74-e460a693146f"},{"key":"image","type":"file","uuid":"ac8fef4d-ef5b-4f98-9383-04c86686ceda","src":"/C:/Users/ljani/Downloads/a-1664449553975-2x.jpg"}]},"url":"http://localhost:3000/api/v1/component/1","description":"<p>Updates an existing component identified by its ID with the new details provided in the request body.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","component","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"539b1b2b-4079-4865-9b5d-5c555ee6bd94"},{"name":"Delete Component","id":"bb69dcf7-5bb4-427e-ba57-e7861b77221e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"DELETE","header":[],"url":"http://localhost:3000/api/v1/component/1","description":"<p>Deletes an existing component identified by its ID.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","component","1"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"bb69dcf7-5bb4-427e-ba57-e7861b77221e"},{"name":"Find All Components","id":"bf9eb2ae-dedc-4225-ad8a-7cb060dfee6b","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/api/v1/component","description":"<p>Retrieves a list of all components.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","component"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"bf9eb2ae-dedc-4225-ad8a-7cb060dfee6b"}],"id":"b1419516-8d02-4dc2-ba81-fc1019e63cc2","_postman_id":"b1419516-8d02-4dc2-ba81-fc1019e63cc2","description":""},{"name":"Tags","item":[{"name":"Find All Tags","id":"0dda85e2-8ac1-48d2-a02a-9b96d94cea9e","protocolProfileBehavior":{"disableBodyPruning":true},"request":{"auth":{"type":"bearer","bearer":{"basicConfig":[{"key":"token","value":"<token>"}]},"isInherited":false},"method":"GET","header":[],"url":"http://localhost:3000/api/v1/tag","description":"<p>Retrieves a list of all tags.</p>\n","urlObject":{"protocol":"http","port":"3000","path":["api","v1","tag"],"host":["localhost"],"query":[],"variable":[]}},"response":[],"_postman_id":"0dda85e2-8ac1-48d2-a02a-9b96d94cea9e"}],"id":"4e318f0e-6f0c-4288-b88b-aa33e22b3fe2","_postman_id":"4e318f0e-6f0c-4288-b88b-aa33e22b3fe2","description":""}]}