{"id":47787750,"url":"https://github.com/anas-farooq8/lightspeed-shopsync","last_synced_at":"2026-04-03T15:04:28.217Z","repository":{"id":337194562,"uuid":"1148760616","full_name":"anas-farooq8/Lightspeed-ShopSync","owner":"anas-farooq8","description":"Product sync tool for Lightspeed eCom shops. Sync products across multiple stores with translation, preview, and manual control.","archived":false,"fork":false,"pushed_at":"2026-03-09T15:47:38.000Z","size":745,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-09T20:54:41.787Z","etag":null,"topics":["ecom","ecommerce","lightspeed","multi-store","nextjs","product-sync","react","supabase","sync-tool","translation"],"latest_commit_sha":null,"homepage":"https://lightspeed-shopsync.vercel.app","language":"TypeScript","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/anas-farooq8.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":"2026-02-03T10:34:54.000Z","updated_at":"2026-03-09T15:47:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/anas-farooq8/Lightspeed-ShopSync","commit_stats":null,"previous_names":["anas-farooq8/lightspeed-shopsync"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/anas-farooq8/Lightspeed-ShopSync","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anas-farooq8%2FLightspeed-ShopSync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anas-farooq8%2FLightspeed-ShopSync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anas-farooq8%2FLightspeed-ShopSync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anas-farooq8%2FLightspeed-ShopSync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anas-farooq8","download_url":"https://codeload.github.com/anas-farooq8/Lightspeed-ShopSync/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anas-farooq8%2FLightspeed-ShopSync/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31359102,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T14:24:47.623Z","status":"ssl_error","status_checked_at":"2026-04-03T14:24:32.380Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["ecom","ecommerce","lightspeed","multi-store","nextjs","product-sync","react","supabase","sync-tool","translation"],"created_at":"2026-04-03T15:02:23.560Z","updated_at":"2026-04-03T15:04:28.061Z","avatar_url":"https://github.com/anas-farooq8.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lightspeed ShopSync\n\n\u003e A web-based product sync tool for syncing products between Lightspeed eCom shops using the Lightspeed API. Built for multi-store e-commerce operations with full translation support and manual control over every sync operation.\n\n[![Deployed on Vercel](https://img.shields.io/badge/Deployed%20on-Vercel-black?style=for-the-badge\u0026logo=vercel)](https://vercel.com)\n[![Next.js](https://img.shields.io/badge/Next.js-16.1-black?style=for-the-badge\u0026logo=next.js)](https://nextjs.org)\n[![React](https://img.shields.io/badge/React-19.2-61DAFB?style=for-the-badge\u0026logo=react)](https://react.dev)\n[![Supabase](https://img.shields.io/badge/Supabase-Database-3ECF8E?style=for-the-badge\u0026logo=supabase)](https://supabase.com)\n[![TypeScript](https://img.shields.io/badge/TypeScript-5.9-3178C6?style=for-the-badge\u0026logo=typescript)](https://www.typescriptlang.org)\n[![Tailwind CSS](https://img.shields.io/badge/Tailwind-4.1-38B2AC?style=for-the-badge\u0026logo=tailwind-css)](https://tailwindcss.com)\n[![GitHub Actions](https://img.shields.io/badge/GitHub%20Actions-Sync%20Cron-2088FF?style=for-the-badge\u0026logo=github-actions)](https://github.com/features/actions)\n[![Lightspeed eCom](https://img.shields.io/badge/Lightspeed-E--commerce-000000?style=for-the-badge\u0026logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAADZ0lEQVRYhaXXS2heRRQH8J9BSigSJJRwkaEEoUZ8VCulC5FaMEFxIxZfiIriA+qrtVpKkVAkBFdaLeLalY/ahQiC2LqwitaViKUiLaXoUC6lBClBQgnBxcynk4/vcb8vZ3Xnf+/8/zNnzpxzLmuwOoSNdQija+EYWctkvIM31kJw1bAT6xC24zv8g6kqxjgMz1AeqEMYkXYP6/HSMDxDLwBPYGsx/mvYBQx8BHUI63EG12XoLG7GKBarGFcG4RvGA/sLcXitivEK5vD0oGQDeaAOIeAP6dzhG9yLm/ArFrCpivFyU85BPfB2Ib4s7Z4UkFdjAq8OQth4AXUI2/B4AX1YxXi6DuF+3DcMJw2PoA4BvsddGbqEKSziN9yQ8QVswt9Ng7Hpah8pxOFgFeMCXi7EYTbje+sQSq90tb4eyLn+d0xm6BS2YFwKyGvb8A0Zv4BbqxiXe/E38cCeQhx2Z9K5QpwUkMuYxxhuxIv9yHt6oA5hQko6Yxn6oorxwTqEzfil2MCXVYwP1CFsxc8FviDViUvdNPp5YK4QX8LrOSDfL+Ze6YKTjumtXgJdF5B3+VwBvVfFeA47saMNPytd0Ts7UL1Qh3BLN52uR1CHcAzTeXhBunbLVgdknfGVjIcCH8e6PD6OmapDxe7ogbz76QI6UMW4iL1WB+SbOe3uL8RhHz4oxtO4vZNWtyO4vnhewtH8/GQbfqQOYdLqrugkPsZnbZyTOli3BZwunkelnZOCssT3SHWg1ReuSNd0BQd7cP5nvWLgczyUh4vSWdf4CdsyvlSIw0dVjM/k+vBVgR+tYny4k06va7gvC8A1mM872118U4pfxoE6hHU4VOBLUox0tK4LqGI8j8MF9FQdwh1VjCfxaYcp81WMtVSOy/pwOF/fjtYvE45JmXAiQydwNzZK167VG7TaslZ9aCWvi/o0KD0zYZ44W0DbsbOK8U//B+QyXsltWasOtGy2X3fUpBqOSHl/c4bO4bYqxsWc4RarGM/XIezAt8WmTmFLv2rYtCGZxrECOoFduSMaldr0Q1KwtmymivF4P+7GTWkdwid4rA1ekOKg/f/wSBXjo014B+nfnscPbdh4B/Ef8WxT0sYLyLVgBu9KJbjdruR39+RvG9lQP6d1CBukTngqQ2fwdRXjxUG5/gXjDRD1FVFwowAAAABJRU5ErkJggg==)](https://developers.lightspeedhq.com/ecom/introduction/introduction/)\n\n---\n\n## Overview\n\nLightspeed ShopSync enables seamless product synchronization across multiple Lightspeed eCom storefronts. Designed for businesses operating in multiple regions (e.g., .nl, .de, .be), it provides a manual, user-controlled workflow with preview-before-sync, automatic translation, and intelligent handling of duplicate SKUs.\n\n### Core Philosophy\n\n- **Manual sync only** - Nothing syncs automatically; you decide what to create, update, or skip\n- **Source of truth** - One shop (e.g., .nl) is the source; all sync flows from it\n- **Product-level sync** - Variants are synced as a unit, preserving product structure\n- **Full control** - Edit content, select variants, and choose target shops before any operation\n\n---\n\n## Features\n\n### Sync Operations\n\n| Tab | Purpose |\n|-----|---------|\n| **CREATE** | Create missing products in target shops from source |\n| **EDIT** | Update existing products in target shops with source data |\n| **NULL SKU** | Handle products with missing default SKUs (shop-specific edits) |\n\n### Smart Matching \u0026 Duplicate Handling\n\n- **Product-level matching** using variant SKU as the key\n- **Duplicate detection** in both source and target shops\n- **Scenario support**: 1-1, M-1, M-M, 1-M (with source/target selectors)\n- **Match type indicators**: Default variant vs non-default variant (structure mismatch)\n\n### Translation System\n\n- **Automatic translation** via Google Cloud Translation API (NL → DE, FR)\n- **Identical copy** for same-language targets (e.g., NL → NL on .be)\n- **Preview before sync** — All translations visible and editable\n- **Manual edit protection** — User edits are never overwritten\n- **Re-translate** — Per field or entire language\n- **Session-based caching** — Efficient batching by language pair\n\n### Dashboard \u0026 UX\n\n- KPI cards per shop with sync status\n- Last sync metrics and timestamps\n- Tabbed interface with CREATE, EDIT, NULL SKU\n- Table and grid view modes\n- Server-side pagination, search, sorting, filtering\n- URL state management — Filters and navigation preserved\n- Responsive design with shadcn/ui components\n\n---\n\n## Tech Stack\n\n- **Framework**: Next.js 16.1, React 19.2\n- **Database**: Supabase (PostgreSQL)\n- **Auth**: Supabase Auth (email/password, signup disabled)\n- **Styling**: Tailwind CSS, shadcn/ui, Radix UI\n- **APIs**: Lightspeed eCom API, Google Cloud Translation API\n\n---\n\n## Shops Configuration\n\nThe project is **dynamic** and supports multiple shops. Shops are configured in the database and via environment variables (`LIGHTSPEED_API_KEY_{TLD}`, `LIGHTSPEED_API_SECRET_{TLD}`). One shop acts as the source of truth; others are targets. Example setup:\n\n| Shop | Store # | URL | Role | Languages |\n|------|----------|-----|------|-----------|\n| VerpakkingenXL | #293467 | verpakkingenxl.nl | **SOURCE** | NL |\n| VerpackungenXL | #293470 | verpackungenxl.de | TARGET | DE |\n| VerpakkingenXL-BE | #343623 | verpakkingenxl.be | TARGET | NL, FR |\n\n---\n\n## Getting Started\n\n### Prerequisites\n\n- Node.js 18+\n- Supabase account\n- Lightspeed eCom API credentials\n- Google Cloud Translation API key (optional, for auto-translation)\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/anas-farooq8/Lightspeed-ShopSync.git\ncd Lightspeed-ShopSync\n\n# Install dependencies\nnpm install\n\n# Set up environment variables (see below)\ncp .env.example .env.local\n```\n\n### Environment Variables\n\nCopy `.env.example` to `.env.local` and fill in your values:\n\n```env\n# Supabase\nNEXT_PUBLIC_SUPABASE_URL=your_supabase_url_here\nNEXT_PUBLIC_SUPABASE_ANON_KEY=your_supabase_anon_key_here\nSUPABASE_SERVICE_ROLE_KEY=your_service_role_key_here\n\n# App URL (optional)\n# Local: http://localhost:3000\n# Deployment: https://your-app.vercel.app\nNEXT_PUBLIC_APP_URL=http://localhost:3000\n\n# Lightspeed eCom API (per shop TLD: NL, DE, BE)\nLIGHTSPEED_API_KEY_NL=your_lightspeed_api_key_here\nLIGHTSPEED_API_SECRET_NL=your_lightspeed_api_secret_here\nLIGHTSPEED_API_KEY_DE=your_lightspeed_api_key_here\nLIGHTSPEED_API_SECRET_DE=your_lightspeed_api_secret_here\nLIGHTSPEED_API_KEY_BE=your_lightspeed_api_key_here\nLIGHTSPEED_API_SECRET_BE=your_lightspeed_api_secret_here\n\n# Google Cloud Translation API (Service Account)\n# Grant role: Cloud Translation API User\n# Enable: https://console.cloud.google.com/apis/library/translate.googleapis.com\nGOOGLE_TYPE=service_account\nGOOGLE_PROJECT_ID=project-id\nGOOGLE_PRIVATE_KEY_ID=project-private-key-id\nGOOGLE_PRIVATE_KEY=\"-----BEGIN PRIVATE KEY-----\\nyour-private-key\\n-----END PRIVATE KEY-----\\n\"\nGOOGLE_CLIENT_EMAIL=service-account-email\nGOOGLE_CLIENT_ID=client-id\nGOOGLE_AUTH_URI=https://accounts.google.com/o/oauth2/auth\nGOOGLE_TOKEN_URI=https://oauth2.googleapis.com/token\nGOOGLE_AUTH_PROVIDER_CERT_URL=https://www.googleapis.com/oauth2/v1/certs\nGOOGLE_CLIENT_CERT_URL=google-client-cert-url\nGOOGLE_UNIVERSE_DOMAIN=googleapis.com\n```\n\n### Database Setup\n\nRun the SQL scripts in order (see `scripts/` folder):\n\n1. `01-init-schema.sql` — Tables, indexes, RLS, triggers\n2. `02-rpc-functions.sql` — Dashboard KPIs, sync log functions\n3. `03-product-sync-view.sql` — Product sync status view\n4. `04-sync-operations-rpc.sql` — Sync operations RPC\n5. `05-product-details-rpc.sql` — Product details RPC\n\n### Run the App\n\n```bash\n# Development\nnpm run dev\n\n# Production build\nnpm run build\nnpm start\n```\n\n### Data Sync\n\n**Option 1: Manual (local)**\n\n```bash\n# Requires Python 3.11+ and pip install -r requirements.txt\npython scripts/sync.py\n```\n\n**Option 2: GitHub Actions (automated)**\n\nA scheduled workflow syncs products daily via `.github/workflows/sync-cron.yml`:\n\n- **Schedule:** Runs daily at 00:05 UTC\n- **Manual trigger:** Available from the GitHub Actions tab (`workflow_dispatch`)\n- **Secrets required:** `NEXT_PUBLIC_SUPABASE_URL`, `SUPABASE_SERVICE_ROLE_KEY`, and per-shop `LIGHTSPEED_API_KEY_{TLD}`, `LIGHTSPEED_API_SECRET_{TLD}` (e.g. NL, DE, BE)\n\nConfigure secrets in **Settings → Secrets and variables → Actions**.\n\n---\n\n## Project Structure\n\n```\n├── app/\n│   ├── api/                          # API routes\n│   │   ├── create-product/           # POST - Create product in target shop\n│   │   ├── last-product-operation/   # GET - Last 10 product ops (dashboard)\n│   │   ├── last-sync/                # GET - Last sync info per shop\n│   │   ├── product-details/          # GET - Product by SKU or product ID\n│   │   ├── product-images/           # GET - Fetch images from Lightspeed API\n│   │   ├── product-operation-logs/   # GET - Paginated create/edit logs\n│   │   ├── shops/                    # GET - All shops (source + target)\n│   │   ├── stats/                    # GET - Dashboard KPIs\n│   │   ├── sync-logs/                # GET - Paginated sync logs by date\n│   │   ├── sync-operations/          # GET - Paginated CREATE/EDIT/NULL SKU\n│   │   ├── translate/                # POST - Batch translation (Google)\n│   │   └── update-product/           # PUT - Update product in target shop\n│   ├── dashboard/                    # Protected dashboard pages\n│   │   ├── product-sync-logs/        # Product operation logs\n│   │   ├── sync-logs/                # Shop sync logs\n│   │   └── sync-operations/          # CREATE, EDIT, NULL SKU tabs\n│   │       ├── preview-create/[sku]/ # Create flow\n│   │       ├── preview-edit/[sku]/    # Edit flow\n│   │       ├── product/[productId]/   # Null SKU product view\n│   │       └── products/[sku]/       # SKU-based product view\n│   ├── login/                        # Auth page\n│   └── layout.tsx\n├── components/\n│   ├── sync-operations/               # Tabs, dialogs, product list, panels\n│   ├── sync-logs/                    # Sync log cards\n│   ├── product-sync-logs/            # Product operation logs\n│   ├── dashboard/                    # Stats, last sync, KPIs\n│   ├── shared/                       # Shared product operation components\n│   └── ui/                           # shadcn/ui components\n├── lib/\n│   ├── services/                     # create-product, update-product, translation, lightspeed-api, image-handler\n│   ├── supabase/                     # Client \u0026 server Supabase\n│   ├── cache/                        # Product images cache\n│   ├── constants/                    # Product UI constants\n│   └── api.ts                        # API helpers\n├── hooks/                            # useProductEditor, useProductNavigation\n├── types/                            # database, product, lightspeed-api\n├── scripts/                          # SQL schema (01–05), sync.py\n├── .github/workflows/\n│   └── sync-cron.yml                 # Daily Lightspeed sync (00:05 UTC)\n```\n\n---\n\n## API Endpoints\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| GET | `/api/stats` | Dashboard KPI statistics per shop |\n| GET | `/api/last-sync` | Last sync information per shop |\n| GET | `/api/shops` | All shops (source + target) |\n| GET | `/api/sync-operations` | Paginated sync operations (CREATE/EDIT/NULL SKU) |\n| GET | `/api/product-details` | Product details by SKU or product ID |\n| GET | `/api/product-images` | Fetch product images from Lightspeed API (link, shopTld) |\n| GET | `/api/product-operation-logs` | Paginated create/edit operation logs |\n| GET | `/api/last-product-operation` | Last 10 product operations (dashboard) |\n| GET | `/api/sync-logs` | Paginated sync logs grouped by date |\n| POST | `/api/create-product` | Create product in target shop(s) |\n| PUT | `/api/update-product` | Update product in target shop |\n| POST | `/api/translate` | Batch translation (Google Cloud Translation API) |\n\n---\n\n## Data Synced\n\n**In scope:** Title, variant title, description, content (HTML), selling price, images, variants\n\n**Out of scope:** Stock levels, delivery info, category structure\n\n---\n\n## License\n\nPrivate project. All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanas-farooq8%2Flightspeed-shopsync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanas-farooq8%2Flightspeed-shopsync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanas-farooq8%2Flightspeed-shopsync/lists"}