How markrotar1000-code/windowsbyclearveiw works
Clearview Windows combines a public marketing and lead-intake site with a phone-first internal quoting and operations platform, plus a customer-facing assistant. The main business workflow is estimate intake through internal lead handling, quote/signature, job operations, and follow-up; the internal analytics helper describes the sales stages through collected revenue. Public pages and many internal screens are documented but not present in the supplied tree, so their implementation is not separately mapped. Edges reflect the excerpts, SOURCE INDEX references, or README; unsampled integrations are omitted.
Main entry points: chat.js Ask chat API · estimate.js Estimate endpoint · index.js Scheduled worker · backup.mjs D1 backup
Components 27
Public experience
- Marketing content
src/data/site.ts
Lead intake
- Estimate endpoint
functions/api/estimate.js - Lead service tagging
functions/_lib/lead-service.mjs - Lead storage
functions/_lib/lead-service.mjs - Lead alerts
functions/_lib/lead-alert.mjs
Customer assistant
- Ask chat API
functions/ask/api/chat.js - Intent routing
functions/ask/_lib/icm-router.mjs - Specialist prompts
functions/ask/_lib/icm-specialists.mjs - Answer tools
functions/ask/_lib/tools.mjs - Guide embeddings
functions/ask/_lib/embeddings.mjs - Photo analysis
functions/ask/_lib/vision.mjs - Ask log scrubbing
functions/ask/_lib/log-scrub.mjs
Internal operations
- Command Center APIs
functions/internal/api - Quote management
functions/internal/api/quotes/index.js - Quote signing
functions/internal/_lib/quote-signing.mjs - Job operations
functions/internal/api/jobs.js - Follow-up queue
functions/internal/api/tasks.js - Quote follow-up sync
functions/internal/_lib/quote-follow-ups.mjs - Pipeline analytics
functions/internal/_lib/pipeline-summary.mjs - D1 business data
Scheduled services
- Scheduled worker
workers/ops-cron/src/index.js - D1 backup
workers/ops-cron/src/backup.mjs - Follow-up digest
workers/ops-cron/src/digest.mjs - Backup storage
- Operations alert
functions/_lib/lead-alert.mjs
Other components
- Customer
- Staff
Connections 27
- Customer → Marketing content: views
README.md - Customer → Estimate endpoint: submits estimate
README.md - Marketing content → Estimate endpoint: offers intake
README.md - Estimate endpoint → Lead service tagging: tags service
functions/api/estimate.js - Estimate endpoint → Lead storage: saves lead
functions/api/estimate.js - Estimate endpoint → Lead alerts: sends alert
functions/api/estimate.js - Customer → Ask chat API: asks question
README.md - Ask chat API → Intent routing: routes intent
functions/ask/api/chat.js - Ask chat API → Specialist prompts: selects prompt
functions/ask/api/chat.js - Ask chat API → Answer tools: runs tools
functions/ask/api/chat.js - Ask chat API → Guide embeddings: embeds query
functions/ask/api/chat.js - Ask chat API → Photo analysis: analyzes photo
functions/ask/api/chat.js - Ask chat API → Ask log scrubbing: records turns
functions/ask/api/chat.js - Staff → Command Center APIs: uses Command Center
README.md - Command Center APIs → D1 business data: reads and writes
README.md - Staff → Quote management: manages quotes
README.md - Quote management → Quote signing: uses signing
README.md - Staff → Job operations: manages jobs
README.md - Staff → Follow-up queue: views follow-ups
README.md - Follow-up queue → Quote follow-up sync: syncs reminders
functions/internal/api/tasks.js - Staff → Pipeline analytics: views analytics
README.md - Pipeline analytics → D1 business data: summarizes stages
README.md - Scheduled worker → D1 backup: runs backup
workers/ops-cron/src/index.js - Scheduled worker → Follow-up digest: builds digest
workers/ops-cron/src/index.js - D1 backup → D1 business data: backs up
README.md - D1 backup → Backup storage: stores backups
README.md - Scheduled worker → Operations alert: alerts on failure
workers/ops-cron/src/index.js