Inserisci le credenziali Supabase una sola volta. Dopo il salvataggio verrà scaricato automaticamente il file index.html già configurato — caricalo su Cloudflare e il sito funzionerà per tutti senza dover riconfigurare.
1
Crea account Supabase
Vai su supabase.com → Sign up gratis → New Project. Metti il nome "simparts" e una password sicura. Aspetta ~2 minuti che si avvii.
2
Crea le tabelle
Nel tuo progetto Supabase → clicca SQL Editor → New Query → incolla questo codice → clicca Run:
-- Copia tutto questo SQL e incollalo in Supabase → SQL Editor
create table products (
id bigint primary key generated always as identity,
name text not null,
description text,
price text,
stock text default 'av',
badge text,
photos jsonb default '[]',
print_notes text,
links jsonb default '[]',
variants text default '[]',
faqs text default '[]',
created_at timestamptz default now()
);
-- Se il DB esiste già , aggiungi solo la colonna faqs:
-- ALTER TABLE products ADD COLUMN IF NOT EXISTS faqs text default '[]';
create table orders (
id bigint primary key generated always as identity,
customer_name text,
customer_phone text,
items jsonb,
total numeric,
note text,
status text default 'in-sospeso',
created_at timestamptz default now()
);
create table reviews (
id bigint primary key generated always as identity,
product_id bigint,
product_name text,
customer_name text,
rating int,
content text,
approved boolean default false,
created_at timestamptz default now()
);
create table expenses (
id bigint primary key generated always as identity,
description text,
amount numeric,
category text,
date date default current_date,
created_at timestamptz default now()
);
create table sales (
id bigint primary key generated always as identity,
product_name text,
amount numeric,
note text,
date date default current_date,
created_at timestamptz default now()
);
alter table products enable row level security;
alter table orders enable row level security;
alter table reviews enable row level security;
alter table expenses enable row level security;
alter table sales enable row level security;
create table customer_setups (
id bigint primary key generated always as identity,
customer_name text,
location text,
description text,
photo_url text,
products_used jsonb default '[]',
approved boolean default false,
created_at timestamptz default now()
);
create table waitlist (
id bigint primary key generated always as identity,
product_id bigint,
product_name text,
email text,
created_at timestamptz default now()
);
create table discount_codes (
id bigint primary key generated always as identity,
code text unique not null,
type text default 'percent',
value numeric not null,
max_uses integer,
uses integer default 0,
expires_at timestamptz,
active boolean default true,
created_at timestamptz default now()
);
alter table products enable row level security;
alter table orders enable row level security;
alter table reviews enable row level security;
alter table expenses enable row level security;
alter table sales enable row level security;
alter table customer_setups enable row level security;
alter table waitlist enable row level security;
alter table discount_codes enable row level security;
create policy "public access" on products for all using (true) with check (true);
create policy "public access" on orders for all using (true) with check (true);
create policy "public access" on reviews for all using (true) with check (true);
create policy "public access" on expenses for all using (true) with check (true);
create policy "public access" on sales for all using (true) with check (true);
create policy "public access" on customer_setups for all using (true) with check (true);
create policy "public access" on waitlist for all using (true) with check (true);
create policy "public access" on discount_codes for all using (true) with check (true);
-- â•â•â•â• v38: Account Clienti â•â•â•â•
-- Profili clienti (linked a auth.users)
create table if not exists customer_profiles (
id uuid primary key references auth.users(id) on delete cascade,
first_name text,
last_name text,
phone text,
created_at timestamptz default now()
);
alter table customer_profiles enable row level security;
create policy "Utente vede solo il proprio profilo" on customer_profiles
for all using (auth.uid() = id);
-- Carrello persistente
create table if not exists customer_carts (
user_id uuid primary key references auth.users(id) on delete cascade,
cart_json jsonb default '{}',
updated_at timestamptz default now()
);
alter table customer_carts enable row level security;
create policy "Utente gestisce solo il proprio carrello" on customer_carts
for all using (auth.uid() = user_id);
-- Wishlist persistente
create table if not exists customer_wishlists (
user_id uuid primary key references auth.users(id) on delete cascade,
product_ids jsonb default '[]',
updated_at timestamptz default now()
);
alter table customer_wishlists enable row level security;
create policy "Utente gestisce solo la propria wishlist" on customer_wishlists
for all using (auth.uid() = user_id);
-- Aggiunta colonne tracking alla tabella orders (v39 — se non già presenti)
alter table orders add column if not exists tracking_code text;
alter table orders add column if not exists carrier text;
alter table orders add column if not exists shipped_at timestamptz;
alter table orders add column if not exists delivered_at timestamptz;
-- â•â•â•â• v40: Q&A Prodotti + Foto Recensioni â•â•â•â•
-- Q&A prodotti
create table if not exists product_qa (
id bigserial primary key,
product_id bigint not null,
question text not null,
asked_by_name text,
asked_by_user_id uuid references auth.users(id),
answer text,
answered_at timestamptz,
created_at timestamptz default now()
);
alter table product_qa enable row level security;
create policy "Chiunque può leggere Q&A" on product_qa for select using (true);
create policy "Utenti autenticati possono fare domande" on product_qa for insert with check (true);
-- Foto nelle recensioni
alter table reviews add column if not exists photos jsonb default '[]';
-- â•â•â•â• v41: Categoria prodotti â•â•â•â•
alter table products add column if not exists category text;
-- â•â•â•â• v50: Operatività â•â•â•â•
create table if not exists admin_log (
id bigserial primary key,
action text not null,
details jsonb,
admin_name text,
created_at timestamptz default now()
);
alter table admin_log enable row level security;
create policy if not exists "Solo admin legge log" on admin_log for select using (true);
create policy if not exists "Inserimento log" on admin_log for insert with check (true);
-- â•â•â•â• v49: Promozioni & Marketing â•â•â•â•
create table if not exists flash_sales (
id bigserial primary key,
product_id bigint not null,
discount_percent integer not null,
starts_at timestamptz not null,
ends_at timestamptz not null,
active boolean default true,
created_at timestamptz default now()
);
alter table flash_sales enable row level security;
create policy if not exists "Chiunque legge flash sales" on flash_sales for select using (true);
create policy if not exists "Admin crea flash sales" on flash_sales for insert with check (true);
create policy if not exists "Admin modifica flash sales" on flash_sales for update using (true);
-- â•â•â•â• v48: Gestione Clienti â•â•â•â•
alter table customer_profiles add column if not exists blacklisted boolean default false;
-- â•â•â•â• v47: Analytics Avanzate â•â•â•â•
-- (nessuna tabella aggiuntiva — usa dati già presenti in orders, sales, products)
-- â•â•â•â• v46: Gestione Ordini Avanzata â•â•â•â•
alter table orders add column if not exists admin_note text;
alter table orders add column if not exists status_log jsonb default '[]';
-- â•â•â•â• v45: Gestione Prodotti Avanzata â•â•â•â•
alter table products add column if not exists sort_order integer default 0;
alter table products add column if not exists tags jsonb default '[]';
alter table products add column if not exists cost text;
alter table products add column if not exists featured boolean default false;
-- â•â•â•â• v43: Notifiche â•â•â•â•
create table if not exists notifications (
id bigserial primary key,
user_id uuid references auth.users(id),
title text not null,
body text,
type text default 'info',
read boolean default false,
created_at timestamptz default now()
);
alter table notifications enable row level security;
create policy if not exists "Clienti vedono proprie notifiche" on notifications for select using (auth.uid() = user_id);
create policy if not exists "Aggiornamento lettura" on notifications for update using (auth.uid() = user_id);
create policy if not exists "Inserimento notifiche" on notifications for insert with check (true);
-- â•â•â•â• v42: Programma Fedeltà â•â•â•â•
create table if not exists loyalty_points (
id bigserial primary key,
user_id uuid not null references auth.users(id),
order_id bigint,
points integer not null,
type text not null,
note text,
created_at timestamptz default now()
);
alter table loyalty_points enable row level security;
create policy if not exists "Clienti vedono i propri punti" on loyalty_points for select using (auth.uid() = user_id);
create policy if not exists "Inserimento punti" on loyalty_points for insert with check (true);
-- ════ v62: Impostazioni Negozio ════
create table if not exists settings (
key text primary key,
value jsonb,
updated_at timestamptz default now()
);
alter table settings enable row level security;
create policy if not exists "Tutti leggono settings" on settings for select using (true);
create policy if not exists "Admin modifica settings" on settings for all using (true) with check (true);
3
Inserisci le credenziali
Nel progetto Supabase → Project Settings → API. Copia Project URL e anon public key.
🔧 Manutenzione in corso
ðŸŽï¸
Stiamo lavorando
Il sito sarà di nuovo disponibile a breve. Ci scusiamo per il disagio.
Banner arancione visibile a tutti — per presentazioni a clienti
🔇
White Label
Nasconde il branding SimParts e il "Powered by"
🛍
Mostra Tab "Setup Clienti"
Visibilità della sezione setup nella navigazione pubblica
📤
Esporta per Cliente
Genera l'HTML preconfigurato
Scarica un file nomenegozio-simparts-v64.html già configurato con le credenziali Supabase e le impostazioni del negozio. Caricalo su Cloudflare Pages o Netlify con drag & drop.
Il file si autoconfigura al primo caricamento — zero setup richiesto
âš Seleziona una variante prima di aggiungere al carrello.
Recensioni
Lascia una recensione
Le recensioni vengono approvate prima di essere pubblicate.
â“ Domande frequenti
Condividi:
Visti di recente
⚖ Confronta
⚖ Confronto Prodotti
✕
Aggiungi Prodotto
✕
📷Aggiungi
Prima foto = copertina. ✕ per rimuovere.
Aggiungi varianti per colore, materiale o finitura. Il prezzo della variante sovrascrive il prezzo base. Se aggiungi varianti, il cliente deve selezionarne una prima di aggiungere al carrello.
Scrivi le domande più comuni dei clienti con la relativa risposta. Verranno mostrate nella pagina prodotto come accordion.
📦 Riepilogo Ordine
✕
Spedizione stimata:
Calcolo consegna stimata in corso...
👤 Account Cliente
✕
Registrandoti accetti i termini di utilizzo.
🔠Accesso Venditore
✕
🔒 Password errata. Riprova.
🌠Pubblica il sito
✕
Come funziona: scarichi il file HTML già configurato con le tue credenziali Supabase. I clienti vedono i prodotti dal database in tempo reale. Gli ordini arrivano via WhatsApp e appaiono nella tab Ordini.
Per caricare online (gratis):
1. Vai su netlify.com → registrati
2. Trascina il file scaricato nella pagina
3. Sito online in 30 secondi ✓
Ogni volta che vuoi aggiornare il sito, riscarica il file e ricaricalo su Netlify.