v2-exece-docs

This commit is contained in:
IGNY8 VPS (Salman)
2026-03-23 10:30:51 +00:00
parent b94d41b7f6
commit e78a41f11c
15 changed files with 2218 additions and 707 deletions

View File

@@ -1,8 +1,12 @@
# IGNY8 Phase 1: Setup Wizard — Case 2 (New Site)
## Document 01D: Build Specification
> **Version:** 1.1 (codebase-verified)
> **Source of Truth:** Codebase at `/data/app/igny8/backend/`
> **Last Verified:** 2025-07-14
**Status**: Draft
**Version**: 1.0
**Version**: 1.1
**Date**: 2026-03-23
**Phase**: Phase 1 — Foundation
**Scope**: New site workflow with enhanced Site Structure step
@@ -144,8 +148,9 @@ Step 4 → Step 5 → Step 6
```python
# Fields to emphasize for this wizard:
class SAGBlueprint(models.Model):
site_id = models.ForeignKey(Site)
# SAGBlueprint inherits AccountBaseModel (provides account, created_by, etc.)
class SAGBlueprint(AccountBaseModel):
site = models.ForeignKey('igny8_core_auth.Site', on_delete=models.CASCADE)
status = models.CharField(
choices=['draft', 'active', 'archived'],
default='draft'
@@ -174,8 +179,9 @@ class SAGBlueprint(models.Model):
**Location**: Reference 01A (Attribute Definition)
```python
class SAGAttribute(models.Model):
blueprint = models.ForeignKey(SAGBlueprint)
# SAGAttribute inherits AccountBaseModel (provides account, created_by, etc.)
class SAGAttribute(AccountBaseModel):
blueprint = models.ForeignKey('sag.SAGBlueprint', on_delete=models.CASCADE)
name = models.CharField() # e.g., "Target Area"
description = models.TextField()
@@ -624,7 +630,7 @@ Be conservative: only map if connection is clear. Do not invent values not suppo
### Phase 2: Frontend Components (React)
#### Step 2.1: Implement WizardStep3Container
- [ ] Create `frontend/src/components/wizard/WizardStep3Container.jsx`
- [ ] Create `frontend/src/components/wizard/WizardStep3Container.tsx`
- [ ] Manage state for all sub-steps (3a3f):
- `currentSubstep` (enum: 'generate', 'review', 'business', 'populate', 'preview', 'confirm')
- `attributes` (from API)
@@ -644,7 +650,7 @@ Be conservative: only map if connection is clear. Do not invent values not suppo
---
#### Step 2.2: Implement AttributeReviewPanel (Step 3b)
- [ ] Create `frontend/src/components/wizard/AttributeReviewPanel.jsx`
- [ ] Create `frontend/src/components/wizard/AttributeReviewPanel.tsx`
- [ ] Render attributes grouped by level:
- **Primary Attributes** section
- **Secondary Attributes** section
@@ -672,7 +678,7 @@ Be conservative: only map if connection is clear. Do not invent values not suppo
---
#### Step 2.3: Implement BusinessDetailsForm (Step 3c)
- [ ] Create `frontend/src/components/wizard/BusinessDetailsForm.jsx`
- [ ] Create `frontend/src/components/wizard/BusinessDetailsForm.tsx`
- [ ] Fields:
- [ ] **Products** — textarea, accepts comma-separated or line-break list
- [ ] **Services** — textarea, same format
@@ -697,7 +703,7 @@ Be conservative: only map if connection is clear. Do not invent values not suppo
---
#### Step 2.4: Implement BlueprintPreviewPanel (Step 3e)
- [ ] Create `frontend/src/components/wizard/BlueprintPreviewPanel.jsx`
- [ ] Create `frontend/src/components/wizard/BlueprintPreviewPanel.tsx`
- [ ] Render tree view of clusters:
- [ ] Cluster name (e.g., "Neck Massage Devices")
- [ ] Type badge (e.g., "Topic Hub")
@@ -757,7 +763,7 @@ Be conservative: only map if connection is clear. Do not invent values not suppo
- [ ] Detailed Mode: 3a → 3b → 3c → 3d → 3e → 3f → Step 4
- [ ] Step 4 → Step 5 (always)
- [ ] Step 5 → Step 6 (always)
- [ ] Implement state persistence (Redux or context):
- [ ] Implement state persistence (Zustand store):
- [ ] Save wizard state to localStorage or session
- [ ] Allow user to resume if page refreshes
- [ ] Unit test: navigation logic for both modes
@@ -905,7 +911,7 @@ Be conservative: only map if connection is clear. Do not invent values not suppo
### Functional Criteria
#### 5.1: Step 3a — Generate Attributes
- [x] **AC-3a-1**: GET /api/v1/sag/wizard/generate-attributes/ returns attribute framework
- [x] **AC-3a-1**: POST /api/v1/sag/wizard/generate-attributes/ returns attribute framework
- [ ] Response includes 48 attributes (depending on industry/sectors)
- [ ] Each attribute has name, level, suggested_values, description
- [ ] Attributes are organized by level (primary → secondary → tertiary)
@@ -1074,7 +1080,7 @@ Be conservative: only map if connection is clear. Do not invent values not suppo
- [ ] User can navigate freely between steps (prev/next)
- [x] **AC-5-3**: Mode selection persists
- [ ] Mode stored in session/Redux state
- [ ] Mode stored in session/Zustand state
- [ ] Navigation logic respects mode throughout wizard
---
@@ -1188,7 +1194,7 @@ This section provides step-by-step instructions for Claude Code (or equivalent A
2. **Set Up Environment**
- Clone repository
- Install dependencies (backend: Django/DRF, frontend: React + Redux, WordPress: plugin SDK)
- Install dependencies (backend: Django >=5.2.7/DRF, frontend: React 19 + Zustand + TypeScript ~5.7.2 + Vite ^6.1.0, WordPress: plugin SDK)
- Create feature branch: `feature/wizard-step-3-site-structure`
- Ensure tests pass on main branch
@@ -1271,7 +1277,7 @@ Location: backend/sag/api/views/wizard.py
```
Location: frontend/src/components/wizard/
A) WizardStep3Container.jsx (2 hours)
A) WizardStep3Container.tsx (2 hours)
- Create state object:
{
mode: 'quick' | 'detailed',
@@ -1284,23 +1290,23 @@ A) WizardStep3Container.jsx (2 hours)
- Implement navigation logic (next, prev, skip)
- Implement conditional rendering of sub-steps based on mode
- Handle loading/error states
- Connect to Redux (or context) for wizard state
- Connect to Zustand store for wizard state
B) AttributeReviewPanel.jsx (1.5 hours)
B) AttributeReviewPanel.tsx (1.5 hours)
- Render three sections: Primary, Secondary, Tertiary
- For each attribute: toggle + values + edit/delete + reorder
- Implement inline edit modal for values
- Implement "+ Add Custom Attribute" form
- Show completeness status (ready/thin/empty)
C) BusinessDetailsForm.jsx (1 hour)
C) BusinessDetailsForm.tsx (1 hour)
- Five input fields: products, services, brands, locations, conditions
- Implement text parsing (comma-separated, line-break)
- Show "x items detected" feedback
- Implement validation (at least one field, max 50 items)
- Pass data to parent state on change
D) BlueprintPreviewPanel.jsx (1.5 hours)
D) BlueprintPreviewPanel.tsx (1.5 hours)
- Render tree view of clusters
- Each cluster: name, type badge, keyword count, content plan count
- Expand/collapse per cluster
@@ -1321,7 +1327,7 @@ Tests:
#### Task 6: Integrate Wizard Navigation (2 hours)
```
Location: frontend/src/routes/wizard.js (or similar routing)
Location: frontend/src/routes/wizard.tsx (or similar routing)
- Update router to include Step 3 routes
- Implement navigation logic:
- Step 1 → Step 2 (always)
@@ -1329,15 +1335,15 @@ Location: frontend/src/routes/wizard.js (or similar routing)
- Step 3a → Step 3b (Detailed) or Step 3e (Quick)
- Step 3b → Step 3c, Step 3c → Step 3d, Step 3d → Step 3e
- Step 3e → Step 3f, Step 3f → Step 4
- Implement state persistence (Redux or localStorage)
- Implement state persistence (Zustand store with localStorage persist)
- Test Quick Mode flow and Detailed Mode flow (E2E)
```
#### Task 7: Update Step 1 (Welcome) (1 hour)
```
Location: frontend/src/components/wizard/WizardStep1.jsx (or similar)
Location: frontend/src/components/wizard/WizardStep1.tsx (or similar)
- Add mode selection UI (quick vs. detailed)
- Store mode in wizard state (Redux/context)
- Store mode in wizard state (Zustand store)
- Pass mode to WizardStep3Container
- Test mode selection
```
@@ -1383,7 +1389,7 @@ Location: wordpress-plugin/igny8-blueprint-sync.php (or similar)
- Test data persistence and transitions
- Frontend: E2E test both wizard flows
- Location: frontend/tests/e2e/wizard.test.js (Selenium/Cypress)
- Location: frontend/tests/e2e/wizard.test.ts (Vitest/Playwright)
- Test Quick Mode: 10 min, full journey
- Test Detailed Mode: 20 min, full journey
- Test error scenarios (invalid input, API failure)
@@ -1492,6 +1498,7 @@ Location: wordpress-plugin/igny8-blueprint-sync.php (or similar)
| Version | Date | Author | Change |
|---------|------|--------|--------|
| 1.0 | 2026-03-23 | System | Initial draft |
| 1.1 | 2025-07-14 | Codebase Audit | Fixed: model inheritance (AccountBaseModel), FK app_labels, .jsx→.tsx, Redux→Zustand, GET→POST AC-3a-1, version refs |
---