{"id":28792006,"url":"https://github.com/deanc/buyxiny.com","last_synced_at":"2026-04-28T01:32:26.347Z","repository":{"id":42958085,"uuid":"228244408","full_name":"deanc/buyxiny.com","owner":"deanc","description":"Repository for buyxiny.com","archived":false,"fork":false,"pushed_at":"2023-01-09T12:06:14.000Z","size":2550,"stargazers_count":1,"open_issues_count":15,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-18T00:38:53.457Z","etag":null,"topics":["gatsby"],"latest_commit_sha":null,"homepage":"https://buyxiny.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deanc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-15T20:05:41.000Z","updated_at":"2020-07-18T13:12:26.000Z","dependencies_parsed_at":"2023-02-08T11:02:12.794Z","dependency_job_id":null,"html_url":"https://github.com/deanc/buyxiny.com","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/deanc/buyxiny.com","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanc%2Fbuyxiny.com","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanc%2Fbuyxiny.com/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanc%2Fbuyxiny.com/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanc%2Fbuyxiny.com/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deanc","download_url":"https://codeload.github.com/deanc/buyxiny.com/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deanc%2Fbuyxiny.com/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32362781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-27T20:07:02.737Z","status":"ssl_error","status_checked_at":"2026-04-27T20:07:00.910Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["gatsby"],"created_at":"2025-06-18T00:31:25.217Z","updated_at":"2026-04-28T01:32:26.341Z","avatar_url":"https://github.com/deanc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 2. Firestore collections\n\nCreate a project and add three collections:\n\n- `items`\n- `countries`\n- `locations`\n\nAs firestore is schema-less I can't provide a schema, but will add required fields for documents in each\ncollection in due course.\n\nYou will need to set up firebase rules like so:\n\n```\nrules_version = '2';\nservice cloud.firestore {\n  match /databases/{database}/documents {\n\n  \tfunction isPublic() {\n    \treturn resource.data.active == 1;\n    }\n\n  \tfunction isLoggedIn() {\n    \treturn request.auth.uid != null;\n    }\n\n  \tfunction isAuthor() {\n      return request.auth.uid == request.resource.data.author;\n    }\n\n    function isAdmin() {\n    \treturn request.auth.uid != null \u0026\u0026 'admin' in request.auth.token.roles;\n    }\n\n    function isModerator() {\n    \treturn request.auth.uid != null \u0026\u0026 'moderator' in request.auth.token.roles;\n    }\n\n    function hasRole() {\n    \treturn isAdmin() || isModerator();\n    }\n\n    match /countries/{country} {\n      allow read;\n      allow write,update,delete: if isAdmin();\n    }\n\n    match /locations/{location} {\n      allow read;\n      allow create: if isLoggedIn();\n      allow update: if isAuthor() || hasRole();\n      allow delete: if hasRole();\n    }\n\n    match /items/{item} {\n      allow read;\n      allow create: if isLoggedIn();\n      allow update: if isAuthor() || hasRole();\n      allow delete: if hasRole();\n    }\n  }\n}\n```\n\nAdd an index to the `items` collection across the following fields: `type Ascending name Ascending`\n\n# 3. Search\n\nWe will use Algolia for search. Sign up and get your necessary API keys. Create two indices called `Items` and `Locations`.\n\n# 4. Firebase functions\n\nWe will use Firebase functions for two purposes:\n\n- Pinging netlify to rebuild when firestore receives changes\n- Syncings firestore data with Algolia's search index\n\nInstructions:\n\n- Make sure you have the `firebase-tools` installed: `npm install -g firebase-tools`\n- Navigate to `firebase-functions` and type `firebase init` and authenticate against your account\n- `firebase init` and choose `Functions: Configure and deploy Cloud Functions`\n- Select the `buyxiny` project\n- Follow the necessary instructions\n- Set the following env variable to point to your netlify build hook: `firebase functions:config:set netlify.buildhook=\"https://api.netlify.com/build_hooks/\u003cid\u003e\"` and confirm it's set by typing: `firebase functions:config:get`\n- Set the following env variable to set your Algolia app id: `firebase functions:config:set algolia.appid=\"\u003cid\u003e\" algolia.apikey=\"\u003cadmin-api-key\u003e\"`\n- Run `firebase deploy`\n- This should deploy all the firebase functions for Netlify build hooks, and syncings Firestore CRUD operations with the Algolia search index.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanc%2Fbuyxiny.com","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeanc%2Fbuyxiny.com","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeanc%2Fbuyxiny.com/lists"}