a1ba5ee0932f0f96dc9a55ae34a101d200ddc300
Replace Supabase auth and search runtime with a local Fastify API, PostgreSQL/PostGIS schema, and local session handling. Scaffold the worker and deep-research foundations while keeping the existing research, dashboard, and map flows running on the new backend.
Leads4Less
Leads4Less is a React + Vite app for finding local business leads, saving them in Postgres, and browsing them in dashboard and map views.
Stack
- React 19 + Vite
- Local Fastify API + pg-boss worker
- PostgreSQL + PostGIS
- Google Maps Platform for browser maps and Places search
Local App Setup
- Install dependencies:
npm install - Copy
.env.exampleto.env.localand fill in at least:VITE_GOOGLE_MAPS_PLATFORM_KEYDATABASE_URLCOOKIE_SECRETGOOGLE_MAPS_SERVER_KEY
- Run the frontend:
npm run dev:web
Local API Setup
- Ensure PostgreSQL is running locally with PostGIS available.
- Apply the local database migrations:
npm run migrate - Start the API:
npm run dev:api - Start the worker:
npm run dev:worker
Database Layout
db/migrations/0001_local_core.sqlcreates the local-first schema.db/scripts/migrate.tsapplies migrations in order and records them inschema_migrations.db/scripts/seed-postal-placeholder.tsis a placeholder for ZIP/ZCTA and Canada FSA imports.
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 Runtime Flow
- The React app authenticates through the local Fastify API using cookie-backed sessions.
- Search requests run through the local API and persist results in PostgreSQL.
- The worker foundation is available for asynchronous job execution and deep research expansion.
- The target architecture is fully local auth + Fastify routes + pg-boss workers + PostgreSQL/PostGIS.
Description
Languages
TypeScript
98.3%
PLpgSQL
1.3%
Dockerfile
0.2%
HTML
0.1%