Dealer Website Platform Rebuild: Basic Inventory to Full SaaS
Quick Links
Snapshot
Business Objective
DealerClick's B2B dealer website platform was hemorrhaging customers. Dealers were leaving for competitors offering features we didn't have—AI chat, blogs for local SEO, location-specific pages, real credit prequalification. Our platform looked basic: just inventory listings and contact forms. Worse, dealers couldn't manage their own content, inventory, or leads. Every change required emailing support. Dealer complaints were consistent: "We can't rank for 'used cars [our city]'—no blog, no location pages, terrible SEO", "We can't manage our website content without emailing you", "We have no visibility into leads", "Your platform looks basic compared to competitors". The business needed to stop the bleeding and transform into a competitive premium SaaS offering.
Primary Technical Outcome
Rebuilt entire platform from Gatsby to Next.js 14 over 1-2 months as solo engineer, transforming it from basic inventory site into full-featured B2B SaaS platform. Shipped 6 major features: blog functionality (full CRUD with tags, pagination, SEO), location-based SEO (3-tier geo-targeted pages), AI chatbot (OpenAI GPT-4o-mini with 5 functions), credit prequalification (700Credit API soft pulls), 6-step credit application (React Hook Form + Zod + CAPTCHA + SSN encryption), and dealer management tools (API-based content/inventory/lead management). Complete SEO infrastructure overhaul with sitemaps, JSON-LD structured data, NAP consistency checker, and internal linking generator. Achieved PageSpeed 90+, Core Web Vitals green, and Google Analytics 4 integration.
My Role
Solo platform engineer for entire rebuild—full-stack development (Next.js 14 App Router, Server Components, TypeScript, Tailwind, Shadcn/ui), AI integration (OpenAI GPT-4o-mini chatbot with function calling for inventory search, dealer info, FAQ, navigation), credit system integration (700Credit API for soft/hard pulls), SEO implementation (sitemaps, structured data, NAP checker, internal linking generator), security (Cloudflare Turnstile CAPTCHA, SSN encryption AES-256-GCM, rate limiting, honeypot spam protection), performance optimization (Sharp image processing, Workbox service workers, ISR, lazy loading), and state management (Zustand stores for blog, chat, inventory, favorites, compare). Designed modular architecture for multi-tenant B2B SaaS.
Key Metrics
- Features Added: 6 major features (blog, locations, AI chat, credit app, prequalification, dealer tools)
- SEO Infrastructure: Complete foundation (sitemaps, structured data, NAP checker, internal linking)
- Dealer Satisfaction: Solved 3 critical complaints (content mgmt, inventory mgmt, lead mgmt)
- Conversion Tools: Credit prequalification, 6-step application, payment calculator, AI chat, compare, price watch
- Analytics: Google Analytics 4 tracking enabled - "doing well for a dealership website"
- Performance: PageSpeed 90+, Core Web Vitals green (LCP <2.5s, FID <100ms, CLS <0.1)
- Timeline: 1-2 months, phased rollout, solo engineer
- Self-Service: Dealers manage content via API (blog, dealership info, testimonials, leads)
- Dealer Customers (B2B): Can now manage content/inventory/leads, publish blog posts for local SEO, capture better qualified leads with credit prequalification
- End Users (Car Buyers): Better experience with AI chat for instant answers, prequalification to know if they qualify, detailed location pages, blog content, vehicle comparison
- Sales Team: Premium features (AI chat, blog, location SEO, 700Credit prequalification) as competitive differentiators against competitors
- Marketing: SEO infrastructure enables dealers to rank locally (blog content, location pages, structured data for rich snippets)
- Support: Reduced ticket volume (dealers can self-manage content via API, AI chat answers common customer questions)
Context
DealerClick's dealer website platform was built on Gatsby (static site generator) as a basic MVP: inventory listings, vehicle detail pages, and simple contact forms. No blog. No location pages. No AI chat. No real credit application. No dealer tools. The stack was fundamentally limited—Gatsby great for blogs but terrible for dynamic features (AI chat, real-time inventory). Zero SEO infrastructure (no sitemaps, no structured data, poor metadata, no canonical URLs). Zero dealer tools (all content changes required emailing engineering). Dealers couldn't rank for local searches, missed "near me" searches, had no content marketing strategy. Competitors offered AI chat, blogs, location pages, real credit applications. Framework risk—Gatsby ecosystem stagnating, build times increasing (10-15 minutes), community shrinking. Critical business trigger: Dealers leaving for competitors with better features, can't charge premium pricing without premium features, support tickets overwhelming (dealers emailing for basic content changes), SEO disadvantage hurting dealer ROI (fewer organic leads = lower website value).
Problem
Symptoms
- "We can't manage our website content" - Every content change required emailing support (2-3 day turnaround), no self-service capabilities
- "Our SEO is terrible" - Not ranking for "used cars [city]" (page 3-4 on Google), competitors with blogs ranking higher, missing "near me" searches
- "We can't track leads" - Contact forms went to email (Gmail/Outlook), no central lead management, no visibility into which pages generated leads
- "The site feels basic" - No AI chat (competitors have ChatGPT assistants 24/7), no blog (can't do content marketing), no location pages (missing local SEO)
- End users: No instant answers (wait 2-24 hours for dealer response), can't compare vehicles (no side-by-side tool), no local content
- Slow turnaround creating dealer frustration, support ticket backlog (100+ tickets/month)
- Fewer organic leads, lower website ROI, dealers questioning platform value
- Lost leads (emails buried in inbox), no lead nurturing, no conversion optimization
Root Causes
- Primary: Platform built as basic MVP (inventory listing + contact form) in 2018 and never evolved beyond that. No investment in premium features or dealer tools. Product stagnated while competitors innovated.
- Gatsby limitations: Static site generator not ideal for dynamic features (AI chat requires server state, real-time inventory updates, function calling)
- No SEO strategy: Missing foundational SEO elements (sitemaps, structured data, location pages, blog)
- No dealer admin: All content changes required engineering time (doesn't scale, creates support bottleneck)
- No differentiation: Platform looked identical to free open-source dealer templates (no competitive moat)
- Framework obsolescence: Gatsby ecosystem dying (harder to hire developers, slower security patches, no new features)
- Scalability issues: Static site regeneration times increasing with inventory growth (10-15 min builds now, 30+ min at scale)
Risk if Unresolved
- Business Risk: 20-30% annual churn as dealers leave for platforms with AI chat, blogs, location SEO, prequalification
- Lost Revenue: Can't charge $500+/month premium pricing without premium features ($200/month commodity pricing instead)
- Support Burden: Unsustainable support ticket volume (100+ tickets/month for basic content changes)
- Competitive Disadvantage: Falling further behind competitors innovating with AI, advanced SEO tools
- Technical Risk: Framework obsolescence, scalability issues (build times increasing), security vulnerabilities (outdated dependencies with CVEs)
Constraints & Requirements
Constraints
- Timeline: 1-2 months for complete rebuild (aggressive but necessary to stop churn)
- Team: Solo engineer (full-stack, AI integration, SEO, security, deployment—everything)
- Budget: OpenAI API costs (GPT-4o-mini for chat, acceptable for premium SaaS pricing), 700Credit integration fees (per credit pull, cost passed to dealers)
- Multi-Tenant Architecture: Each dealer gets own instance with custom branding (environment variables for dealer ID, theme, logo, business info)
- SEO Preservation: Can't break existing Google rankings during migration (301 redirects, maintain URL structure where possible)
- Zero Downtime: Dealers can't have websites go down during migration (deploy to new infrastructure, DNS cutover after thorough testing)
- 700Credit Compliance: Must comply with FCRA (Fair Credit Reporting Act, soft pulls only for prequalification, hard pulls require explicit consent)
- Performance: Must maintain fast load times despite adding features (AI chat, blog, location pages, 6-step credit application)
Success Criteria
- Blog functionality: Dealers can create, edit, delete blog posts (tag filtering, pagination, SEO-optimized metadata)
- Location pages: Dynamic geo-targeted pages for primary, secondary, tertiary service areas (targeting "used cars [city]" searches)
- AI chat: Functional chatbot with inventory search, dealer info, FAQ, navigation (OpenAI GPT-4o-mini with 5 functions)
- Credit prequalification: 700Credit integration for soft pull pre-screening (no hard pull unless explicit consent)
- 6-step credit application: Zod validation, Cloudflare Turnstile CAPTCHA, SSN encryption, rate limiting
- Dealer management: API-based content, inventory, lead management (dealers self-service without engineering)
- SEO overhaul: Sitemaps (main, blog, image), structured data (JSON-LD), NAP consistency checker, internal linking strategy
- Compare feature: Side-by-side vehicle comparison (up to 3 vehicles, spec comparison)
- Google Analytics 4: Tracking enabled for performance, conversions, user behavior
- Performance: PageSpeed 90+, Core Web Vitals green (LCP <2.5s, FID <100ms, CLS <0.1)
Non-Goals
- Native mobile apps: Web-first approach (responsive mobile web, not iOS/Android native apps—can add later if demand justifies)
- Multi-language: English only for MVP (Spanish localization can be added if dealers request)
- Voice search: Not in scope for V1 (Alexa/Google Assistant integration nice-to-have for future)
- VR showroom: Not in scope (3D vehicle viewing, virtual test drives—cool but not essential)
- Advanced A/B testing: Focus on core features first, experimentation infrastructure can follow
- White-label reseller program: B2B direct to dealers only (not building for resellers/agencies)
Strategy
Options Considered
- Option A: Keep Gatsby, Add Features Incrementally: Maintain Gatsby framework, add blog/AI chat/location pages as plugins or custom components
Pros: Smaller migration scope (less disruptive), faster initial implementation (1-2 weeks for blog), familiar codebase (no learning curve) Cons: Gatsby limitations make dynamic features difficult (AI chat requires server-side state), still have SEO issues, framework risk remains, can't add advanced features (700Credit integration, real-time inventory, admin dashboard)
Why not chosen: Why not chosen: Band-aid solution that doesn't solve root problems. We'd still be on dying framework, unable to compete with dynamic features competitors offer. - Option B: WordPress + WooCommerce: Migrate to WordPress for CMS capabilities, WooCommerce for inventory management, plugins for blog/SEO
Pros: Mature ecosystem (thousands of plugins), free CMS (self-hosted, no licensing fees), familiar to many developers, built-in blog and location pages Cons: PHP-based (team expertise is JavaScript/TypeScript, not PHP), poor performance without heavy optimization, plugin bloat and security concerns (WordPress notoriously vulnerable), doesn't integrate well with custom DealerClick CRM (PHP ↔ Go backend integration messy)
Why not chosen: Why not chosen: Wrong tech stack for team expertise. Performance concerns. Security track record poor. Moving backwards, not forwards. - Option C: Next.js 14 Full Rebuild (CHOSEN): Complete rebuild with Next.js 14 App Router, eliminate Gatsby entirely, use DealerClick CRM as single source of truth
Pros: Zero CMS costs (no separate CMS like Contentful/Sanity), modern framework with active community, Server Components + SSR for optimal performance, built-in optimization (image optimization, code splitting, ISR), perfect for dynamic features (AI chat, 700Credit, admin dashboard), single source of truth (DealerClick CRM only) Cons: Larger initial rebuild scope (1-2 months vs 1-2 weeks for incremental updates), need to build admin dashboard (no off-the-shelf CMS UI), learning curve for Next.js 14 App Router (new paradigm with Server Components)
Why chosen: Why chosen: Only option that solves ALL problems—modern framework, dynamic features, performance, SEO, dealer tools. Upfront investment pays off immediately with competitive features and reduced support burden.
Decision Rationale
- Full rebuild vs. incremental updates: 1-2 month rebuild (higher risk) vs 1-2 week incremental (safer). Full rebuild necessary to compete long-term. Incremental updates on Gatsby don't solve root problems. Mitigation: Phased rollout (foundation → SEO → blog → locations → AI chat → credit app), thorough testing on staging.
- OpenAI API costs vs. rule-based chatbot: OpenAI ($0.15 per 1M input tokens, $0.60 per 1M output tokens) vs free rule-based chatbot. OpenAI provides dramatically better UX (natural language understanding, context awareness, function calling). Cost negligible for premium SaaS ($500+/month vs $0.50/month OpenAI cost per dealer).
- 700Credit integration vs. simple credit form: 700Credit integration (harder, compliance requirements, per-pull fees) vs simple form (easier, no compliance). Real credit integration provides massive value (qualify leads upfront, filter tire-kickers, dynamic pricing based on credit score). Competitive differentiator. Per-pull fees passed to dealers ($15-30 per credit check, acceptable for qualified lead).
- Zero CMS costs strategy: If you already have backend with database (DealerClick CRM), why pay $200-800/month for separate CMS (Contentful, Sanity)? Build simple admin dashboard instead. ROI immediate (no ongoing CMS fees), full control over data model, no vendor lock-in.
Execution
Plan & Phases
- Phase 1: Foundation & Core Rebuild (Week 1-2): Next.js 14 scaffolding (App Router, TypeScript, Tailwind, Shadcn/ui), DealerClick API integration (inventory, content, leads), core pages (homepage, about, inventory, vehicle details, contact), Zustand state management setup, ISR configuration (5-minute revalidation). Prove end-to-end flow works. Establish design system and component architecture. Get visual/functional parity with old Gatsby site.
- Phase 2: SEO Overhaul (Week 3): Sitemap generation (main, blog, image—all dynamic, auto-generated), JSON-LD structured data (BlogPosting, FAQPage, BreadcrumbList, Product), NAP consistency checker (/api/seo/nap-check), internal linking strategy generator (/api/seo/internal-links), canonical URLs + hreflang tags, Open Graph + Twitter meta tags. Build foundation early so all new features benefit from SEO infrastructure.
- Phase 3: Blog Functionality (Week 4): Blog CRUD API endpoints (/api/blog-posts - create, read, update, delete), blog listing page (tag filtering, pagination 9 posts/page, search), blog detail pages (dynamic routing /blog/[slug]), Zustand blogStore for client-side caching, SEO optimization (metadata generation per post, JSON-LD BlogPosting, tag-based breadcrumbs). Unlocks content marketing for dealers.
- Phase 4: Location Pages (Week 5): locationProvider.ts for service area data (primary, secondary, tertiary tiers), dynamic location pages (/locations/[slug] - city-specific), distance-based descriptions ("closest dealer to [city]"), metadata generation per location, NAP consistency validation. Unlocks local SEO ("used cars in [city]", "near me" searches).
- Phase 5: AI Chatbot (Week 6): OpenAI GPT-4o-mini integration (API key management, error handling, rate limiting), function calling setup (5 functions: searchInventory, getVehicleDetails, getDealershipInfo, getFAQs, suggestNavigation), ChatWidget component (floating button, modal dialog), conversation history (last 10 messages), system prompt tuning. Provides instant customer answers 24/7.
- Phase 6: Credit Application & Prequalification (Week 7): 700Credit API integration (soft/hard pulls), 6-step credit application form (Personal Info, Address, Employment, Income, Co-Buyer, Review/Submit), Zod validation schemas, Cloudflare Turnstile CAPTCHA, SSN encryption (AES-256-GCM server-side), rate limiting per IP (5 apps/day), mock credit data for testing. Killer feature for qualifying leads upfront.
- Phase 7: Additional Features (Week 8): Compare feature (side-by-side comparison up to 3 vehicles), price watch system (customer alerts for price drops), payment calculator (estimate monthly payments), dealer management API endpoints (/api/admin-* routes). Polish features that enhance experience.
- Phase 8: Testing & Deployment (Week 8): Jest unit tests (critical utility functions, API routes, validation schemas), Playwright E2E tests (critical user flows), Lighthouse CI for performance regression detection (fails build if PageSpeed <90), Sentry integration for error tracking, Docker standalone output (next.config.mjs output: "standalone"), production deployment (self-hosted Docker, DNS cutover after 2 days staging testing).
- Week 1-2: Foundation: Next.js 14 scaffolding, DealerClick API integration, core pages, Zustand state management, ISR configuration
- Week 3: SEO Overhaul: Sitemaps, JSON-LD structured data, NAP checker, internal linking generator, canonical URLs
- Week 4: Blog Functionality: CRUD API, listing page, detail pages, tag filtering, pagination, SEO optimization
- Week 5: Location Pages: Service area data, dynamic routing, distance-based descriptions, metadata generation, NAP validation
- Week 6: AI Chatbot: OpenAI GPT-4o-mini integration, function calling (5 functions), ChatWidget component, conversation history
- Week 7: Credit Application: 700Credit API integration, 6-step form, Zod validation, CAPTCHA, SSN encryption, rate limiting
- Week 8: Additional Features + Testing: Compare feature, price watch, payment calculator, dealer management API, Jest/Playwright tests, Lighthouse CI, Sentry, Docker deployment
Rollout & Risk Controls
- Phased rollout: Foundation → SEO → blog → locations → AI chat → credit app (iterative, validate each phase before next)
- Thorough testing on staging environment (2 days of dealer testing before DNS cutover)
- DNS cutover only after dealer approval (zero downtime deployment strategy)
- Feature flags for AI features (controlled rollout, kill switch if OpenAI costs spike)
- Database migrations with rollback scripts (tested in staging environment)
- Zero downtime deployment via Docker (blue-green deployment, instant rollback)
- Monitoring dashboards (Sentry error tracking, Lighthouse CI performance regression, Google Analytics 4)
- Backup plan: Old Gatsby site still available if critical issues discovered (DNS rollback)
Architecture
System Components
- Frontend (Next.js 14 + React 18): Server Components for static content (inventory listings, blog posts, location pages—zero JavaScript by default), Client Components for interactive forms (contact, credit application, filters—opt-in client hydration only where needed), Zustand for client state (blogStore, chatStore, inventoryStore, favoritesStore, compareStore—client-side caching prevents redundant API calls), Tailwind CSS + Shadcn/ui for styling.
- Backend (DealerClick Go + PostgreSQL): Existing Go API extended with dealer-facing endpoints (blog CRUD, inventory search, lead submission, content management), multi-tenant security via dealer_id foreign keys, API key authentication.
- AI Services: OpenAI GPT-4o-mini (gpt-4o-mini-2024-07-18) for chatbot with 5 function calling capabilities (searchInventory, getVehicleDetails, getDealershipInfo, getFAQs, suggestNavigation), 10-message conversation history for context, server-side API calls (never expose OpenAI key to client).
- Credit Services: 700Credit API for soft pull pre-screening (real TransUnion credit check, no impact on credit score) + hard pull for full application (explicit consent required), dynamic pricing based on actual credit score, SSN encryption (AES-256-GCM server-side, never stored in plaintext).
- SEO Infrastructure: 3 sitemaps (main sitemap, blog sitemap, image sitemap—all dynamic, auto-generated), JSON-LD structured data (BlogPosting for blog posts, FAQPage for FAQ, BreadcrumbList for navigation, Product for vehicles), NAP consistency checker (/api/seo/nap-check - validates Name, Address, Phone consistency across pages), internal linking strategy generator (/api/seo/internal-links).
- Security & Performance: Cloudflare Turnstile CAPTCHA (free tier, invisible challenge—no annoying "check the boxes" UX), rate limiting (5 credit applications per IP per day via Redis), SSN encryption (AES-256-GCM server-side), honeypot spam protection (hidden username field), Zod validation (schema validation on all forms, server-side validation), Sharp image optimization (WebP/AVIF), Workbox service workers (offline cache), Sentry monitoring (error tracking, performance monitoring, security event logging).
Data Flows
- Ingress: User visits dealer website → Next.js Server Components fetch from DealerClick CRM → render pure HTML (zero JavaScript for inventory listings, blog posts) → Client Components for forms (contact, credit application, filters) → form submit → Next.js API route → DealerClick CRM → lead created.
- Blog CRUD: Dealer creates blog post → /api/blog-posts endpoint → Zustand blogStore updates client cache → Next.js revalidates ISR (5-minute cache) → blog listing/detail pages updated.
- AI Chat: User asks question → ChatWidget component → /api/chat endpoint → OpenAI GPT-4o-mini with function calling → searchInventory() / getDealershipInfo() / getFAQs() → response with context (last 10 messages) → display in ChatWidget.
- Credit Application: User fills 6-step form → Cloudflare Turnstile CAPTCHA validation → Zod schema validation → /api/credit endpoint → SSN encryption (AES-256-GCM server-side) → 700Credit API call (soft pull pre-screening) → dynamic pricing based on credit score → return pre-approval decision.
- SEO: Google crawler visits → Next.js Server Components → dynamic sitemap generation (main, blog, image) → JSON-LD structured data (BlogPosting, FAQPage, BreadcrumbList, Product) → canonical URLs + hreflang tags → Open Graph + Twitter meta tags → rich snippets in Google results.
Security
- Primary threats: Bot spam (automated form submissions flooding CRM with fake leads), data theft (SSN exposure in credit applications - FCRA compliance violation, legal liability), API abuse (excessive 700Credit API calls - soft pulls cost $15-30 each, bill shock risk)
- Secondary threats: XSS (cross-site scripting - malicious scripts in blog posts or user input, steal session tokens, redirect users), CSRF (cross-site request forgery - forged requests to submit forms on behalf of users)
- Trust boundaries: Browser (untrusted) ↔ Next.js Server (trusted) ↔ DealerClick CRM (trusted, API key auth) ↔ OpenAI API (trusted, bearer token) ↔ 700Credit API (trusted, API key + IP whitelisting)
- Attack surface: Contact form, credit application form, blog CRUD endpoints, AI chat endpoint (/api/chat), SEO utility endpoints (/api/seo/*)
Controls Implemented
- Cloudflare Turnstile CAPTCHA: Applied to credit application form (prevent bot spam), applied to contact form (honeypot backup), free tier (unlimited requests for non-commercial use), invisible challenge (no annoying "check the boxes" UX)
- SSN Encryption: AES-256-GCM server-side encryption (symmetric key stored in environment variable, never committed to git), SSN never stored in plaintext (encrypted before sending to 700Credit API), encryption key rotation (manual process, documented in runbook), lib/server/decrypt.ts - server-side only, never bundled in client JavaScript
- Rate Limiting: 5 credit applications per IP per day (prevent abuse, bill shock from excessive 700Credit API calls), configurable via environment variable (CREDIT_APP_RATE_LIMIT), Redis-based (in-memory store for rate limit counters, TTL 24 hours)
- Honeypot Fields: Hidden username field on contact forms (invisible to humans via CSS, filled by bots), if honeypot filled return 200 OK (silent success) but don't create lead (waste bot's time)
- Zod Validation: Schema validation on all forms (contact, credit application, blog post creation), server-side validation (never trust client, validate again on server), type-safe error messages (Zod infers TypeScript types, prevents runtime errors)
- Sentry Monitoring: Error tracking (production errors sent to Sentry, alerts via Slack), security event logging (failed credit applications, honeypot triggers, rate limit violations), performance monitoring (slow API routes, large bundle sizes)
Verification
- Penetration testing: Manual testing of form submissions (attempted bot spam, SQL injection, XSS - all blocked)
- Code review: Two-person review of all security-critical code paths (SSN encryption, rate limiting, CAPTCHA validation)
- Dependency scanning: Dependabot alerts enabled for npm packages, weekly npm audit + security patch updates
- CAPTCHA testing: Validated Cloudflare Turnstile blocks automated form submissions (100 simulated bot attempts - all blocked)
- Rate limit testing: Simulated abuse scenarios (10 credit applications in 1 minute - all throttled after 5th attempt)
- SSN encryption testing: Validated SSN never stored in plaintext (database inspection, network traffic inspection with Wireshark)
- Compliance review: FCRA compliance validated for credit applications (soft pulls only for prequalification, hard pulls require explicit consent)
Operations
Observability
- Key metrics: Google Analytics 4 tracking dealer site performance (page views, session duration, bounce rate, user behavior analysis - most viewed vehicles, popular blog posts, credit application funnel drop-off, traffic sources - organic search, direct, referral, social), conversions (contact form submissions, credit applications, phone calls, direction requests)
- Sentry: Error tracking (production errors, stack traces, user context), performance monitoring (slow API routes, large JavaScript bundles), alerts (Slack integration for critical errors, email for warnings)
- Lighthouse CI: Performance regression detection (fails build if PageSpeed <90 or Core Web Vitals fail), automated checks on deployment (every Git push triggers Lighthouse audit), trend tracking (historical PageSpeed scores, Core Web Vitals trends over time)
- Custom admin dashboard: Dealer activity monitoring (blog post creation, content updates, lead management), AI usage tracking (OpenAI API call volume, function calling patterns), credit balance tracking (700Credit API usage, cost monitoring)
Incident Response
- Common incidents: OpenAI API timeout (fallback to cached responses + retry queue, graceful degradation - disable AI chat if sustained outage), 700Credit API rate limit (cache extension + graceful degradation - show pre-qualification unavailable message), Cloudinary upload failure (retry logic + user notification)
- Runbooks: "OpenAI API Down" (disable AI chat via feature flag, notify dealers of temporary unavailability), "700Credit API Rate Limit" (extend cache TTL, notify dealers of prequalification delays), "Next.js Server Crash" (Docker auto-restart, Sentry alert, manual intervention if persistent)
- DR posture: Database backups every 6 hours (30-day retention via DealerClick CRM backup strategy), Docker standalone deployment (easy rollback to previous version), DNS cutover strategy (can rollback to old Gatsby site if critical issues)
Cost Controls
- OpenAI API: GPT-4o-mini cost ($0.15 per 1M input tokens, $0.60 per 1M output tokens) - estimated $0.50/month per dealer for typical chat usage, server-side caching for repeated prompts (reduce redundant API calls), 10-message conversation history limit (prevent unbounded context growth)
- 700Credit API: Soft pull pre-screening ($15-30 per credit check) - cost passed to dealers, rate limiting (5 apps per IP per day) to prevent abuse, mock credit data for testing (USE_MOCK_CREDIT environment variable) to avoid charges during development
- Cloudflare Turnstile: Free tier (unlimited requests for non-commercial use, $1/1000 requests for commercial) - currently on free tier, monitor usage monthly
- Vercel: Not using Vercel (self-hosted Docker deployment for more control), estimated cost savings $0-100/month vs Vercel Pro tier
- Docker: Self-hosted (standalone output via next.config.mjs), environment variables injected at runtime (dealer ID, theme colors, API keys), minimal Docker image (only necessary files)
Results
| Metric | Before | After | Notes |
|---|---|---|---|
| Blog Functionality | None | Full CRUD system | Dealers can publish local content for SEO ("dealership events [city]", "community involvement [city]") |
| Location Pages | None | 3-tier geo-targeting | Target "used cars in [city]" searches (primary, secondary, tertiary service areas) |
| AI Chat | None | GPT-4o-mini chatbot | Instant customer answers (inventory, dealer info, FAQ) - 24/7 availability |
| Credit Application | Basic form (no validation) | 6-step with 700Credit prequalification | Real-time credit soft pulls, dynamic pricing based on credit score |
| SEO Infrastructure | None | Sitemaps, JSON-LD, NAP checker | Complete SEO foundation for local rankings (structured data, rich snippets) |
| Dealer Complaints | Frequent (100+ tickets/month) | Resolved (self-service tools) | Support burden reduced (dealers manage own content via API) |
| Analytics | None | Google Analytics 4 | Track performance, conversions, user behavior - "doing well for a dealership website" |
| Compare Feature | None | Side-by-side (up to 3 vehicles) | Better shopping experience (spec comparison, pricing, features) |
- Support team morale improved: Team freed from repetitive manual tasks (100+ content change tickets/month), can focus on strategic dealer success initiatives
- Sales team confidence: Premium features (AI chat, blog, location SEO, 700Credit prequalification) became key differentiators in demos, faster dealer onboarding process
- Developer velocity: Next.js 14 ecosystem (TypeScript, Server Components, App Router) enables rapid feature iteration vs Gatsby stagnation
- Platform perception: DealerClick perceived as modern, competitive platform vs "old-school" legacy system (dealers proud to show their websites)
- Competitive parity achieved: Feature set now matches or exceeds competitors (AI chat, blog CMS, location SEO, real credit prequalification)
Lessons Learned
What Worked
- Next.js 14 App Router excellent for B2B SaaS: Server Components are game-changing. Most pages don't need JavaScript (inventory listings, blog posts, location pages) - render pure HTML, zero JavaScript. Only interactive features (forms, filters, chatbot) use Client Components. Result: PageSpeed 90+ out-of-box, Core Web Vitals green.
- OpenAI function calling perfect for automotive chatbot: Makes AI chat dramatically more useful than simple Q&A. User asks "Show me SUVs under $30k" → chatbot calls searchInventory(body='suv', priceRange='0-30000') → displays results. User asks "What are your hours?" → chatbot calls getDealershipInfo() → responds with hours. Much better than generic chatbot.
- 700Credit integration differentiated from competitors: Real credit prequalification is killer feature. Competitors offer "estimate your credit score" (useless). We offer soft pull pre-screening (real TransUnion credit check, no impact on credit score) + dynamic pricing based on actual credit score. Dealers love it (qualify leads upfront, save time on unqualified buyers).
- Location pages + blog solved SEO problem: Location pages unlocked local SEO. Before: Not ranking for "used cars in [city]" (page 3-4 on Google). After: Geo-targeted pages for primary, secondary, tertiary service areas. Blog unlocked content marketing. Dealers can publish local events, community involvement, dealership news = rank for long-tail keywords.
- Server Components by default, Client Components only when needed: Start with Server Components for everything (zero JavaScript by default). Only add "use client" for forms, filters, interactive features. Forces intentional hydration (not "everything is client-side by default"). Result: Smaller JavaScript bundles, faster load times, better performance.
What I Would Do Differently
- Webhook-based cache invalidation earlier (instead of ISR polling): Current implementation uses ISR (Incremental Static Regeneration) with 5-minute revalidation. When dealer updates inventory, changes don't appear for up to 5 minutes. Better: DealerClick CRM sends webhook when inventory changes → Next.js purges cache instantly → updates visible immediately. Estimated 8 hours to implement.
- A/B testing infrastructure from start: No experimentation capability currently. Can't test different hero CTAs, form layouts, chatbot prompts. Future: Vercel Edge Middleware for feature flags (A/B test contact form "Get Pre-Approved" vs "Check Availability"), variant routing, analytics integration. Estimated 16 hours for basic A/B testing framework.
- More comprehensive admin audit log: Content changes not logged currently (can't see who edited homepage hero text, when). Future: Full audit trail for compliance (store all changes in DealerClick CRM with timestamps, user IDs, before/after diffs). Useful for debugging ("who changed the phone number?") and compliance (SOC 2, GDPR). Estimated 8 hours for basic audit logging.
- Measure before migrating: Should have baselined everything before changing anything: Google Analytics (traffic, conversions), Google Search Console (rankings, click-through rates), support tickets (volume, common complaints). Without baselines, can't prove improvement. With baselines, can show "100+ support tickets/month → 20 tickets/month" (quantified impact).
Playbook (Reusable Principles)
- Kill your CMS if you have a custom backend API: If you already have backend with database (like DealerClick CRM), why pay $200-800/month for separate CMS (Contentful, Sanity, Strapi)? Build simple admin dashboard instead (React components + forms). ROI immediate (no ongoing CMS fees), full control over data model, no vendor lock-in.
- Performance is retention (and conversions, and SEO): PageSpeed 95+ = better Google rankings (Core Web Vitals are ranking factor) = more organic traffic = higher conversions. Slow sites lose users (40% abandon if load time >3s). Fast sites convert better (1s delay = 7% conversion loss). Performance isn't nice-to-have, it's business driver.
- Server Components by default, Client Components only when needed: Start with Server Components for everything (zero JavaScript by default). Only add "use client" for forms, filters, interactive features. Forces intentional hydration. Result: Smaller JavaScript bundles, faster load times, better performance.
- ISR > SSG for dynamic content: For inventory, products, content that changes periodically, use ISR (Incremental Static Regeneration) with 5-minute revalidation. Better than full static generation (10-15 minute rebuilds for every inventory change). Better than pure SSR (slower, more server load). ISR is sweet spot for B2B SaaS.
- Real integrations > fake tools: Real 700Credit integration (soft pull pre-screening) infinitely more valuable than fake "estimate your credit score" calculators. Real OpenAI function calling (search inventory, get dealer info) infinitely more valuable than rule-based chatbots. Users can tell the difference. Real integrations justify premium pricing.
Artifacts
- Live Demo Site
- Next.js 14 Codebase
- SEO Implementation (Sitemaps, JSON-LD)
- OpenAI Function Calling Guide
- 700Credit Integration Docs
Selected Technical Details
// OpenAI Function Calling for Automotive Chatbot
const functions = [
{
name: 'searchInventory',
description: 'Search vehicle inventory by make, model, year, price range',
parameters: {
type: 'object',
properties: {
make: { type: 'string', description: 'Vehicle make (e.g., Toyota, Ford)' },
model: { type: 'string', description: 'Vehicle model (e.g., Camry, F-150)' },
year: { type: 'number', description: 'Vehicle year' },
priceRange: { type: 'string', description: 'Price range (e.g., "10000-20000")' }
}
}
},
// ... other functions (getVehicleDetails, getDealershipInfo, getFAQs, suggestNavigation)
]
// OpenAI API call with function calling
const response = await openai.chat.completions.create({
model: 'gpt-4o-mini',
messages: conversationHistory,
functions,
function_call: 'auto',
})