Configuración inicial — solo necesitas hacerlo una vez
⚡ Sigue estos 3 pasos para conectar la base de datos. Después tú y tu socio pueden entrar desde cualquier navegador.
1Crea un proyecto en Supabase (gratis)
Entra en supabase.com → "Start for free" → crea una cuenta → "New Project".
Ponle un nombre (ej: stockapp) y guarda la contraseña que te pide.
2Crea las tablas (copia y pega en el SQL Editor)
En tu proyecto Supabase → menú izquierdo → SQL Editor → "New query" → pega esto y pulsa RUN:
-- Habilitar Row Level Security para autenticación create table productos ( id bigserial primary key, nombre text not null, sku text, cat text, precio numeric default 0, stock integer default 0, minimo integer default 0, desc text, created_at timestamptz default now() ); create table clientes ( id bigserial primary key, nombre text not null, empresa text, email text, tel text, ciudad text, estado text default 'activo', notas text, created_at timestamptz default now() ); create table movimientos ( id bigserial primary key, fecha date default current_date, tipo text, producto_id bigint references productos(id), cantidad integer, cliente_id bigint references clientes(id), nota text, created_at timestamptz default now() ); -- Permitir acceso a usuarios autenticados alter table productos enable row level security; alter table clientes enable row level security; alter table movimientos enable row level security; create policy "Acceso autenticado" on productos for all using (auth.role() = 'authenticated'); create policy "Acceso autenticado" on clientes for all using (auth.role() = 'authenticated'); create policy "Acceso autenticado" on movimientos for all using (auth.role() = 'authenticated');
3Pega tus credenciales aquí
En Supabase → Project Settings → API. Copia la "Project URL" y la "anon public key":
o
Productos
en catálogo
Stock bajo
requieren atención
Clientes
en cartera
Sin stock
agotados
⚠ Stock Crítico
◎ Últimos Clientes
ProductoCat.SKUPrecioStockNivelEstadoAcciones
ClienteEmailTeléfonoEmpresaCiudadEstadoAcciones
FechaTipoProductoCantidadClienteNotaAcciones