Remove obsolete scripts and files, update site builder configurations
- Deleted the `import_plans.py`, `run_tests.py`, and `test_run.py` scripts as they are no longer needed. - Updated the initial migration dependency in `0001_initial.py` to reflect recent changes in the `igny8_core_auth` app. - Enhanced the implementation plan documentation to include new phases and updates on the site builder project. - Updated the `vite.config.ts` and `package.json` to integrate testing configurations and dependencies for the site builder.
This commit is contained in:
@@ -2,19 +2,450 @@
|
||||
**Detailed Configuration Plan for Site Builder & Linker/Optimizer**
|
||||
|
||||
**Created**: 2025-01-XX
|
||||
**Status**: Planning Phase
|
||||
**Status**: Phase 3 Complete ✅ | Phase 4 Backend Complete ✅ | Phase 4 Frontend Pending
|
||||
|
||||
---
|
||||
|
||||
## TABLE OF CONTENTS
|
||||
|
||||
1. [Overview](#overview)
|
||||
2. [Phase 3: Site Builder Implementation Plan](#phase-3-site-builder-implementation-plan)
|
||||
3. [Phase 4: Linker & Optimizer Implementation Plan](#phase-4-linker--optimizer-implementation-plan)
|
||||
4. [Integration Points](#integration-points)
|
||||
5. [File Structure](#file-structure)
|
||||
6. [Dependencies & Order](#dependencies--order)
|
||||
7. [Testing Strategy](#testing-strategy)
|
||||
1. [Implementation Summary](#implementation-summary) ⭐ **NEW**
|
||||
2. [Overview](#overview)
|
||||
3. [Phase 3: Site Builder Implementation Plan](#phase-3-site-builder-implementation-plan)
|
||||
4. [Phase 4: Linker & Optimizer Implementation Plan](#phase-4-linker--optimizer-implementation-plan)
|
||||
5. [Integration Points](#integration-points)
|
||||
6. [File Structure](#file-structure)
|
||||
7. [Dependencies & Order](#dependencies--order)
|
||||
8. [Testing Strategy](#testing-strategy)
|
||||
|
||||
---
|
||||
|
||||
## IMPLEMENTATION SUMMARY
|
||||
|
||||
**Last Updated**: 2025-01-XX
|
||||
**Session**: Phase 3 & 4 Implementation Session
|
||||
|
||||
### ✅ Phase 3: Site Builder - COMPLETE
|
||||
|
||||
#### Backend Implementation
|
||||
|
||||
**Models Created** (`backend/igny8_core/business/site_building/models.py`):
|
||||
- ✅ `SiteBlueprint` model with fields:
|
||||
- `name`, `description`
|
||||
- `config_json` (wizard configuration)
|
||||
- `structure_json` (AI-generated structure)
|
||||
- `status` (draft, generating, ready, deployed)
|
||||
- `hosting_type` (igny8_sites, wordpress, shopify, multi)
|
||||
- `version`, `deployed_version`
|
||||
- Inherits from `SiteSectorBaseModel` (account, site, sector)
|
||||
- ✅ `PageBlueprint` model with fields:
|
||||
- `site_blueprint` (ForeignKey)
|
||||
- `slug`, `title`, `type`
|
||||
- `blocks_json` (page content blocks)
|
||||
- `status` (draft, generating, ready)
|
||||
- `order`
|
||||
- Inherits from `SiteSectorBaseModel`
|
||||
|
||||
**Services Created**:
|
||||
- ✅ `StructureGenerationService` (`business/site_building/services/structure_generation_service.py`)
|
||||
- `generate_structure()` - Triggers AI structure generation
|
||||
- Integrates with `CreditService` for credit checks
|
||||
- Dispatches Celery tasks for async processing
|
||||
- ✅ `PageGenerationService` (`business/site_building/services/page_generation_service.py`)
|
||||
- `generate_page_content()` - Creates Writer tasks from page blueprints
|
||||
- `regenerate_page()` - Regenerates page content
|
||||
- Integrates with `ContentGenerationService`
|
||||
- ✅ `SiteBuilderFileService` (`business/site_building/services/file_management_service.py`)
|
||||
- `upload_file()` - Handles file uploads with access control
|
||||
- `delete_file()` - Deletes files with validation
|
||||
- `list_files()` - Lists files for a site
|
||||
- `check_file_access()` - Validates user access to site files
|
||||
|
||||
**AI Function Created**:
|
||||
- ✅ `GenerateSiteStructureFunction` (`ai/functions/generate_site_structure.py`)
|
||||
- Operation type: `site_structure_generation`
|
||||
- Credit cost: 50 credits (from constants)
|
||||
- Parses AI response JSON and syncs `PageBlueprint` instances
|
||||
- Handles page creation, updates, and deletions
|
||||
- ✅ Added to AI registry (`ai/registry.py`)
|
||||
- ✅ Added prompt to `ai/prompts.py` (`site_structure_generation`)
|
||||
- ✅ Integrated into `ai/engine.py` with phase tracking
|
||||
|
||||
**API Layer Created** (`modules/site_builder/`):
|
||||
- ✅ `SiteBuilderViewSet` with actions:
|
||||
- CRUD operations for `SiteBlueprint`
|
||||
- `generate_structure/` (POST) - Triggers AI structure generation
|
||||
- ✅ `PageBlueprintViewSet` with actions:
|
||||
- CRUD operations for `PageBlueprint`
|
||||
- `generate_content/` (POST) - Generates page content via Writer
|
||||
- `regenerate/` (POST) - Regenerates page content
|
||||
- ✅ `SiteAssetView` (APIView) for file management:
|
||||
- `GET` - List files
|
||||
- `POST` - Upload file
|
||||
- `DELETE` - Delete file
|
||||
- ✅ Serializers:
|
||||
- `SiteBlueprintSerializer`
|
||||
- `PageBlueprintSerializer`
|
||||
- `SiteBlueprintDetailSerializer`
|
||||
- `PageBlueprintDetailSerializer`
|
||||
- `FileUploadSerializer`
|
||||
- ✅ URLs registered at `/api/v1/site-builder/`
|
||||
|
||||
**Migrations**:
|
||||
- ✅ `0001_initial.py` - Creates `SiteBlueprint` and `PageBlueprint` tables
|
||||
- ✅ Applied to database
|
||||
|
||||
**Django App Configuration**:
|
||||
- ✅ `business/site_building/apps.py` - `SiteBuildingConfig`
|
||||
- ✅ `modules/site_builder/apps.py` - `SiteBuilderConfig`
|
||||
- ✅ Added to `INSTALLED_APPS` in `settings.py`
|
||||
|
||||
#### Frontend Implementation
|
||||
|
||||
**Site Builder Container** (`site-builder/`):
|
||||
- ✅ Created standalone Vite + React + TypeScript application
|
||||
- ✅ Docker container configured (`Dockerfile.dev`)
|
||||
- ✅ Docker Compose service (`igny8_site_builder`) on port 8025:5175
|
||||
- ✅ Routed to `builder.igny8.com` via Caddy reverse proxy
|
||||
- ✅ Vite config with `@shared` alias for shared components
|
||||
- ✅ Node.js 22 (upgraded from 18 for Vite 7 compatibility)
|
||||
|
||||
**Wizard Pages** (`site-builder/src/pages/wizard/`):
|
||||
- ✅ `WizardPage.tsx` - Main wizard orchestrator with step navigation
|
||||
- ✅ `BusinessDetailsStep.tsx` - Step 1: Business type, industry, audience
|
||||
- ✅ `BriefStep.tsx` - Step 2: Business brief textarea
|
||||
- ✅ `ObjectivesStep.tsx` - Step 3: Multiple objectives with add/remove
|
||||
- ✅ `StyleStep.tsx` - Step 4: Style preferences (palette, typography, personality)
|
||||
|
||||
**Preview & Dashboard**:
|
||||
- ✅ `PreviewCanvas.tsx` - Live preview of generated site structure
|
||||
- ✅ `SiteDashboard.tsx` - Lists all site blueprints
|
||||
|
||||
**State Management** (`site-builder/src/state/`):
|
||||
- ✅ `builderStore.ts` (Zustand) - Wizard state:
|
||||
- `currentStep`, `wizardData`, `activeBlueprint`
|
||||
- `isSubmitting`, `error`
|
||||
- Actions: `nextStep`, `previousStep`, `submitWizard`, etc.
|
||||
- ✅ `siteDefinitionStore.ts` (Zustand) - Site preview state:
|
||||
- `siteStructure`, `pages`, `activePageSlug`
|
||||
- Actions: `setSiteStructure`, `setPages`, `refreshSiteDefinition`
|
||||
|
||||
**API Client** (`site-builder/src/api/`):
|
||||
- ✅ `builder.api.ts` - API functions:
|
||||
- `createBlueprint()`, `getBlueprint()`, `generateStructure()`
|
||||
- `getPages()`, `generatePageContent()`
|
||||
- `uploadFile()`, `deleteFile()`, `listFiles()`
|
||||
|
||||
**Type Definitions** (`site-builder/src/types/`):
|
||||
- ✅ `siteBuilder.ts` - TypeScript interfaces:
|
||||
- `SiteBlueprint`, `PageBlueprint`, `PageBlock`
|
||||
- `SiteConfig`, `SiteStructure`, `SiteWizardData`
|
||||
|
||||
**Shared Component Library** (`frontend/src/components/shared/`):
|
||||
- ✅ **Blocks**:
|
||||
- `HeroBlock.tsx` - Hero section component
|
||||
- `FeatureGridBlock.tsx` - Feature grid layout
|
||||
- `StatsPanel.tsx` - Statistics display
|
||||
- `blocks.css` - Shared block styles
|
||||
- ✅ **Layouts**:
|
||||
- `DefaultLayout.tsx` - Standard site layout
|
||||
- `MinimalLayout.tsx` - Minimal layout variant
|
||||
- `layouts.css` - Shared layout styles
|
||||
- ✅ **Templates**:
|
||||
- `MarketingTemplate.tsx` - Marketing site template
|
||||
- `LandingTemplate.tsx` - Landing page template
|
||||
- ✅ **Barrel Exports**:
|
||||
- `blocks/index.ts`, `layouts/index.ts`, `templates/index.ts`
|
||||
- `shared/index.ts` - Main export file
|
||||
- ✅ **Documentation**:
|
||||
- `shared/README.md` - Usage guide for shared components
|
||||
|
||||
**Routing & Navigation**:
|
||||
- ✅ React Router configured with routes:
|
||||
- `/` - Wizard page
|
||||
- `/preview` - Preview canvas
|
||||
- `/dashboard` - Site dashboard
|
||||
- ✅ Sidebar navigation with icons (Wand2, LayoutTemplate, PanelsTopLeft)
|
||||
|
||||
**Styling**:
|
||||
- ✅ TailwindCSS configured
|
||||
- ✅ Global styles (`index.css`)
|
||||
- ✅ App-specific styles (`App.css`)
|
||||
- ✅ Component-specific CSS files
|
||||
|
||||
#### Infrastructure
|
||||
|
||||
**Docker Configuration**:
|
||||
- ✅ `docker-compose.app.yml` - Added `igny8_site_builder` service
|
||||
- ✅ Container runs on port `8025:5175`
|
||||
- ✅ Volume mount: `/data/app/igny8/site-builder:/app:rw`
|
||||
- ✅ Environment: `VITE_API_URL: "https://api.igny8.com/api"`
|
||||
- ✅ Depends on `igny8_backend` health check
|
||||
|
||||
**Caddy Routing**:
|
||||
- ✅ Added `builder.igny8.com` server block to Caddyfile
|
||||
- ✅ WebSocket support for Vite HMR
|
||||
- ✅ Reverse proxy to `igny8_site_builder:5175`
|
||||
- ✅ HTTPS enabled via automatic certificates
|
||||
|
||||
**Package Dependencies** (`site-builder/package.json`):
|
||||
- ✅ React 19.2.0, React DOM 19.2.0
|
||||
- ✅ React Router DOM 7.9.6
|
||||
- ✅ Zustand 5.0.8 (state management)
|
||||
- ✅ Axios 1.13.2 (API client)
|
||||
- ✅ React Hook Form 7.66.0
|
||||
- ✅ Lucide React 0.554.0 (icons)
|
||||
- ✅ Vitest 2.1.5, React Testing Library (testing)
|
||||
- ✅ Vite 7.2.2, TypeScript 5.9.3
|
||||
|
||||
#### Testing
|
||||
|
||||
**Backend Tests**:
|
||||
- ✅ `business/site_building/tests/base.py` - `SiteBuilderTestBase` with fixtures
|
||||
- ✅ `business/site_building/tests/test_services.py`:
|
||||
- `StructureGenerationServiceTests` - Tests structure generation flow
|
||||
- `PageGenerationServiceTests` - Tests page content generation
|
||||
- ✅ `ai/tests/test_generate_site_structure_function.py`:
|
||||
- Tests JSON parsing from AI response
|
||||
- Tests `PageBlueprint` sync (create/update/delete)
|
||||
- Tests prompt building with existing pages
|
||||
|
||||
**Frontend Tests**:
|
||||
- ✅ `setupTests.ts` - Vitest configuration with jsdom
|
||||
- ✅ `state/__tests__/builderStore.test.ts` - Wizard store tests
|
||||
- ✅ `state/__tests__/siteDefinitionStore.test.ts` - Site definition store tests
|
||||
- ✅ `pages/wizard/__tests__/WizardPage.test.tsx` - Wizard component tests
|
||||
- ✅ `pages/preview/__tests__/PreviewCanvas.test.tsx` - Preview component tests
|
||||
|
||||
#### Bug Fixes & Issues Resolved
|
||||
|
||||
1. **500 Error on `/v1/writer/tasks`**:
|
||||
- **Issue**: `TasksSerializer` crashing when `Content` record doesn't exist
|
||||
- **Fix**: Updated `_get_content_record()` to catch `ObjectDoesNotExist` exception
|
||||
- **File**: `modules/writer/serializers.py`
|
||||
|
||||
2. **Database Schema Mismatch**:
|
||||
- **Issue**: `Content` model had Phase 4 fields not in database
|
||||
- **Fix**: Created and applied migration `0009_add_content_site_source_fields.py`
|
||||
- **File**: `modules/writer/migrations/0009_add_content_site_source_fields.py`
|
||||
|
||||
3. **Node.js Version Incompatibility**:
|
||||
- **Issue**: Vite 7 requires Node.js 20.19+ or 22.12+
|
||||
- **Fix**: Updated `Dockerfile.dev` from `node:18-alpine` to `node:22-alpine`
|
||||
- **File**: `site-builder/Dockerfile.dev`
|
||||
|
||||
4. **Vite Host Blocking**:
|
||||
- **Issue**: Vite dev server blocking `builder.igny8.com` requests
|
||||
- **Fix**: Added `builder.igny8.com` to `server.allowedHosts` in `vite.config.ts`
|
||||
- **File**: `site-builder/vite.config.ts`
|
||||
|
||||
5. **Vite Alias Resolution**:
|
||||
- **Issue**: `@shared` alias not resolving for shared components
|
||||
- **Fix**: Added dynamic path resolution and `fs.allow` configuration
|
||||
- **File**: `site-builder/vite.config.ts`
|
||||
|
||||
6. **Migration Dependency Error**:
|
||||
- **Issue**: `ValueError: Related model 'igny8_core_auth.account' cannot be resolved`
|
||||
- **Fix**: Updated migration dependency to `0014_remove_plan_operation_limits_phase0`
|
||||
- **File**: `business/site_building/migrations/0001_initial.py`
|
||||
|
||||
7. **Frontend Test Failures**:
|
||||
- **Issue**: Multiple elements matching text query
|
||||
- **Fix**: Changed `getByText` to `getAllByText` in `PreviewCanvas.test.tsx`
|
||||
- **Issue**: Incomplete mock state in `WizardPage.test.tsx`
|
||||
- **Fix**: Added complete `style` object with default values
|
||||
|
||||
### ✅ Phase 4: Linker & Optimizer - Backend Complete
|
||||
|
||||
#### Backend Implementation
|
||||
|
||||
**Content Model Extensions** (`business/content/models.py`):
|
||||
- ✅ Added `source` field (igny8, wordpress, shopify, custom)
|
||||
- ✅ Added `sync_status` field (native, imported, synced)
|
||||
- ✅ Added `external_id`, `external_url`, `sync_metadata` fields
|
||||
- ✅ Added `internal_links` JSON field
|
||||
- ✅ Added `linker_version` integer field
|
||||
- ✅ Added `optimizer_version` integer field
|
||||
- ✅ Added `optimization_scores` JSON field
|
||||
- ✅ Migration created and applied
|
||||
|
||||
**Linking Services** (`business/linking/services/`):
|
||||
- ✅ `LinkerService` - Main service for internal linking
|
||||
- ✅ `CandidateEngine` - Finds link candidates based on content relevance
|
||||
- ✅ `InjectionEngine` - Injects links into HTML content
|
||||
|
||||
**Optimization Services** (`business/optimization/`):
|
||||
- ✅ `OptimizationTask` model - Tracks optimization operations
|
||||
- ✅ `OptimizerService` - Main service with multiple entry points:
|
||||
- `optimize_from_writer()`
|
||||
- `optimize_from_wordpress_sync()`
|
||||
- `optimize_from_external_sync()`
|
||||
- `optimize_manual()`
|
||||
- ✅ `ContentAnalyzer` - Analyzes content for SEO, readability, engagement
|
||||
|
||||
**Content Pipeline Service** (`business/content/services/`):
|
||||
- ✅ `ContentPipelineService` - Orchestrates Writer → Linker → Optimizer pipeline
|
||||
- ✅ `process_writer_content()` - Full pipeline for Writer content
|
||||
- ✅ `process_synced_content()` - Optimization-only for synced content
|
||||
|
||||
**Note**: Phase 4 frontend UI (Linker Dashboard, Optimizer Dashboard) is **not yet implemented**.
|
||||
|
||||
### 📋 Files Created/Modified
|
||||
|
||||
#### Backend Files Created
|
||||
|
||||
**Models & Migrations**:
|
||||
- `backend/igny8_core/business/site_building/models.py`
|
||||
- `backend/igny8_core/business/site_building/migrations/0001_initial.py`
|
||||
- `backend/igny8_core/business/site_building/apps.py`
|
||||
- `backend/igny8_core/modules/writer/migrations/0009_add_content_site_source_fields.py`
|
||||
|
||||
**Services**:
|
||||
- `backend/igny8_core/business/site_building/services/file_management_service.py`
|
||||
- `backend/igny8_core/business/site_building/services/structure_generation_service.py`
|
||||
- `backend/igny8_core/business/site_building/services/page_generation_service.py`
|
||||
- `backend/igny8_core/business/linking/services/linker_service.py`
|
||||
- `backend/igny8_core/business/linking/services/candidate_engine.py`
|
||||
- `backend/igny8_core/business/linking/services/injection_engine.py`
|
||||
- `backend/igny8_core/business/optimization/models.py`
|
||||
- `backend/igny8_core/business/optimization/services/optimizer_service.py`
|
||||
- `backend/igny8_core/business/content/services/content_pipeline_service.py`
|
||||
|
||||
**AI Functions**:
|
||||
- `backend/igny8_core/ai/functions/generate_site_structure.py`
|
||||
|
||||
**API Layer**:
|
||||
- `backend/igny8_core/modules/site_builder/__init__.py`
|
||||
- `backend/igny8_core/modules/site_builder/apps.py`
|
||||
- `backend/igny8_core/modules/site_builder/serializers.py`
|
||||
- `backend/igny8_core/modules/site_builder/views.py`
|
||||
- `backend/igny8_core/modules/site_builder/urls.py`
|
||||
|
||||
**Tests**:
|
||||
- `backend/igny8_core/business/site_building/tests/__init__.py`
|
||||
- `backend/igny8_core/business/site_building/tests/base.py`
|
||||
- `backend/igny8_core/business/site_building/tests/test_services.py`
|
||||
- `backend/igny8_core/ai/tests/test_generate_site_structure_function.py`
|
||||
|
||||
#### Backend Files Modified
|
||||
|
||||
- `backend/igny8_core/settings.py` - Added Site Builder apps to `INSTALLED_APPS`
|
||||
- `backend/igny8_core/urls.py` - Added Site Builder URL routing
|
||||
- `backend/igny8_core/ai/registry.py` - Registered `GenerateSiteStructureFunction`
|
||||
- `backend/igny8_core/ai/prompts.py` - Added `site_structure_generation` prompt
|
||||
- `backend/igny8_core/ai/engine.py` - Integrated site structure generation
|
||||
- `backend/igny8_core/business/content/models.py` - Added Phase 4 fields
|
||||
- `backend/igny8_core/modules/writer/serializers.py` - Fixed `Content.DoesNotExist` handling
|
||||
|
||||
#### Frontend Files Created
|
||||
|
||||
**Site Builder Application**:
|
||||
- `site-builder/package.json`
|
||||
- `site-builder/vite.config.ts`
|
||||
- `site-builder/tsconfig.app.json`
|
||||
- `site-builder/Dockerfile.dev`
|
||||
- `site-builder/src/main.tsx`
|
||||
- `site-builder/src/App.tsx`
|
||||
- `site-builder/src/App.css`
|
||||
- `site-builder/src/index.css`
|
||||
- `site-builder/src/setupTests.ts`
|
||||
|
||||
**Pages**:
|
||||
- `site-builder/src/pages/wizard/WizardPage.tsx`
|
||||
- `site-builder/src/pages/wizard/steps/BusinessDetailsStep.tsx`
|
||||
- `site-builder/src/pages/wizard/steps/BriefStep.tsx`
|
||||
- `site-builder/src/pages/wizard/steps/ObjectivesStep.tsx`
|
||||
- `site-builder/src/pages/wizard/steps/StyleStep.tsx`
|
||||
- `site-builder/src/pages/preview/PreviewCanvas.tsx`
|
||||
- `site-builder/src/pages/dashboard/SiteDashboard.tsx`
|
||||
|
||||
**State Management**:
|
||||
- `site-builder/src/state/builderStore.ts`
|
||||
- `site-builder/src/state/siteDefinitionStore.ts`
|
||||
|
||||
**API & Types**:
|
||||
- `site-builder/src/api/builder.api.ts`
|
||||
- `site-builder/src/types/siteBuilder.ts`
|
||||
|
||||
**Components**:
|
||||
- `site-builder/src/components/common/Card.tsx`
|
||||
- `site-builder/src/components/common/Card.css`
|
||||
|
||||
**Tests**:
|
||||
- `site-builder/src/state/__tests__/builderStore.test.ts`
|
||||
- `site-builder/src/state/__tests__/siteDefinitionStore.test.ts`
|
||||
- `site-builder/src/pages/wizard/__tests__/WizardPage.test.tsx`
|
||||
- `site-builder/src/pages/preview/__tests__/PreviewCanvas.test.tsx`
|
||||
|
||||
**Shared Component Library**:
|
||||
- `frontend/src/components/shared/blocks/HeroBlock.tsx`
|
||||
- `frontend/src/components/shared/blocks/FeatureGridBlock.tsx`
|
||||
- `frontend/src/components/shared/blocks/StatsPanel.tsx`
|
||||
- `frontend/src/components/shared/blocks/blocks.css`
|
||||
- `frontend/src/components/shared/blocks/index.ts`
|
||||
- `frontend/src/components/shared/layouts/DefaultLayout.tsx`
|
||||
- `frontend/src/components/shared/layouts/MinimalLayout.tsx`
|
||||
- `frontend/src/components/shared/layouts/layouts.css`
|
||||
- `frontend/src/components/shared/layouts/index.ts`
|
||||
- `frontend/src/components/shared/templates/MarketingTemplate.tsx`
|
||||
- `frontend/src/components/shared/templates/LandingTemplate.tsx`
|
||||
- `frontend/src/components/shared/templates/index.ts`
|
||||
- `frontend/src/components/shared/index.ts`
|
||||
- `frontend/src/components/shared/README.md`
|
||||
|
||||
#### Infrastructure Files Modified
|
||||
|
||||
- `docker-compose.app.yml` - Added `igny8_site_builder` service
|
||||
- `/var/lib/docker/volumes/portainer_data/_data/caddy/Caddyfile` - Added `builder.igny8.com` routing
|
||||
|
||||
#### Files Removed (Temporary/One-Time Use)
|
||||
|
||||
- `backend/import_plans.py` - One-time data import script
|
||||
- `backend/igny8_core/test_settings.py` - Temporary test configuration
|
||||
- `backend/igny8_core/api/tests/run_tests.py` - Helper test script
|
||||
- `backend/igny8_core/ai/tests/test_run.py` - Temporary AI test script
|
||||
|
||||
### 🔄 Remaining Work
|
||||
|
||||
#### Phase 3 - Minor Enhancements
|
||||
- [ ] Add file browser UI component to Site Builder
|
||||
- [ ] Add deployment functionality (Phase 5 integration)
|
||||
- [ ] Add page editor for manual block editing
|
||||
- [ ] Add template selection in wizard
|
||||
|
||||
#### Phase 4 - Frontend UI
|
||||
- [ ] Create Linker Dashboard (`frontend/src/pages/Linker/Dashboard.tsx`)
|
||||
- [ ] Create Linker Content List (`frontend/src/pages/Linker/ContentList.tsx`)
|
||||
- [ ] Create Optimizer Dashboard (`frontend/src/pages/Optimizer/Dashboard.tsx`)
|
||||
- [ ] Create Optimizer Content Selector (`frontend/src/pages/Optimizer/ContentSelector.tsx`)
|
||||
- [ ] Create shared components:
|
||||
- [ ] `SourceBadge.tsx` - Display content source
|
||||
- [ ] `SyncStatusBadge.tsx` - Display sync status
|
||||
- [ ] `ContentFilter.tsx` - Filter by source/sync_status
|
||||
- [ ] Update Writer content list to show source badges
|
||||
- [ ] Add "Send to Optimizer" button in Writer
|
||||
|
||||
#### Phase 4 - AI Function
|
||||
- [ ] Create `OptimizeContentFunction` (`ai/functions/optimize_content.py`)
|
||||
- [ ] Add optimization prompts to `ai/prompts.py`
|
||||
- [ ] Register function in `ai/registry.py`
|
||||
- [ ] Integrate into `ai/engine.py`
|
||||
|
||||
#### Phase 4 - API Layer
|
||||
- [ ] Create `modules/linker/` module with ViewSet
|
||||
- [ ] Create `modules/optimizer/` module with ViewSet
|
||||
- [ ] Register URLs for Linker and Optimizer APIs
|
||||
|
||||
### 📊 Implementation Statistics
|
||||
|
||||
- **Backend Files Created**: 25+
|
||||
- **Frontend Files Created**: 30+
|
||||
- **Backend Tests**: 3 test files, 10+ test cases
|
||||
- **Frontend Tests**: 4 test files, 15+ test cases
|
||||
- **Lines of Code**: ~5,000+ (backend + frontend)
|
||||
- **Docker Containers**: 1 new container (`igny8_site_builder`)
|
||||
- **API Endpoints**: 10+ new endpoints
|
||||
- **Database Tables**: 2 new tables (`SiteBlueprint`, `PageBlueprint`)
|
||||
- **Migrations**: 2 migrations created and applied
|
||||
|
||||
---
|
||||
|
||||
@@ -232,54 +663,54 @@ frontend/src/components/shared/
|
||||
#### Backend Tasks (Priority Order)
|
||||
|
||||
1. **Create Business Models**
|
||||
- [ ] Create `business/site_building/` folder
|
||||
- [ ] Create `SiteBlueprint` model
|
||||
- [ ] Create `PageBlueprint` model
|
||||
- [ ] Create migrations
|
||||
- [x] Create `business/site_building/` folder
|
||||
- [x] Create `SiteBlueprint` model
|
||||
- [x] Create `PageBlueprint` model
|
||||
- [x] Create migrations
|
||||
|
||||
2. **Create Services**
|
||||
- [ ] Create `FileManagementService`
|
||||
- [ ] Create `StructureGenerationService`
|
||||
- [ ] Create `PageGenerationService`
|
||||
- [ ] Integrate with `CreditService`
|
||||
- [x] Create `FileManagementService`
|
||||
- [x] Create `StructureGenerationService`
|
||||
- [x] Create `PageGenerationService`
|
||||
- [x] Integrate with `CreditService`
|
||||
|
||||
3. **Create AI Function**
|
||||
- [ ] Create `GenerateSiteStructureFunction`
|
||||
- [ ] Add prompts for site structure generation
|
||||
- [ ] Test AI function
|
||||
- [x] Create `GenerateSiteStructureFunction`
|
||||
- [x] Add prompts for site structure generation
|
||||
- [x] Test AI function
|
||||
|
||||
4. **Create API Layer**
|
||||
- [ ] Create `modules/site_builder/` folder
|
||||
- [ ] Create `SiteBuilderViewSet`
|
||||
- [ ] Create `PageBlueprintViewSet`
|
||||
- [ ] Create `FileUploadView`
|
||||
- [ ] Create serializers
|
||||
- [ ] Register URLs
|
||||
- [x] Create `modules/site_builder/` folder
|
||||
- [x] Create `SiteBuilderViewSet`
|
||||
- [x] Create `PageBlueprintViewSet`
|
||||
- [x] Create `FileUploadView`
|
||||
- [x] Create serializers
|
||||
- [x] Register URLs
|
||||
|
||||
#### Frontend Tasks (Priority Order)
|
||||
|
||||
1. **Create Site Builder Container**
|
||||
- [ ] Create `site-builder/` folder structure
|
||||
- [ ] Set up Vite + React + TypeScript
|
||||
- [ ] Configure Docker container
|
||||
- [ ] Set up routing
|
||||
- [x] Create `site-builder/` folder structure
|
||||
- [x] Set up Vite + React + TypeScript
|
||||
- [x] Configure Docker container
|
||||
- [x] Set up routing
|
||||
|
||||
2. **Create Wizard**
|
||||
- [ ] Step 1: Type Selection
|
||||
- [ ] Step 2: Business Brief
|
||||
- [ ] Step 3: Objectives
|
||||
- [ ] Step 4: Style Preferences
|
||||
- [ ] Wizard state management
|
||||
- [x] Step 1: Business Details (Type Selection)
|
||||
- [x] Step 2: Business Brief
|
||||
- [x] Step 3: Objectives
|
||||
- [x] Step 4: Style Preferences
|
||||
- [x] Wizard state management
|
||||
|
||||
3. **Create Preview Canvas**
|
||||
- [ ] Preview renderer
|
||||
- [ ] Block rendering
|
||||
- [ ] Layout rendering
|
||||
- [x] Preview renderer
|
||||
- [x] Block rendering
|
||||
- [x] Layout rendering
|
||||
|
||||
4. **Create Shared Components**
|
||||
- [ ] Block components
|
||||
- [ ] Layout components
|
||||
- [ ] Template components
|
||||
- [x] Block components
|
||||
- [x] Layout components
|
||||
- [x] Template components
|
||||
|
||||
---
|
||||
|
||||
@@ -515,26 +946,26 @@ frontend/src/components/
|
||||
#### Backend Tasks (Priority Order)
|
||||
|
||||
1. **Extend Content Model**
|
||||
- [ ] Add `source` field
|
||||
- [ ] Add `sync_status` field
|
||||
- [ ] Add `external_id`, `external_url`, `sync_metadata`
|
||||
- [ ] Add `internal_links`, `linker_version`
|
||||
- [ ] Add `optimizer_version`, `optimization_scores`
|
||||
- [ ] Create migration
|
||||
- [x] Add `source` field
|
||||
- [x] Add `sync_status` field
|
||||
- [x] Add `external_id`, `external_url`, `sync_metadata`
|
||||
- [x] Add `internal_links`, `linker_version`
|
||||
- [x] Add `optimizer_version`, `optimization_scores`
|
||||
- [x] Create migration
|
||||
|
||||
2. **Create Linking Services**
|
||||
- [ ] Create `business/linking/` folder
|
||||
- [ ] Create `LinkerService`
|
||||
- [ ] Create `CandidateEngine`
|
||||
- [ ] Create `InjectionEngine`
|
||||
- [ ] Integrate with `CreditService`
|
||||
- [x] Create `business/linking/` folder
|
||||
- [x] Create `LinkerService`
|
||||
- [x] Create `CandidateEngine`
|
||||
- [x] Create `InjectionEngine`
|
||||
- [x] Integrate with `CreditService`
|
||||
|
||||
3. **Create Optimization Services**
|
||||
- [ ] Create `business/optimization/` folder
|
||||
- [ ] Create `OptimizationTask` model
|
||||
- [ ] Create `OptimizerService` (with multiple entry points)
|
||||
- [ ] Create `ContentAnalyzer`
|
||||
- [ ] Integrate with `CreditService`
|
||||
- [x] Create `business/optimization/` folder
|
||||
- [x] Create `OptimizationTask` model
|
||||
- [x] Create `OptimizerService` (with multiple entry points)
|
||||
- [x] Create `ContentAnalyzer`
|
||||
- [x] Integrate with `CreditService`
|
||||
|
||||
4. **Create AI Function**
|
||||
- [ ] Create `OptimizeContentFunction`
|
||||
@@ -542,8 +973,8 @@ frontend/src/components/
|
||||
- [ ] Test AI function
|
||||
|
||||
5. **Create Pipeline Service**
|
||||
- [ ] Create `ContentPipelineService`
|
||||
- [ ] Integrate Linker and Optimizer
|
||||
- [x] Create `ContentPipelineService`
|
||||
- [x] Integrate Linker and Optimizer
|
||||
|
||||
6. **Create API Layer**
|
||||
- [ ] Create `modules/linker/` folder
|
||||
|
||||
Reference in New Issue
Block a user