{"id":35720863,"url":"https://github.com/semihbugrasezer/flow-to-supabase","last_synced_at":"2026-01-06T07:01:12.429Z","repository":{"id":330724324,"uuid":"1123491323","full_name":"semihbugrasezer/flow-to-supabase","owner":"semihbugrasezer","description":"Browser userscript that detects new images in Google Labs Flow and auto-uploads them to Supabase Storage via a Vercel API (compression, metadata, deduplication).","archived":false,"fork":false,"pushed_at":"2025-12-27T14:30:09.000Z","size":62,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-29T10:05:23.361Z","etag":null,"topics":["api","browser-automation","flow","google-labs","serverless","storage","supabase","userscript","vercel"],"latest_commit_sha":null,"homepage":"https://flow-image-downloader.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/semihbugrasezer.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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-27T01:44:21.000Z","updated_at":"2025-12-27T14:30:12.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/semihbugrasezer/flow-to-supabase","commit_stats":null,"previous_names":["semihbugrasezer/flow-to-supabase"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/semihbugrasezer/flow-to-supabase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semihbugrasezer%2Fflow-to-supabase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semihbugrasezer%2Fflow-to-supabase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semihbugrasezer%2Fflow-to-supabase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semihbugrasezer%2Fflow-to-supabase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/semihbugrasezer","download_url":"https://codeload.github.com/semihbugrasezer/flow-to-supabase/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semihbugrasezer%2Fflow-to-supabase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28223108,"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","status":"online","status_checked_at":"2026-01-06T02:00:07.049Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["api","browser-automation","flow","google-labs","serverless","storage","supabase","userscript","vercel"],"created_at":"2026-01-06T07:00:34.104Z","updated_at":"2026-01-06T07:01:12.418Z","avatar_url":"https://github.com/semihbugrasezer.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flow Image Auto Uploader\n\nAutomatically uploads new images from Flow to Supabase Storage. A browser userscript detects new images while Flow is open, and a Vercel API performs compression, metadata generation, and deduplication.\n\n## Architecture\n\n- **Userscript**: Runs in the browser and collects new image URLs from the Flow page.\n- **Vercel API**: Downloads images, compresses them, writes metadata, and uploads to Supabase.\n- **Supabase Storage**: Stores the JPEG and a JSON metadata file per image.\n\n## About Flow\n\nFlow is a Google Labs product for generating media. More details: https://labs.google/flow/about.\n\n## Requirements\n\n- Supabase project with a storage bucket (example: `flow-image`)\n- Vercel project hosting this repo\n- Tampermonkey or Violentmonkey installed in the browser\n\n## Vercel Environment Variables\n\nSet these in Vercel (Production and Preview):\n\n```\nNEXT_PUBLIC_SUPABASE_URL=https://YOUR_PROJECT.supabase.co\nNEXT_PUBLIC_SUPABASE_KEY=YOUR_ANON_OR_PUBLISHABLE_KEY\nSUPABASE_SERVICE_ROLE_KEY=YOUR_SERVICE_ROLE_KEY\nBUCKET_NAME=flow-image\nALLOWED_ORIGIN=*\nSYNC_SECRET=YOUR_SYNC_TOKEN\nSYNC_TABLE=flow_images\nSYNC_FOLDER=\nSYNC_MAX_OBJECTS=100000\n```\n\n## Supabase Storage Policies\n\nAllow anon uploads and reads for your bucket:\n\n```sql\nCREATE POLICY \"Allow anon uploads\"\nON storage.objects\nFOR INSERT\nTO anon\nWITH CHECK (bucket_id = 'flow-image');\n\nCREATE POLICY \"Allow anon reads\"\nON storage.objects\nFOR SELECT\nTO anon\nUSING (bucket_id = 'flow-image');\n```\n\n## Userscript Installation\n\n1. Install Tampermonkey or Violentmonkey.\n2. Create a new userscript.\n3. Paste the contents of `flow-auto-uploader.user.js`.\n4. Save and ensure the script is enabled.\n5. Open a Flow project page. Uploads happen automatically.\n\n## API Endpoint\n\n```\nPOST /api/upload-flow-images\n```\n\nExample request body:\n\n```json\n{\n  \"images\": [\n    \"https://storage.googleapis.com/ai-sandbox-videofx/image/EXAMPLE\"\n  ],\n  \"compressQuality\": 85,\n  \"maxWidth\": 1920,\n  \"maxHeight\": 1920\n}\n```\n\n## Deduplication\n\nThe API hashes the source URL and uses a deterministic file name, so identical URLs are not uploaded twice. The userscript also keeps a local cache of uploaded URLs to avoid repeat uploads during a browsing session.\n\n## Optional Bookmarklet\n\nIf you need manual triggering, use the bookmarklet generator:\n\n```\n/bookmarklet-generator\n```\n\n## Storage → DB Sync (Template)\n\n```\nPOST /api/sync-storage-to-db\n```\n\nHeaders:\n\n```\nAuthorization: Bearer YOUR_SYNC_TOKEN\n```\n\nOptional query params:\n\n```\ntoken=YOUR_SYNC_TOKEN\ndryRun=1\n```\n\nNotes:\n- The endpoint lists objects in `BUCKET_NAME`, filters `.jpg`, and inserts missing rows into `SYNC_TABLE`.\n- Protect it with `SYNC_SECRET` and call it from a trusted backend or an external cron that can send the token.\n\nExample (GitHub Actions cron):\n\n```\ncurl -sS -X POST \"https://YOUR_VERCEL_DOMAIN/api/sync-storage-to-db?token=${SYNC_SECRET}\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemihbugrasezer%2Fflow-to-supabase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsemihbugrasezer%2Fflow-to-supabase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemihbugrasezer%2Fflow-to-supabase/lists"}