A modern, full-featured B2B/B2C lead generation platform built with React 18, client-side search, OpenStreetMap geo-targeting, and Framer Motion animations. Optimized for Horizons browser-based deployment.
- Client-Side Search: Fast, responsive search across leads, packages, and niches (no external API needed)
- Geo-Targeting: Interactive OpenStreetMap with radius slider (10-500km) for location-based lead discovery
- Lead Capture: B2B and B2C lead capture forms with intent scoring
- E-Commerce Style Browsing: Filterable lead packages by industry, niche, budget, and intent score
- Federated Results: Unified search results across multiple collections
- Dashboard: Comprehensive lead management with analytics, export (CSV/JSON), and intent distribution charts
- Dark Theme: Modern dark UI with Tailwind CSS and shadcn/ui components
- Persistent Storage: localStorage-based data persistence
- Frontend: React 18.2.0, React Router 6, TypeScript
- Styling: TailwindCSS 3.3.2, shadcn/ui components, Lucide icons
- Animations: Framer Motion
- Search: Client-side filtering with localStorage
- Maps: Leaflet + React Leaflet + OpenStreetMap
- Charts: Recharts for analytics
- Build: Vite
- Deployment: Horizons-compatible (no Docker, no external APIs)
windsurf-project-2/
βββ src/
β βββ components/
β β βββ ui/
β β β βββ Button.tsx
β β β βββ Input.tsx
β β β βββ Card.tsx
β β β βββ Tabs.tsx
β β βββ InteractiveMap.tsx
β β βββ TypesenseSearch.tsx
β β βββ LeadCaptureForm.tsx
β β βββ LeadPackagesBrowser.tsx
β β βββ LeadsDashboard.tsx
β βββ pages/
β β βββ Home.tsx
β β βββ Search.tsx
β β βββ Packages.tsx
β β βββ Dashboard.tsx
β βββ lib/
β β βββ typesense.ts (Typesense client & utilities)
β β βββ utils.ts (Helper functions & constants)
β βββ App.tsx
β βββ main.tsx
β βββ index.css
βββ Dockerfile
βββ docker-compose.yml
βββ package.json
βββ vite.config.ts
βββ tsconfig.json
βββ tailwind.config.js
βββ postcss.config.js
βββ README.md
- Node.js 18+
- Docker & Docker Compose (for containerized deployment)
- Typesense instance (local or cloud)
-
Clone the repository
cd /Users/oniasbrown/CascadeProjects/windsurf-project-2 -
Install dependencies
npm install
-
Configure environment variables
cp .env.example .env.local
Update
.env.localwith your Typesense credentials:REACT_APP_TYPESENSE_HOST=localhost REACT_APP_TYPESENSE_PORT=8108 REACT_APP_TYPESENSE_PROTOCOL=http REACT_APP_TYPESENSE_API_KEY=xyz -
Start Typesense (if running locally)
docker run -p 8108:8108 -v typesense_data:/data typesense/typesense:latest
-
Start development server
npm run dev
Access at
http://localhost:5173
-
Build and run with Docker Compose
docker-compose up --build
- App:
http://localhost:5173 - Typesense:
http://localhost:8108
- App:
-
Production build
npm run build docker build -t buyer-intent-app . docker run -p 5173:5173 buyer-intent-app
{
"id": "string",
"company_name": "string",
"industry": "string (facet)",
"location": "string (facet)",
"budget": "int32",
"intent_score": "int32 (facet)",
"contact_email": "string",
"contact_phone": "string",
"created_at": "int64"
}{
"id": "string",
"name": "string",
"service_category": "string (facet)",
"location": "string (facet)",
"budget": "int32",
"intent_score": "int32 (facet)",
"email": "string",
"phone": "string",
"created_at": "int64"
}{
"id": "string",
"name": "string",
"industry": "string (facet)",
"niche": "string (facet)",
"price": "int32",
"lead_count": "int32",
"intent_threshold": "int32",
"description": "string",
"created_at": "int64"
}{
"id": "string",
"city": "string (facet)",
"state": "string (facet)",
"country": "string (facet)",
"latitude": "float",
"longitude": "float",
"lead_density": "int32",
"created_at": "int64"
}- Overview of platform features
- Quick links to search, packages, and dashboard
- Call-to-action buttons
Three tabs:
-
Search Tab: Semantic/hybrid search across all collections
- Natural language queries: "HVAC leads Richmond VA"
- Federated results showing leads, packages, case studies
-
Geo-Target Tab: Location-based lead discovery
- Interactive map with click-to-set location
- Radius slider (10-500km)
- Geolocation button
-
Capture Tab: Lead capture forms
- B2B form (company details)
- B2C form (consumer details)
- Auto-calculated intent scores
- Browse pre-curated lead packages
- Filter by industry, budget, intent score
- Sort by rating, price, or lead count
- E-commerce style card layout
- Multi-select and checkout
- Statistics: Total leads, avg intent score, total budget, high-intent count
- Analytics: Intent score distribution chart
- Lead Table: Full lead management with:
- Bulk selection
- Export to CSV/JSON
- View/delete actions
- Intent score color coding
import { searchLeads, addLead, exportLeads } from '@/lib/typesense'
// Search leads
const results = await searchLeads('HVAC Richmond', 'b2b_leads')
// Add new lead
await addLead({
company_name: 'Acme Corp',
industry: 'HVAC',
location: 'Richmond, VA',
budget: 5000,
contact_email: 'contact@acme.com',
contact_phone: '+1 (555) 123-4567'
}, 'b2b_leads')
// Export leads
const csv = await exportLeads('b2b_leads', 'csv')<InteractiveMap
onLocationChange={(lat, lon, radius) => {
console.log(`Location: ${lat}, ${lon}, Radius: ${radius}km`)
}}
initialLat={37.7749}
initialLon={-122.4194}
initialRadius={50}
/>Edit src/index.css CSS variables:
:root {
--background: 0 0% 3.6%;
--foreground: 0 0% 98%;
--primary: 0 84.2% 60.2%;
/* ... more colors ... */
}Update src/lib/utils.ts:
export const INDUSTRIES = [
'HVAC', 'Plumbing', 'Electrical', 'Roofing',
// Add more...
]npm run buildOutput: dist/ directory
- Build the application
- Use provided Dockerfile
- Push to container registry
- Deploy via Hostinger dashboard
- Set environment variables in deployment settings
REACT_APP_TYPESENSE_HOST=your-typesense-host.com
REACT_APP_TYPESENSE_PORT=443
REACT_APP_TYPESENSE_PROTOCOL=https
REACT_APP_TYPESENSE_API_KEY=your_production_key
- API keys stored in environment variables (never in code)
- HTTPS recommended for production
- Typesense API key should be restricted to read-only operations
- CORS configured for allowed origins
- Input validation on all forms
- Code splitting with React Router
- Lazy loading of components
- Memoization of expensive computations
- Image optimization
- CSS minification via Tailwind
- JavaScript minification via Vite
- Verify Typesense is running:
http://localhost:8108/health - Check API key in
.env.local - Ensure CORS is enabled if using cloud Typesense
- Verify Leaflet CSS is loaded in
index.html - Check browser console for errors
- Ensure OpenStreetMap tiles are accessible
- Verify collections are initialized
- Check Typesense API key
- Ensure data is indexed in Typesense
MIT License - feel free to use for commercial projects
For issues or questions:
- Check the troubleshooting section
- Review Typesense documentation: https://typesense.org/docs/
- Check React Router docs: https://reactrouter.com/
- Leaflet docs: https://leafletjs.com/
- Real-time lead notifications
- Advanced analytics dashboard
- CRM integration (Salesforce, HubSpot)
- Email campaign builder
- A/B testing for lead capture forms
- Mobile app (React Native)
- AI-powered lead scoring
- Webhook support for integrations
- Multi-language support
- Advanced permission system
Built with β€οΈ for lead generation professionals