# Product Roadmap

Phased delivery for **Anwal Growth Platform**. Tasks in `/tasks` map to these phases. Status: [tasks/README.md](../tasks/README.md).

## Task progress (Phase 1)

| Task | Name | Status |
|------|------|--------|
| 000 | Project setup | **completed** |
| 001 | Documentation system | **completed** |
| 002 | App foundation | **completed** |
| 003 | Authentication | **completed** |
| 004 | Database models | **completed** |
| 005 | Import system | **completed** |
| 006 | Market Database module | **completed** |
| 007 | Segments module | **completed** |
| 008 | Email templates module | **completed** |
| 009 | Campaigns module | **completed** |
| 010 | Email Sending Engine | **completed** |
| 011 | Business Inbox | **completed** |
| 012 | AI Reply Classification | **completed** |
| 013 | Leads & Pipeline | **completed** |
| 014 | Dashboard Analytics | **completed** |
| 015 | Notifications & Automation Rules | **completed** |
| 016 | Settings & Administration | **completed** |
| 017 | Data Cleanup & Reset Tools | **completed** |
| 018 | Production Readiness | **completed** |
| 018b | Entity Profiles & Smart Segments | **completed** |

**v1.0 — ready for internal testing** (smoke checklist: [21-smoke-test-checklist.md](./21-smoke-test-checklist.md))

**v1.1 — market focus:** Data Quality and Duplicate Review **UI/workflows removed**; GPT preprocessing owns cleaning/dedup before import. CRM market module: actionable **company/person profiles**, enriched contact points, **smart + static segments** (+ Campaigns, Inbox, Leads, Pipeline).

---

## Phase 1: Foundation and documentation

**Goal:** Shared vision, rules, folder structure, and task backlog; then minimal runnable app.

| Deliverables | Task refs | Status |
|--------------|-----------|--------|
| Docs and tasks system | task-000, task-001 | done |
| Next.js scaffold, tooling | task-002 | done |
| Auth baseline | task-003 | done |

**Exit criteria:** Repo documented; app runs locally; team can pick Phase 2 tasks.

---

## Phase 2: Core CRM

**Goal:** Browse imported market data; manual CRUD deferred.

| Deliverables | Task refs | Status |
|--------------|-----------|--------|
| MongoDB models | task-004 | done |
| Market Database module | task-006 | done |
| Segments module | task-007 | done |
| People module (manual CRUD) | deferred | future |
| Contact points module | deferred | future |
| Settings & Administration | task-016 | done |

---

## Phase 3: Import system

**Goal:** Load processed Excel market data safely.

| Deliverables | Task refs |
|--------------|-----------|
| Import UI and API | task-005 |
| Dedup and validation rules | task-005 |

---

## Phase 4: Leads and pipeline

**Goal:** Lead capture, targeting, and opportunity management.

| Deliverables | Task refs |
|--------------|-----------|
| Segments | task-007 |
| Leads module | deferred |
| Opportunities pipeline | deferred |

---

## Phase 5: Email campaigns

**Goal:** Audiences, templates, and send orchestration (internal SMTP).

| Deliverables | Task refs |
|--------------|-----------|
| Email templates module | task-008 |
| Campaigns module | task-009 |
| Sending engine | task-010 |

---

## Phase 6: Business Inbox

**Goal:** Operational email inside the platform.

| Deliverables | Task refs |
|--------------|-----------|
| Business inbox foundation (UI + sync) | task-011 |
| IMAP sync expansion | task-016 |

---

## Phase 7: Tracking and automation

**Goal:** Opens/clicks/replies and n8n workflows.

| Deliverables | Task refs |
|--------------|-----------|
| Email tracking | task-017 |
| n8n webhooks | task-019 |

---

## Phase 8: AI classification

**Goal:** In-app reply and signal classification.

| Deliverables | Task refs |
|--------------|-----------|
| Reply classification | task-012 |
| AI content generation & lead intelligence | task-021 Phase 2 |
| AI insights (foundational) | task-021 |

---

## Phase 9: Analytics and insights

**Goal:** Leadership and BD visibility.

| Deliverables | Task refs |
|--------------|-----------|
| Dashboard analytics | task-020 |
| AI insights expansion | task-021 |

---

## Phase 10: Production readiness

**Goal:** Secure, observable, deployable system.

| Deliverables | Task refs |
|--------------|-----------|
| White-label branding | task-023 (**done**) |
| Hardening, monitoring, backup | task-023b |
| Deployment runbook | [12-deployment.md](./12-deployment.md) |

---

## Current phase

**Phase 1 — Foundation and documentation**

- Task 000: completed  
- Task 001: completed  
- Task 002: completed — Next.js, TypeScript, Tailwind, Zod env, Mongoose, health API, home page  
- Task 003: completed — NextAuth credentials, login, dashboard, middleware, user model  
- Task 004: completed — core Mongoose models and enums  
- Task 005: completed — simple + processed import APIs and `/imports` UI  
- Task 006: completed — Market Database browse/search/filter over imported data  
- Task 007: completed — Segments module with preview and dynamic targeting  
- Task 008: completed — Email Templates module (variables + preview)  
- Task 009: completed — Campaigns prep module (preview + recipients + stats)  
- **Task 010 (Email Sending Engine): completed**
- **Task 011 (Business Inbox): completed**
- **Task 012 (AI Reply Classification): next**

---

## Dependencies (high level)

```mermaid
flowchart LR
  P1[Phase 1 Foundation] --> P2[Phase 2 CRM]
  P2 --> P3[Phase 3 Import]
  P2 --> P4[Phase 4 Leads]
  P4 --> P5[Phase 5 Campaigns]
  P5 --> P6[Phase 6 Inbox]
  P5 --> P7[Phase 7 Tracking]
  P6 --> P7
  P7 --> P8[Phase 8 AI]
  P7 --> P9[Phase 9 Analytics]
  P8 --> P9
  P9 --> P10[Phase 10 Production]
```
