BudgetView requires specific database tables and RLS policies. You have two options:
Option A: SQL Editor (Recommended)
Option B: Automatic Migration
Execute the schema creation script in Supabase SQL Editor:
Go to SQL Editor in your Supabase dashboard
Click “New query”
Run the following SQL to create required tables:
-- Create users table (extends Supabase auth.users)CREATE TABLE IF NOT EXISTS public.usuarios ( id UUID PRIMARY KEY REFERENCES auth.users(id) ON DELETE CASCADE, created_at TIMESTAMPTZ DEFAULT NOW());-- Create wallets tableCREATE TABLE IF NOT EXISTS public.billeteras ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), usuario_id UUID REFERENCES public.usuarios(id) ON DELETE CASCADE, nombre TEXT NOT NULL, created_at TIMESTAMPTZ DEFAULT NOW());-- Create categories tableCREATE TABLE IF NOT EXISTS public.categorias ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), usuario_id UUID REFERENCES public.usuarios(id) ON DELETE CASCADE, nombre TEXT NOT NULL, tipo TEXT CHECK (tipo IN ('ingreso', 'gasto')), created_at TIMESTAMPTZ DEFAULT NOW());-- Create transactions tableCREATE TABLE IF NOT EXISTS public.transacciones ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), usuario_id UUID REFERENCES public.usuarios(id) ON DELETE CASCADE, billetera_id UUID REFERENCES public.billeteras(id) ON DELETE CASCADE, categoria_id UUID REFERENCES public.categorias(id) ON DELETE SET NULL, monto NUMERIC(12, 2) NOT NULL, tipo TEXT CHECK (tipo IN ('ingreso', 'gasto')), descripcion TEXT, fecha_transaccion TIMESTAMPTZ NOT NULL, created_at TIMESTAMPTZ DEFAULT NOW());-- Create budgets tableCREATE TABLE IF NOT EXISTS public.presupuestos ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), usuario_id UUID REFERENCES public.usuarios(id) ON DELETE CASCADE, categoria_id UUID REFERENCES public.categorias(id) ON DELETE CASCADE, monto NUMERIC(12, 2) NOT NULL, periodo TEXT, created_at TIMESTAMPTZ DEFAULT NOW());-- Enable Row Level SecurityALTER TABLE public.billeteras ENABLE ROW LEVEL SECURITY;ALTER TABLE public.categorias ENABLE ROW LEVEL SECURITY;ALTER TABLE public.transacciones ENABLE ROW LEVEL SECURITY;ALTER TABLE public.presupuestos ENABLE ROW LEVEL SECURITY;-- Create RLS policiesCREATE POLICY "Users can view own wallets" ON public.billeteras FOR SELECT USING (auth.uid() = usuario_id);CREATE POLICY "Users can insert own wallets" ON public.billeteras FOR INSERT WITH CHECK (auth.uid() = usuario_id);CREATE POLICY "Users can update own wallets" ON public.billeteras FOR UPDATE USING (auth.uid() = usuario_id);CREATE POLICY "Users can delete own wallets" ON public.billeteras FOR DELETE USING (auth.uid() = usuario_id);-- Repeat similar policies for categorias, transacciones, and presupuestos
Click “Run” to execute the script
BudgetView can create tables automatically on first run if your Supabase user has the necessary permissions.
This method is not recommended for production. Always review and control your database schema.
▲ Next.js 16.0.3- Local: http://localhost:3000- Network: http://192.168.1.100:3000✓ Ready in 2.3s
The development server starts on port 3000 by default. If this port is in use, Next.js will automatically try the next available port (3001, 3002, etc.).
Solution: Ensure you’re using compatible Node.js and npm versions.
node -v # Should be 18.x or highernpm -v # Should be 9.x or higher
Update if necessary:
npm install -g npm@latest
Supabase connection timeout
Causes:
Network firewall blocking Supabase API
Corporate proxy interfering
Supabase project paused (free tier inactivity)
Solutions:
Check Supabase project status in dashboard
Verify internet connection
Test Supabase connectivity:
curl https://your-project-id.supabase.co
Check for proxy settings that need configuration
Database schema errors
Solution: Re-run the database migration SQL.
Go to Supabase SQL Editor
Delete existing tables (if present):
DROP TABLE IF EXISTS public.presupuestos CASCADE;DROP TABLE IF EXISTS public.transacciones CASCADE;DROP TABLE IF EXISTS public.categorias CASCADE;DROP TABLE IF EXISTS public.billeteras CASCADE;
Re-run the complete schema creation SQL from Step 3
{ "scripts": { "dev": "next dev", // Start development server with hot-reload "build": "next build", // Create production build "start": "next start", // Start production server "lint": "eslint" // Run ESLint code quality checks }}
Usage examples:
# Developmentnpm run dev# Production build and startnpm run buildnpm start# Code quality checknpm run lint
Use npm run dev during development for instant feedback. Only run npm run build when preparing for deployment or testing production behavior.