140 lines
4.2 KiB
Markdown
140 lines
4.2 KiB
Markdown
# Site Builder URLs and File Management
|
|
|
|
## Summary of Implementation
|
|
|
|
### ✅ Generate Page Content Step
|
|
|
|
**Location**: `frontend/src/pages/Sites/Builder/Preview.tsx`
|
|
|
|
**Implementation**:
|
|
- Added "Generate All Pages" button (shown when blueprint status is `'ready'`)
|
|
- Button triggers `generateAllPages()` from `builderStore`
|
|
- Shows ProgressModal during generation
|
|
- Uses existing `PageGenerationService.bulk_generate_pages()` backend function
|
|
|
|
**Queue Function**: ✅ **EXISTS**
|
|
- `PageGenerationService.bulk_generate_pages()` creates Writer Tasks
|
|
- Tasks are queued via `ContentGenerationService.generate_content()`
|
|
- Each page blueprint gets a Writer Task with title: `"[Site Builder] {page_title}"`
|
|
- Tasks are processed by Celery workers
|
|
|
|
---
|
|
|
|
## URL Standards
|
|
|
|
### Public Site URLs (Deployed Sites)
|
|
|
|
**Current Implementation** (Placeholder):
|
|
- Pattern: `https://{site_id}.igny8.com`
|
|
- Generated by: `SitesRendererAdapter._get_deployment_url()`
|
|
- Location: `backend/igny8_core/business/publishing/services/adapters/sites_renderer_adapter.py:191`
|
|
|
|
**Planned Implementation** (from docs):
|
|
- Custom domains: `clientdomain.com` → routed via Caddy
|
|
- Subdomain: `mysite.igny8.com` → routed via Caddy
|
|
- Marketing site: `igny8.com` → `/igny8-sites/marketing/`
|
|
|
|
**Sites Renderer Routes**:
|
|
- Public routes: `/:siteId/*` (no auth required)
|
|
- Loads from: `/data/app/sites-data/clients/{site_id}/v{version}/`
|
|
|
|
---
|
|
|
|
### Admin/Management URLs (Frontend App)
|
|
|
|
**Site Management Routes** (from `frontend/src/App.tsx`):
|
|
- `/sites` - All sites list
|
|
- `/sites/:id` - Site dashboard
|
|
- `/sites/:id/content` - Site content list
|
|
- `/sites/:id/editor` - Site content editor
|
|
- `/sites/:id/pages` - Page manager
|
|
- `/sites/:id/pages/new` - Create new page
|
|
- `/sites/:id/pages/:pageId/edit` - Edit page
|
|
- `/sites/:id/posts/:postId` - View/edit post
|
|
- `/sites/:id/posts/:postId/edit` - Edit post
|
|
- `/sites/:id/preview` - Site preview
|
|
- `/sites/:id/settings` - Site settings (General, SEO, OG, Schema, Integrations)
|
|
- `/sites/manage` - Site management dashboard
|
|
|
|
**Site Builder Routes**:
|
|
- `/sites/builder` - Site Builder wizard
|
|
- `/sites/builder/preview` - Preview blueprint (with Generate All Pages button)
|
|
- `/sites/blueprints` - Blueprints list
|
|
|
|
---
|
|
|
|
## File Management
|
|
|
|
### File Storage Structure
|
|
|
|
**Site Files**:
|
|
```
|
|
/data/app/sites-data/
|
|
└── clients/
|
|
└── {site_id}/
|
|
└── v{version}/
|
|
├── site.json
|
|
├── pages/
|
|
│ ├── home.json
|
|
│ ├── about.json
|
|
│ └── ...
|
|
└── assets/ # User-managed files
|
|
├── images/
|
|
├── documents/
|
|
└── media/
|
|
```
|
|
|
|
**Service**: `SiteBuilderFileService`
|
|
- Location: `backend/igny8_core/business/site_building/services/file_management_service.py`
|
|
- Base path: `/data/app/sites-data/clients`
|
|
- Max file size: 10MB per file
|
|
- Max storage per site: 100MB
|
|
|
|
### User Access Rules
|
|
|
|
- **Owner/Admin**: Full access to all account sites
|
|
- **Editor**: Access to granted sites (via SiteUserAccess)
|
|
- **Viewer**: Read-only access to granted sites
|
|
- File operations scoped to user's accessible sites only
|
|
|
|
### File Manager UI
|
|
|
|
**Status**: ⚠️ **NOT YET IMPLEMENTED**
|
|
|
|
**Planned** (from Phase 3 docs):
|
|
- File Browser UI: `site-builder/src/components/files/FileBrowser.tsx`
|
|
- File Upload API: `modules/site_builder/views.py`
|
|
- Storage quota check: `infrastructure/storage/file_storage.py`
|
|
|
|
**Expected Routes** (not yet in App.tsx):
|
|
- `/sites/:id/files` - File manager for site assets
|
|
- `/sites/:id/files/upload` - Upload files
|
|
- `/sites/:id/files/:fileId` - View/edit file
|
|
|
|
---
|
|
|
|
## Docker Volumes
|
|
|
|
**From `docker-compose.app.yml`**:
|
|
```yaml
|
|
igny8_sites:
|
|
volumes:
|
|
- /data/app/igny8/sites:/app
|
|
- /data/app/sites-data:/sites # Site definitions and assets
|
|
```
|
|
|
|
**Environment Variable**:
|
|
- `SITES_DATA_PATH=/sites` (inside container)
|
|
- Maps to `/data/app/sites-data` on host
|
|
|
|
---
|
|
|
|
## Next Steps
|
|
|
|
1. ✅ **Generate All Pages button** - Added to Preview page
|
|
2. ⏳ **File Manager UI** - Needs to be implemented
|
|
3. ⏳ **Deployment URL generation** - Currently placeholder, needs real domain mapping
|
|
4. ⏳ **Caddy routing configuration** - For custom domains
|
|
5. ⏳ **File upload API endpoints** - For user file management
|
|
|