# Technology Stack — ClientHub v2.0 Business Operations Suite
**Project:** ClientHub
**Current Version:** 1.0 (Production: hub.iamcavalli.net on Coolify/Hetzner)
**Researched:** 2026-06-11
**Scope:** Stack additions for v2.0 features: drag-and-drop offer builder, public multistep quote pages, CRM lead pipeline, follow-up reminder system.
---
## Existing Stack (v1.0 — Validated)
| Technology | Version | Status | Role |
|------------|---------|--------|------|
| Next.js | 16 | Production | App Router, Server Actions |
| React | 19 | Production | UI rendering |
| TypeScript | 5.x | Production | Type safety (strict mode) |
| Postgres | (Neon) | Production | Primary database |
| Drizzle ORM | Latest | Production | DB access + migrations |
| Auth.js | v4 | Production | Admin session + token middleware |
| Tailwind CSS | v4 | Production | Utility-first styling |
| shadcn/ui | (latest) | Production | Component library (copied) |
| Zod | Latest | Production | Validation schemas |
| nanoid | Latest | Production | Token generation |
---
## New Stack Additions for v2.0
### 1. Drag-and-Drop Offer Builder (Services Between Phases)
**Requirement:** Move services between offer phases, visual reordering, keyboard + mouse support.
| Technology | Version | Purpose | Why This Choice | Status |
|------------|---------|---------|-----------------|--------|
| `@dnd-kit/react` | ^10.0.0+ | Drag-drop core + React hooks | Modern, React 19 verified compatible. Official support via `@dnd-kit/react` package (not legacy `@dnd-kit/core`). Built-in PointerSensor (mouse/touch/pen) + KeyboardSensor. Zero peer dependency conflicts with Next.js 16 + React 19. | RECOMMENDED |
| `@dnd-kit/helpers` | ^10.0.0+ | move(), swap() utilities | Bundles with React pkg; simplifies reordering logic. | RECOMMENDED |
**Why NOT Alternatives:**
- `@hello-pangea/dnd` (v16–17): Locks peer dependency to React 18.x. Official React 19 support not released as of June 2026. Community testing shows it *may* work (with peer dependency override), but not officially supported.
- `react-beautiful-dnd`: Archived since 2022. Unmaintained.
- `pragmatic-drag-and-drop` (Atlassian): Low-level browser API attachment (manual useEffect in each component). Higher boilerplate than dnd-kit for simple offer builder. Optimized for enterprise real-time collaboration (not your use case).
- Native HTML5 Drag & Drop API: Browser-native but poor accessibility, inconsistent across browsers, verbose API.
**Installation:**
```bash
npm install @dnd-kit/react @dnd-kit/helpers
```
**Integration Point:**
Wrap offer builder section with `DragDropProvider`, configure sensors for accessibility:
```typescript
import { DragDropProvider } from '@dnd-kit/react';
import { PointerSensor, KeyboardSensor } from '@dnd-kit/dom';
{/* Phases with draggable services inside */}
```
**Confidence:** HIGH — dnd-kit v10+ officially supports React 19. Verified via Context7 documentation.
---
### 2. CRM Lead Pipeline UI (Kanban Board + Table)
**Requirement:** Lead stages (Qualificato → Preventivato → Vinto/Perso), drag-drop between columns, sortable lead table with filters.
| Technology | Version | Purpose | Why This Choice | Status |
|------------|---------|---------|-----------------|--------|
| `@tanstack/react-table` | ^8.0.0+ | Headless table engine | Lightweight, zero UI opinions. Composes perfectly with shadcn/ui. Powers sorting, filtering, row selection on lead list. No Material UI lock-in. Industry standard. | RECOMMENDED |
| `@dnd-kit/react` | (same as above) | Kanban column reordering | Reuse same DragDropProvider from offer builder for lead status columns. | RECOMMENDED |
**Why NOT Alternatives:**
- `Material React Table`: Locks you into Material UI styling (conflicts with Tailwind v4).
- Pre-built kanban packages (React Big Calendar, react-kanban, etc.): Opinionated styling overhead. dnd-kit + shadcn handles it lighter.
- `TanStack Query` (React Query): Not needed here. Data is server-fetched once per page load, then local state. Add if you need sync polling later.
**Installation:**
```bash
npm install @tanstack/react-table
```
**Integration Point:**
```typescript
import { useReactTable, getCoreRowModel } from '@tanstack/react-table';
const table = useReactTable({
data: leads,
columns: [/* name, email, stage, last_contact, next_reminder */],
getCoreRowModel: getCoreRowModel(),
});
```
**Confidence:** HIGH — TanStack Table is framework-agnostic, tested with shadcn/ui in hundreds of productions.
---
### 3. Public Multistep Quote Pages (Form + Validation)
**Requirement:** 3–5 step wizard (select client → select offer tier → review pricing → summary), per-step validation, no authentication.
| Technology | Version | Purpose | Why This Choice | Status |
|------------|---------|---------|-----------------|--------|
| `react-hook-form` | ^7.0.0+ | Form state + client validation | You already know this pattern (used in admin). Integrates seamlessly with Server Actions. Minimal bundle (8kb gzip). Use `zodResolver` for Zod bridge. | RECOMMENDED |
| `@hookform/resolvers` | ^3.0.0+ | Zod ↔ RHF integration | 1kb addon. Single source of truth: write Zod schema once, use client (resolver) + server (Server Action). | RECOMMENDED |
| Zod | (existing) | Shared validation schema | Reuse existing Zod setup. No new dependency. Quote schema: `client_id`, `selected_offers[]`, `tier_selection`, `pricing_overrides`. | RECOMMENDED |
**Why NOT Alternatives:**
- `Conform`: Newer, Server Action-native, requires more setup for multi-step state management. Overkill for a simple quote form.
- `Formik`: Maintenance mode since 2022. RHF is lighter + actively maintained.
- No library (plain form + `