Skip to content

Add NAHV Sales & Lead Management Platform#1278

Open
pimholthof wants to merge 7 commits intoruvnet:mainfrom
pimholthof:claude/build-nahv-app-M6gnw
Open

Add NAHV Sales & Lead Management Platform#1278
pimholthof wants to merge 7 commits intoruvnet:mainfrom
pimholthof:claude/build-nahv-app-M6gnw

Conversation

@pimholthof
Copy link

Summary

This PR introduces a complete sales and lead management platform for NAHV, consisting of a Next.js frontend and Express backend with SQLite database. The application provides comprehensive tools for tracking leads through the sales pipeline, analyzing acquisition channels, and monitoring key performance indicators.

Key Changes

Backend (Express + SQLite)

  • Database Layer (src/nahv/backend/src/db/database.ts): SQL.js-based SQLite wrapper with persistent file storage, schema initialization, and seed data
  • Lead Management (src/nahv/backend/src/routes/leads.ts): CRUD endpoints for leads with fields tracking status, pricing, source, and customer conversion
  • Analytics Engine (src/nahv/backend/src/routes/analytics.ts): Comprehensive metrics computation including conversion rates, ARR calculations, deal cycle analysis, and source attribution
  • Pipeline Tracking (src/nahv/backend/src/routes/pipeline.ts): Open pipeline overview with stale lead detection and value aggregation
  • Type Definitions (src/nahv/backend/src/types.ts): TypeScript interfaces for Lead, AnalyticsSummary, and related data structures

Frontend (Next.js 14 + React)

  • Dashboard (src/nahv/frontend/app/page.tsx): Main overview with KPIs including total leads, conversion rates, ARR metrics, and performance trends
  • Lead Management (src/nahv/frontend/app/leads/page.tsx): Searchable lead table with filtering by status and customer status, inline editing via modal
  • Pipeline View (src/nahv/frontend/app/pipeline/page.tsx): Open opportunities tracking with deal value, age, and stale lead warnings
  • KPI Dashboard (src/nahv/frontend/app/kpi/page.tsx): Target-based performance monitoring with visual status indicators
  • Source Analysis (src/nahv/frontend/app/bronanalyse/page.tsx): Channel attribution analysis showing leads, conversions, and ARR per acquisition source
  • Email Templates (src/nahv/frontend/app/templates/page.tsx): Pre-built email templates (NL/EN) for kennismaking, proposals, and onboarding with copy-to-clipboard functionality
  • Lead Modal (src/nahv/frontend/components/LeadModal.tsx): Reusable form component for creating/editing leads
  • Sidebar Navigation (src/nahv/frontend/components/Sidebar.tsx): Main navigation with links to all dashboard sections
  • API Client (src/nahv/frontend/lib/api.ts): Typed fetch wrapper for backend communication with utility functions for formatting

Styling & Configuration

  • Tailwind CSS: Global styles with custom component classes (buttons, inputs, cards)
  • Next.js Config: API rewrites for local development, TypeScript strict mode enabled
  • Build Configuration: Both frontend and backend with appropriate TypeScript and tooling setup

Notable Implementation Details

  • Lead Lifecycle Tracking: Supports multiple statuses (Contact gelegd, Afspraak gepland, Offerte verstuurd, Klant, Geen reactie) with next action tracking
  • Multi-language Support: Templates and UI support both Dutch (NL) and English (EN)
  • Financial Metrics: Tracks proposal pricing, ARR calculations, and separates NAHV-sourced revenue from external network revenue
  • Performance Analytics: Computes conversion funnels, deal cycle duration, follow-up speed, and identifies stale opportunities
  • Source Attribution: Categorizes leads by acquisition channel (Google, Academie, Referral/Netwerk, Eigen acquisitie, Klant NAHV)
  • Responsive UI: Card-based layout with color-coded status indicators and real-time filtering

https://claude.ai/code/session_01B4Hd1gFuAgP86vfZDk2e8p

claude added 7 commits March 2, 2026 21:35
- Backend: Express + TypeScript + SQLite (better-sqlite3)
  - REST API: /api/leads, /api/pipeline, /api/analytics
  - CRUD voor leads en deals
  - Pipeline stages met seed data (6 fases, 5 leads, 5 deals)
  - Analytics endpoint met KPI's, pipeline stats en recente leads

- Frontend: Next.js 14 + TypeScript + Tailwind CSS
  - Dashboard met KPI-kaarten en pipeline/leads overzicht
  - Leads pagina met zoeken, filteren, toevoegen en bewerken
  - Sales pipeline Kanban bord met drag-to-stage interface
  - Sidebar navigatie, LeadModal component

https://claude.ai/code/session_01B4Hd1gFuAgP86vfZDk2e8p
…atibiliteit

Next.js 14.1.0 ondersteunt geen TypeScript config bestanden.
Hernoemd naar next.config.mjs en lock files toegevoegd.

https://claude.ai/code/session_01B4Hd1gFuAgP86vfZDk2e8p
Sluit build-artefacten (.next/) en runtime-data (backend/data/) uit van versiebeheer.

https://claude.ai/code/session_01B4Hd1gFuAgP86vfZDk2e8p
…iliteit

Frontend API calls gaan nu via relatief pad /api in plaats van direct
naar localhost:3001, zodat de app ook werkt in cloud/sandbox omgevingen.

https://claude.ai/code/session_01B4Hd1gFuAgP86vfZDk2e8p
…liteit

better-sqlite3 vereist native C++ compilatie die faalt op Node 24+.
sql.js is pure JavaScript/WASM en werkt op elke Node versie en OS
zonder build tools. Ook ts-node vervangen door tsx (sneller, beter compat).

https://claude.ai/code/session_01B4Hd1gFuAgP86vfZDk2e8p
- Voeg nieuwe frontend pagina's toe: bronanalyse, kpi, templates
- Verbeter analytics routes met uitgebreidere rapportage
- Refactor database.ts voor betere sql.js compatibiliteit
- Update types.ts met uitgebreidere type definities
- Verbeter leads, pipeline routes en API lib
- Update Sidebar met navigatie naar nieuwe pagina's

https://claude.ai/code/session_01B4Hd1gFuAgP86vfZDk2e8p
- Bauhaus design system: zwart/wit, geen border-radius, geen shadows, Inter font
- Zwarte sidebar met witte actieve nav-items en nieuwe Tarief pagina
- Dashboard: executive summary, ARR blok, KPI grid, recente leads, maandgrafiek
- Pipeline: interactief drag & drop kanban bord met stale-lead indicatoren
- Leads: Bauhaus tabel met filters, volledig LeadModal met alle NAHV velden
- Templates: volledig 14-stappen SOP met alle echte email templates (NL/EN)
- KPI: doelen vs actueel met funnel visualisatie
- Bronanalyse: tabel + bar charts per acquisitiekanaal
- Nieuw: Tarief & Voorstel calculator met NL/EN template generator

https://claude.ai/code/session_01B4Hd1gFuAgP86vfZDk2e8p
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants