Skip to content

juddlyon/mfgpath

Repository files navigation

MFG PATH

Get visitors where they need to be. Fast.

A wayfinding platform for industrial/manufacturing companies. Build Paths that route website visitors to the right salesperson, product, resource, or distributor based on their answers and location.

Quick Start

git clone https://github.com/juddlyon/mfgpath.git
cd mfgpath
npm install
npx drizzle-kit push --force
npm run dev

Open http://localhost:5173

Seed Demo Data

# With dev server running in another terminal
npx tsx scripts/seed-geo-demo.ts

Creates a "Find Your Sales Rep" Path with 5 regional reps.

URLs

Page URL
Dashboard http://localhost:5173
Visitor Preview http://localhost:5173/preview/{pathId}
Path Editor http://localhost:5173/finders/{pathId}
Canvas Editor http://localhost:5173/finders/{pathId}/canvas

Concepts

Term What It Is
Path A guided journey (e.g., "Find Your Sales Rep")
Step A question in the Path
Option A choice within a step
Filter Tags for matching (options → destinations)
Destination Endpoint: salesperson, product, resource, distributor

How Matching Works

Visitor answers Steps → Filters collected
Visitor enters zip → Geocoded to lat/lng
Match: Filter overlap + Geo proximity + Priority

Features

  • Visitor Preview: See the flow as visitors will experience it
  • Path Editor: Simple form-based editing of steps and destinations
  • Canvas Editor: Svelte Flow visual graph for complex logic (Zapier-style)
  • Geo Matching: Route by zip code to nearest rep with radius/territory support
  • Filter Matching: Tag-based routing (vertical, product type, etc.)

API

# Get Path config
GET /widget/:pathId

# Match visitor
POST /widget/:pathId
{ "answers": { "vertical": "food-bev" }, "zip": "30315" }

# Response
{ "destination": {...}, "distanceMiles": 2.2, "matchedTags": ["food-bev"] }

Project Structure

src/
├── lib/
│   ├── components/canvas/  # Svelte Flow nodes
│   ├── geo.ts              # Geocoding + distance
│   ├── matcher.ts          # Filter + geo matching
│   └── server/db/          # Drizzle schema
├── routes/
│   ├── +page.svelte        # Dashboard
│   ├── preview/[id]/       # Visitor preview
│   ├── finders/[id]/       # Path editor
│   ├── finders/[id]/canvas # Canvas editor
│   ├── api/finders/        # CRUD APIs
│   └── widget/             # Public widget API
└── scripts/
    └── seed-geo-demo.ts

Commands

npm run dev          # Dev server
npm run build        # Build for production
npm run test         # Run tests (49 passing)
npm run check        # TypeScript check
npx drizzle-kit push # Push schema changes

About

Get website visitors where they need to be. Fast. Wayfinding for industrial companies.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors