{"id":22585671,"url":"https://github.com/vedhatech002/tn-treasures","last_synced_at":"2025-03-28T17:18:38.277Z","repository":{"id":223719943,"uuid":"761339285","full_name":"vedhatech002/tn-treasures","owner":"vedhatech002","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-23T17:56:02.000Z","size":1305,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-02T17:53:04.779Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://tn-treasures.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/vedhatech002.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,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-21T17:26:18.000Z","updated_at":"2024-02-23T09:29:36.000Z","dependencies_parsed_at":"2024-02-23T10:30:36.363Z","dependency_job_id":"b90da827-656e-4d33-bb8b-004e2788ad27","html_url":"https://github.com/vedhatech002/tn-treasures","commit_stats":null,"previous_names":["vedhatech002/tn-tresure","vedhatech002/tn-treasures"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedhatech002%2Ftn-treasures","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedhatech002%2Ftn-treasures/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedhatech002%2Ftn-treasures/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedhatech002%2Ftn-treasures/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vedhatech002","download_url":"https://codeload.github.com/vedhatech002/tn-treasures/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246068308,"owners_count":20718503,"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-12-08T07:09:16.419Z","updated_at":"2025-03-28T17:18:38.257Z","avatar_url":"https://github.com/vedhatech002.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tn-tourism\n\n### todo\n\n- [x] route setup\n- [x] places page\n- [x] contribute page\n- [x] firebase setup\n- [x] exploring firebase crud\n- [x] CRUD operation React + FireBase\n- [ ] Home page\n- [ ] search option\n- [ ] filter option\n- [ ] file validation for storage\n\n### get doc\n\n```js\nconst getFirebaseDatas = async () =\u003e {\n  const querySnapshot = await getDocs(collection(db, \"touristPlaces\"));\n  const data = querySnapshot.docs.map((doc) =\u003e {\n    const getData = doc.data();\n    const getId = doc.id;\n    const finalData = { ...getData, id: getId };\n    return finalData;\n  });\n  console.log(data);\n  if (querySnapshot.docs.length === 0) {\n    console.log(\"norecord exist\");\n  }\n};\ngetFirebaseDatas();\n```\n\n### set doc\n\n```js\nconst setData = async () =\u003e {\n  const docRef = collection(db, collectionName);\n  await setDoc(doc(docRef, documntId), {\n    data,\n  });\n  console.log(\"Document written with ID: \", docRef.id);\n};\nsetData();\n```\n\n### add Doc\n\n```js\nconst setFireStoreData = async () =\u003e {\n  await addDoc(collection(db, collectionName), {\n    // some data to store\n  });\n};\n```\n\n### update doc\n\n```js\nconst updateData = async () =\u003e {\n  const updateRef = doc(db, collectionName, docId);\n\n  await updateDoc(kodikaraiRef, {\n    prop: \"value\",\n  });\n};\nupdateData();\n```\n\n### delete doc\n\n```js\nconst deleteData = async () =\u003e {\n  await deleteDoc(doc(db, collectionName, docId));\n};\ndeleteData();\n```\n\n## file validation\n\n```js\nimage: z\n.any()\n.refine((files) =\u003e files?.[0]?.size \u003c= 5000000, `Max image size is 5MB.`)\n.refine(\n(files) =\u003e\n[\"image/jpeg\", \"image/jpg\", \"image/webp\"].includes(files?.[0]?.type),\n\"Only .jpg, .jpeg formats are supported.\"\n),\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvedhatech002%2Ftn-treasures","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvedhatech002%2Ftn-treasures","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvedhatech002%2Ftn-treasures/lists"}