Platform Setup
Voer deze stappen éénmalig uit om het platform klaar te maken.
1
Database tabellen aanmaken
Ga naar Supabase Dashboard β jouw project β SQL Editor en plak deze SQL:
-- Run this in Supabase Dashboard β SQL Editor -- 1. Platform settings (stores OAuth credentials) CREATE TABLE IF NOT EXISTS platform_settings ( key text PRIMARY KEY, value text NOT NULL, updated_at timestamptz DEFAULT now() ); -- 2. Shopify stores CREATE TABLE IF NOT EXISTS shopify_stores ( id uuid PRIMARY KEY DEFAULT gen_random_uuid(), user_id uuid NOT NULL REFERENCES auth.users(id) ON DELETE CASCADE, shop_domain text NOT NULL, access_token text NOT NULL, shop_name text, shop_email text, currency text DEFAULT 'EUR', is_active boolean DEFAULT false, products_cache jsonb DEFAULT '[]', synced_at timestamptz, created_at timestamptz DEFAULT now(), UNIQUE(user_id, shop_domain) ); ALTER TABLE shopify_stores ENABLE ROW LEVEL SECURITY; CREATE POLICY IF NOT EXISTS "Users manage own stores" ON shopify_stores FOR ALL USING (auth.uid() = user_id) WITH CHECK (auth.uid() = user_id);
2
Maak jezelf admin
Vul je SETUP_SECRET in (uit je .env.local). Hierna heb je toegang tot het Admin panel op /dashboard/admin.
3
Credentials instellen
Na stap 2 kun je in het Admin panel de Shopify Client ID & Secret instellen. Dit is alleen nodig als je ze niet in .env.local hebt staan.
4
Bestaande stores migreren
Al een Shopify store gekoppeld maar ziet hij nergens? Klik hieronder om bestaande koppelingen vanuit je account naar de database te synchroniseren.