# Leads4Less Leads4Less is a React + Vite app for finding local business leads, saving them in Supabase, and browsing them in dashboard and map views. ## Stack - React 19 + Vite - Supabase Auth + Postgres + Edge Functions - Google Maps Platform for maps, geocoding, and Places search ## Local App Setup 1. Install dependencies: `npm install` 2. Copy `.env.example` to `.env.local` and fill in: - `VITE_SUPABASE_URL` - `VITE_SUPABASE_ANON_KEY` - `VITE_GOOGLE_MAPS_PLATFORM_KEY` 3. Run the app: `npm run dev` ## Supabase Setup 1. Create a Supabase project. 2. Enable email/password auth in Supabase Auth. 3. Apply the SQL migration in `supabase/migrations/20260322120000_init.sql`. 4. Deploy the Edge Function in `supabase/functions/run-search/index.ts`. 5. Set these Edge Function secrets in Supabase: - `SUPABASE_URL` - `SUPABASE_ANON_KEY` - `SUPABASE_SERVICE_ROLE_KEY` - `GOOGLE_MAPS_SERVER_KEY` ## Google Maps Requirements Enable these Google Cloud APIs for the keys you use: - Maps JavaScript API - Places API - Geocoding API Use a browser-restricted key for `VITE_GOOGLE_MAPS_PLATFORM_KEY` and a server-side key for `GOOGLE_MAPS_SERVER_KEY`. ## Current Flow 1. User signs in with Supabase email/password auth. 2. The app submits a search request to the `run-search` Edge Function. 3. The function geocodes the location, calls Google Places, upserts businesses, and stores job results in Supabase. 4. The dashboard and map load saved leads from Postgres.