Backend, PDF Generation, Auth & Domain Setup
Budget: $30 – $250 USD
Developer: Make "Contractor's Landing" production-ready by Wednesday EOD.
PRIORITY 1 - Backend Setup (Lovable Cloud/Supabase)
Enable Lovable Cloud in project
Run SQL in Supabase SQL Editor:
-- Create role enum
create type public.app_role as enum ('admin', 'warehouse_staff', 'project_manager', 'field_supervisor', 'cfo');
-- User roles table (CRITICAL: separate from profiles)
create table public.user_roles (
id uuid primary key default gen_random_uuid(),
user_id uuid references auth.users(id) on delete cascade not null,
role app_role not null,
unique (user_id, role)
);
alter table public.user_roles enable row level security;
-- Security definer function (prevents privilege escalation)
create or replace function public.has_role(_user_id uuid, _role app_role)
returns boolean language sql stable security definer set search_path = public
as $$ select exists (select 1 from public.user_roles where user_id = _user_id and role = _role) $$;
-- Create profiles, projects, inbound_landings, outbound_landings tables
-- (Full SQL: see attached document)
Enable email/password auth in Supabase Dashboard
PRIORITY 2 - PDF Generation (Client-Side) Install: npm install jspdf jspdf-autotable Implement in src/utils/pdfGenerator.ts for Project/Inbound/Outbound forms
PRIORITY 3 - Auth Implementation
Create /src/pages/Auth.tsx with Supabase auth
Update UserContext to fetch roles from user_roles table
Protect routes with role-based access
PRIORITY 4 - Domain Setup Custom domain via Lovable Settings → DNS A + TXT records
Testing Focus:
Auth flow (signup/login)
PDF generation
Role-based access
All 3 landing forms (CRUD)
Post-Wednesday: Android app (Capacitor), QuickBooks integration
PRIORITY 1 - Backend Setup (Lovable Cloud/Supabase)
Enable Lovable Cloud in project
Run SQL in Supabase SQL Editor:
-- Create role enum
create type public.app_role as enum ('admin', 'warehouse_staff', 'project_manager', 'field_supervisor', 'cfo');
-- User roles table (CRITICAL: separate from profiles)
create table public.user_roles (
id uuid primary key default gen_random_uuid(),
user_id uuid references auth.users(id) on delete cascade not null,
role app_role not null,
unique (user_id, role)
);
alter table public.user_roles enable row level security;
-- Security definer function (prevents privilege escalation)
create or replace function public.has_role(_user_id uuid, _role app_role)
returns boolean language sql stable security definer set search_path = public
as $$ select exists (select 1 from public.user_roles where user_id = _user_id and role = _role) $$;
-- Create profiles, projects, inbound_landings, outbound_landings tables
-- (Full SQL: see attached document)
Enable email/password auth in Supabase Dashboard
PRIORITY 2 - PDF Generation (Client-Side) Install: npm install jspdf jspdf-autotable Implement in src/utils/pdfGenerator.ts for Project/Inbound/Outbound forms
PRIORITY 3 - Auth Implementation
Create /src/pages/Auth.tsx with Supabase auth
Update UserContext to fetch roles from user_roles table
Protect routes with role-based access
PRIORITY 4 - Domain Setup Custom domain via Lovable Settings → DNS A + TXT records
Testing Focus:
Auth flow (signup/login)
PDF generation
Role-based access
All 3 landing forms (CRUD)
Post-Wednesday: Android app (Capacitor), QuickBooks integration
Related categories:
PHP
JavaScript
SQL
Software Architecture
MySQL
Backend Development
Database Management
API Development