Files
igny8/docs/planning/phases/PHASE-5-SITES-RENDERER.md
IGNY8 VPS (Salman) 455358ecfc Refactor domain structure to business layer
- Renamed `domain/` to `business/` to better reflect the organization of code by business logic.
- Updated all relevant file paths and references throughout the project to align with the new structure.
- Ensured that all models and services are now located under the `business/` directory, maintaining existing functionality while improving clarity.
2025-11-16 21:47:51 +00:00

182 lines
4.9 KiB
Markdown

# PHASE 5: SITES RENDERER
**Detailed Implementation Plan**
**Goal**: Build Sites renderer for hosting public sites.
**Timeline**: 2-3 weeks
**Priority**: MEDIUM
**Dependencies**: Phase 3
---
## TABLE OF CONTENTS
1. [Overview](#overview)
2. [Sites Renderer Container](#sites-renderer-container)
3. [Publisher Service](#publisher-service)
4. [Publishing Models](#publishing-models)
5. [Publisher API](#publisher-api)
6. [Multiple Layout Options](#multiple-layout-options)
7. [Testing & Validation](#testing--validation)
8. [Implementation Checklist](#implementation-checklist)
---
## OVERVIEW
### Objectives
- ✅ Create Sites renderer container
- ✅ Build publisher service
- ✅ Support multiple layout options
- ✅ Deploy sites to public URLs
- ✅ Render sites from site definitions
### Key Principles
- **Component Reuse**: Use shared component library from Phase 3
- **Multiple Layouts**: Support 7 layout types
- **Public Access**: Sites accessible via public URLs
- **User-Friendly**: "My Websites" or "Published Sites" in UI
---
## SITES RENDERER CONTAINER
### 5.1 Sites Renderer Container
**User-Friendly Name**: "My Websites" or "Published Sites"
| Task | File | Dependencies | Implementation |
|------|------|--------------|----------------|
| **Create Sites Container** | `docker-compose.app.yml` | None | Add new container for sites renderer |
| **Sites Renderer Frontend** | `sites/src/` | NEW | React app for rendering sites |
| **Site Definition Loader** | `sites/src/loaders/loadSiteDefinition.ts` | NEW | Load site definitions from API |
| **Layout Renderer** | `sites/src/utils/layoutRenderer.ts` | NEW | Render different layouts |
| **Template System** | `sites/src/utils/templateEngine.ts` | NEW | Template rendering system |
**Docker Compose Configuration**:
```yaml
# docker-compose.app.yml
igny8_sites:
build: ./sites
ports:
- "8024:5176"
volumes:
- /data/app/igny8/sites:/app
- /data/app/sites-data:/sites
environment:
- VITE_API_URL=http://igny8_backend:8010
```
---
## PUBLISHER SERVICE
### 5.2 Publisher Service
| Task | File | Dependencies | Implementation |
|------|------|--------------|----------------|
| **PublisherService** | `business/publishing/services/publisher_service.py` | Phase 1 | Main publishing service |
| **SitesRendererAdapter** | `business/publishing/services/adapters/sites_renderer_adapter.py` | Phase 3 | Adapter for Sites renderer |
| **DeploymentService** | `business/publishing/services/deployment_service.py` | Phase 3 | Deploy sites to renderer |
**PublisherService**:
```python
# business/publishing/services/publisher_service.py
class PublisherService:
def publish_to_sites(self, site_blueprint):
"""Publish site to Sites renderer"""
adapter = SitesRendererAdapter()
return adapter.deploy(site_blueprint)
```
---
## PUBLISHING MODELS
### 5.3 Publishing Models
| Task | File | Dependencies | Implementation |
|------|------|--------------|----------------|
| **PublishingRecord Model** | `business/publishing/models.py` | Phase 1 | Track content publishing |
| **DeploymentRecord Model** | `business/publishing/models.py` | Phase 3 | Track site deployments |
---
## PUBLISHER API
### 5.4 Publisher API
| Task | File | Dependencies | Implementation |
|------|------|--------------|----------------|
| **Publisher ViewSet** | `modules/publisher/views.py` | PublisherService | API for publishing operations |
---
## MULTIPLE LAYOUT OPTIONS
### 5.6 Multiple Layout Options
**Layout Types**:
- Default (Standard)
- Minimal (Clean, simple)
- Magazine (Editorial, content-focused)
- Ecommerce (Product-focused)
- Portfolio (Showcase)
- Blog (Content-first)
- Corporate (Business)
| Task | File | Dependencies | Implementation |
|------|------|--------------|----------------|
| **Layout Configuration** | `business/site_building/models.py` | Phase 3 | Store layout selection |
| **Layout Renderer** | `sites/src/utils/layoutRenderer.ts` | Phase 5 | Render different layouts |
---
## TESTING & VALIDATION
### 5.5 Testing
**Test Cases**:
- ✅ Sites renderer loads site definitions
- ✅ Blocks render correctly
- ✅ Deployment works end-to-end
- ✅ Sites are accessible publicly
- ✅ Multiple layouts work correctly
---
## IMPLEMENTATION CHECKLIST
### Backend Tasks
- [ ] Create PublisherService
- [ ] Create SitesRendererAdapter
- [ ] Create DeploymentService
- [ ] Create PublishingRecord model
- [ ] Create DeploymentRecord model
- [ ] Create Publisher ViewSet
### Frontend Tasks
- [ ] Create Sites container in docker-compose
- [ ] Create sites renderer frontend
- [ ] Create site definition loader
- [ ] Create layout renderer
- [ ] Create template system
- [ ] Import shared components
---
## SUCCESS CRITERIA
- ✅ Sites renderer loads site definitions
- ✅ Blocks render correctly
- ✅ Deployment works end-to-end
- ✅ Sites are accessible publicly
- ✅ Multiple layouts supported
---
**END OF PHASE 5 DOCUMENT**