🔗 Concept Map
🌳 Roadmap Tree
⚙️ Capabilities Brace

Concept Map — System Architecture & Relationships

All systems, data stores, and external services with labeled data flows

ARS CRM
ars-crm.xyz · Next.js 15
Cloudflare D1
ars-prospect-crm-db · 23MB · 16 migrations
Cloudflare R2
ars-roof-ortho-tiles
Canvass PWA
ars-canvass.pages.dev · Offline-first
Sync Worker
ars-canvass-sync · Bearer auth · Redundant
⚠️ Scoring Engine
scoring.ts · P0 bug · +2 inflation
Storm War Room
/storm-tracker · Admin-gated
Gemini Vision
Gemini 3 Flash · Agentic · Code exec
ArcGIS REST
County parcels · 1.4M+ · Free · No auth
NOAA Storms
Hail · Wind · Tornado events
⚠️ AccuLynx API
5,022 jobs · 0 rows imported
BatchData
Phone enrichment · Key pending
prospect_leads
28,910 rows · B/C/D/F grades
⚠️ permits table
20,378 rows · ALL property_id NULL
Root / Platform
Infrastructure
Live / Working
Broken / Bug
Partial / Redundant
Pending / Blocked

Roadmap Tree — Initiatives → Tiers → Features

Click any section to expand. Color = status. Effort estimates in gray.

🏠 ARS CRM Platform
📊 Current Build State
🟢 Live & Working DEPLOYED
🏠
ARS CRM — ars-crm.xyz
Next.js 15 + @opennextjs/cloudflare + D1 + R2 + NextAuth. CF Pages. Edge-rendered.
📱
Canvass PWA — ars-canvass.pages.dev
Offline-first field app. PIN auth. Leaflet maps. localStorage sync queue with exponential backoff.
📊
Dashboard + Prospects Table
28,910 leads. Grade filter (B/C/D/F). Pitch lane filter. Individual lead detail pages.
🗺️
Parcel Map
Leaflet + CARTO Dark Matter. ArcGIS county tiles. Property markers with score overlays.
⛈️
Storm War Room
Admin-gated. NOAA events. Zone drawing. Campaign management. Field brief generation → Canvass app.
🤖
Gemini Vision AI (P3 Scoring)
Agentic Think-Act-Observe loop. Roof condition scoring from ortho tiles. Batch API for 50+ properties.
🛣️
Roof Intelligence — 17 API routes
analyze, batch-*, lidar-pitch, measure, ortho-tile, risk-signals, generate-report.
🔄
5-Pillar ARS Scoring System
P1 Wealth + P2 Roof Age + P3 Condition + P4 Ownership + P5 Multi. Grade cutoffs B/C/D/F.
🗂️
Pipeline Kanban
new → contacted → qualified → proposal → closed. Operates on legacy leads table.
🔴 Broken / Bugs P0 BUGS
⚠️
Permit Join — ALL 20,378 rows have NULL property_id
Properties use ArcGIS 11-digit IDs. Permits use dashed county format. Formats incompatible. Fix: address-based matching in migration 0016.
⚠️
Score inflation — every lead gets fake +2 bonus
noRoofPermit15PlusYears fires TRUE for all leads because permit join is broken. Grade B leads NOT fully trustworthy.
⚠️
Sandbox API — no middleware auth
Executes arbitrary JS. Batch API key in plaintext in wrangler.toml (in git history).
⚠️
AccuLynx — 0 rows imported
Corrupted Excel source. REST implementation exists. Needs re-pull from live API.
⚠️
Dual sync paths — no single source of truth
Canvass app writes to BOTH canvass_checkins (via CRM) AND prospect_leads (via sync worker). No coordination.
🟡 Empty / Schema Ready NOT POPULATED
📐
roof_measurements — 0 rows
EagleView-equivalent schema. Needs SEMCOG building footprint pipeline.
📞
Phone enrichment — 107/28,910 have phones
BatchData API key not yet received. 5-tier waterfall pipeline designed but not built.
🔄
Canvass Sync Worker — partially redundant
123-line worker. /api/storm/sync already covers most of its logic. Planned for deprecation.
🗺️ Roadmap — 6 Tiers
🔥 Tier 1 — Build Now (This Week) CRITICAL PATH
🔧
Migration 0016 — Permit address matching
Add address_normalized columns. Fuzzy-match permits → properties. Fix scoring.ts:90. Full rescore of all 28,910 leads. Expected match rate 50-70%.
2-3 days
🔑
Rotate batch API key
Remove from wrangler.toml. Move to wrangler secret put. Rotate the value — current one is in git history.
15 min
🔀
Collapse dual sync paths
Deprecate canvass-sync-worker. Absorb pipeline_status update into /api/storm/sync. Delete worker repo.
1-2 days
📥
AccuLynx REST re-import
POST to /api/acculynx/import. Verify ACCULYNX_API_KEY env var in production. Will populate 0-row table.
2 hours
📇
Add (address, city) index on properties
Full table scan on 28,911 rows per canvass event. Hard blocker at 200K+ properties.
30 min
🔒 Tier 2 — Awaiting External Keys BLOCKED
📞
BatchData phone enrichment
5-tier waterfall: PDL → TruePeopleSearch → FastPeopleSearch → 411.com → BatchData. Currently 107/28,910 have phones.
Blocked on API key
🏷️
GoNano flag + badge
Flag leads where roof permit was pulled within last 2 years (new roof). Special badge in prospects table for upsell targeting.
1 day
🤖
GoNano V2 prompt refinement
Updated Gemini prompt for GoNano (new roof upsell) scoring. Separate from damage-focused P3 prompt.
1 day
🏗️ Tier 3 — New Data Pipelines ROADMAP
🏛️
BS&A Michigan-wide permit scraper
Michigan-wide building permits. Fallback for counties without ArcGIS. Fixes the permit join at source.
1 week
🏠
SEMCOG building footprints
Southeast Michigan Council of Governments footprint data. Needed to populate roof_measurements table.
3-5 days
🗺️
Expand county coverage
Currently: Ottawa, Kent, Wayne, Jackson, Lucas (OH). Target: all Michigan lower peninsula. ~1M+ more parcels.
2-3 days
📐 Tier 4 — Measurement Tools ROADMAP
📏
Roof squares calculator
Calculate roof area from parcel footprint + LiDAR pitch estimate. Populate roof_measurements.sloped_area_sqft.
3-4 days
📄
EagleView PDF parser
Parse EagleView measurement reports (PDF) into structured roof_measurements rows.
2-3 days
💼 Tier 5 — Sales Enablement ROADMAP
📱
Rep mobile view
Dedicated mobile-optimized view for sales reps. Lead list, map, quick status updates.
1 week
📋
Outreach log UI
UI for logging calls, texts, door knocks against a lead. Feeds outreach_log table (schema exists).
2-3 days
🔁
AccuLynx auto-push on close
Automatically push closed/signed leads from CRM to AccuLynx job creation via API v2.
2 days
💬
GoNano quote generator
Generate automated quote narratives for GoNano (new roof upsell) leads using Gemini.
2-3 days
🚀 Tier 6 — Advanced / Future FUTURE
🔍
Temporal change detection
Compare 2023 vs 2025 ortho tiles per property. Detect roof changes, new construction, storm damage onset.
1-2 weeks
⛈️
Storm hit scoring overlay
Real-time storm event → property score boost. Automatic re-prioritization when a storm hits a zone.
1 week
📡
Canvass app live D1 data
Replace static JSON files in canvass app with live D1 queries via CRM API. Real-time property data in field.
3-4 days
🗺️
Route optimizer
TSP-based route optimization for field reps. Given campaign zone + rep location, generate optimal door-knock sequence.
1-2 weeks

Capabilities Brace Map — What the Platform Does

Core platform capabilities grouped by domain. Color = health status.

🏠 ARS CRM

Arrow Roofing Services
Property Intelligence Platform

🗄️ Data Layer
LIVE Cloudflare D1 Database
SQLite. 23MB. 16 migrations. 15+ tables. Shared across all 3 systems. Viable to 200K+ rows.
LIVE ArcGIS Parcel Ingestion
28,911 properties. Ottawa, Kent, Wayne, Jackson, Lucas counties. Free REST API. No auth required.
LIVE NOAA Storm Events
Hail, wind, tornado events. Used for recentStormInArea signal (+3 pts, 12-month window).
LIVE Cloudflare R2 — Ortho Tiles
Aerial imagery storage. 2023 + 2025 tile URLs cached per property. Used by Gemini vision analysis.
BROKEN Permit Data
20,378 rows exist but ALL property_id = NULL. Address-based matching fix pending (migration 0016).
BLOCKED Phone Enrichment
107/28,910 have phones. BatchData API key pending. 5-tier waterfall pipeline designed, not built.
🎯 Lead Scoring Engine
P0 BUG 7-Signal Legacy Scoring
roofAge20Plus (+3), roofAge15to20 (+1), noRoofPermit15Yrs (+2 — FAKE), recentStorm (+3), recentReno (+2), recentSaleRefi (+1), steepPitch (+1). Max 12pts.
LIVE 5-Pillar ARS Composite Score
P1 Wealth + P2 Roof Age + P3 Condition + P4 Ownership + P5 Multi. 0-100. Grades: B (3,225) / C (2,527) / D (3,726) / F (19,432).
LIVE Pitch Lane Classification
OLD_ROOF (98% — 28,374 leads) · NEW_ROOF (GoNano upsell) · GRAY (undecided). Drives sales talk track.
LIVE Gemini P3 Vision Scoring
Agentic aerial analysis. Damage markers, granule loss, deflection, moss, age. Think-Act-Observe loop. Scores stored in properties.p3_aerial_*.
PENDING GoNano V2 Scoring
Separate Gemini prompt for new-roof upsell leads. Flag + badge on Grade B leads. Awaiting prompt refinement.
🚪 Field Operations
LIVE Canvass PWA
Offline-first mobile app. Leaflet property map. PIN auth. Door-knock status (home/not-home/signed/refused). localStorage queue with backoff.
LIVE Storm Campaign Push (Track B)
War Room generates field-brief JSON → Canvass app loads campaign targets. Rep sees prioritized property list for their zone.
LIVE Visit Sync (Track C)
Canvass checkins → /api/storm/sync → canvass_checkins table. Idempotent by client_id. X-Sync-Secret auth.
REDUNDANT Canvass Sync Worker
Parallel sync path writing to prospect_leads + notes. 123-line CF Worker. Planned for deprecation — absorbed by /api/storm/sync.
ROADMAP T6 Live D1 Data in Canvass
Replace static JSON files with live API queries. Real-time property scores, checkin history, rep assignments in field.
💼 Sales Tools
LIVE Pipeline Kanban
Drag-and-drop stages: new → contacted → qualified → proposal → closed. Operates on legacy leads table.
LIVE Prospect Lead Detail Pages
Per-property view: score breakdown, owner info, permit history, storm proximity, Gemini analysis.
EMPTY AccuLynx Integration
5 API routes + 4 UI pages exist. Table has 0 rows. Re-import from live AccuLynx REST API will unlock pipeline sync.
ROADMAP T5 Outreach Log UI
Log calls, texts, door knocks per lead. outreach_log table schema exists, no UI built.
ROADMAP T5 AccuLynx Auto-Push
On close/sign, auto-create job in AccuLynx via API v2. Eliminate manual data entry for reps.
ROADMAP T6 Route Optimizer
TSP-based door-knock sequence generator. Given campaign zone + rep start location, output optimal drive order.
⚙️ Admin & Infrastructure
LIVE Storm War Room
Admin-gated (2 hardcoded emails). NOAA overlay, zone drawing, campaign CRUD, event audit log.
LIVE NextAuth — Credentials Auth
Email/password auth. withAuth middleware. Admin role gating. Session cookies.
LIVE Roof Intelligence Batch API
17 routes. Async Gemini batch processing. Batch key bypass for programmatic access. Pending: Gemini 3 Flash upgrade deploy.
P0 SECURITY Sandbox API
Executes arbitrary JS. Excluded from middleware auth. Batch key in git history. Fix: wrangler secrets + rotate key immediately.
ROADMAP Role-Based Admin Access
Currently hardcoded email whitelist. Replace with database role system. Needed for onboarding more admins.
🚨 Critical Risks & Blockers
P0 Score inflation on every lead
noRoofPermit15PlusYears fires TRUE for all 28,910 leads. Hot/warm threshold shift: 6→8 promotes warm leads to hot. Grade B list unreliable.
P0 Sandbox API key in git
BATCH_API_KEY plaintext in wrangler.toml. Git history. Anyone with repo access can execute arbitrary code. Rotate today.
P1 No (address, city) index
Full table scan per canvass event. Hard performance blocker at 200K+ properties. 30-min fix.
P1 Sync worker — silent data loss
No retry/queue. D1 unavailable → 500 error. Reps' field data lost. Fix: deprecate worker, use CRM sync route.
P2 Canvass PIN hardcoded in JS
All rep PINs visible in page source. Changing a PIN requires a full deploy. Low priority until other P0s fixed.
P3 Zero test coverage
No unit tests. Scoring engine (drives revenue decisions on 28K leads), sync worker upsert, and all API routes are untested.