# ablelm/ai_web_sites_constructor architecture

> Architecture diagram of the GitHub repository ablelm/ai_web_sites_constructor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ablelm/ai_web_sites_constructor
- Repository: https://github.com/ablelm/ai_web_sites_constructor

## Overview

YouPilot is a Django AI landing-page builder. A user supplies a business brief; the application queues generation, runs a structured AI workflow, stores a validated site document as a version, and exposes editing, preview/publication, and export. The README also documents accounts, dashboard, lead capture, and a billing foundation. The sampled generator, editor, and publishing code supports several internal relationships; other product branches are connected only where the README documents them. The tree does not include the README-mentioned assets app, so it is not represented as a source node.

Main entry points: [`apps/generator/services.py`](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/generator/services.py) (Generation pipeline), [`apps/projects/models.py`](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/projects/models.py) (Projects and versions), [`apps/projects/views.py`](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/projects/views.py) (Project workflows), [`apps/editor/services.py`](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/editor/services.py) (Document operations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User access"]
  node_accounts["Accounts<br/>[views.py]"]
  node_dashboard["Project dashboard<br/>[views.py]"]
end

subgraph group_creation["Site creation"]
  node_projects[("Projects and versions<br/>[models.py]")]
  node_project_flow["Project workflows<br/>[views.py]"]
  node_jobs[("Generation jobs<br/>[models.py]")]
  node_worker["Database worker<br/>[runworker.py]"]
  node_generation["Generation pipeline<br/>[services.py]"]
  node_ai_client["AI client<br/>[client.py]"]
  node_ai_contracts["AI schemas<br/>[schemas.py]"]
  node_ai_prompts["AI prompts<br/>[prompts.py]"]
end

subgraph group_delivery["Editing and publishing"]
  node_editor_views["Editor endpoints<br/>[views.py]"]
  node_editor_ops["Document operations<br/>[services.py]"]
  node_publishing_views["Preview and publishing<br/>[views.py]"]
  node_publishing["Rendering and ZIP export<br/>[services.py]"]
end

subgraph group_operations["Product services"]
  node_leads["Lead capture<br/>[views.py]"]
  node_billing["Billing foundation<br/>[services.py]"]
  node_provider["Payment provider<br/>[providers.py]"]
end

node_user(("Site owner"))
node_ai_service{{"YouPilot AI service"}}

node_user -->|"signs in"| node_accounts
node_user -->|"manages sites"| node_dashboard
node_dashboard -->|"lists projects"| node_projects
node_user -->|"submits brief"| node_project_flow
node_project_flow -->|"creates project"| node_projects
node_project_flow -->|"queues generation"| node_jobs
node_worker -->|"runs jobs"| node_generation
node_generation -->|"requests generation"| node_ai_client
node_ai_client -->|"calls API"| node_ai_service
node_generation -->|"builds prompts"| node_ai_prompts
node_ai_prompts -->|"uses schemas"| node_ai_contracts
node_generation -->|"validates output"| node_ai_contracts
node_generation -->|"saves versions"| node_projects
node_user -->|"edits site"| node_editor_views
node_editor_views -->|"applies changes"| node_editor_ops
node_editor_ops -->|"versions document"| node_projects
node_editor_ops -->|"requests AI edits"| node_ai_client
node_user -->|"previews or publishes"| node_publishing_views
node_publishing_views -.->|"renders or exports"| node_publishing
node_publishing -->|"reads site document"| node_projects
node_user -->|"submits inquiry"| node_leads
node_user -.->|"uses billing"| node_billing
node_billing -.->|"supports adapter"| node_provider

click node_accounts "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/accounts/views.py"
click node_dashboard "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/dashboard/views.py"
click node_projects "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/projects/models.py"
click node_project_flow "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/projects/views.py"
click node_jobs "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/generator/models.py"
click node_worker "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/generator/management/commands/runworker.py"
click node_generation "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/generator/services.py"
click node_ai_client "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/ai/client.py"
click node_ai_contracts "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/ai/schemas.py"
click node_ai_prompts "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/ai/prompts.py"
click node_editor_views "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/editor/views.py"
click node_editor_ops "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/editor/services.py"
click node_publishing_views "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/publishing/views.py"
click node_publishing "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/publishing/services.py"
click node_leads "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/leads/views.py"
click node_billing "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/billing/services.py"
click node_provider "https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/billing/providers.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_accounts,node_dashboard toneBlue
class node_projects,node_project_flow,node_jobs,node_worker,node_generation,node_ai_client,node_ai_contracts,node_ai_prompts toneAmber
class node_editor_views,node_editor_ops,node_publishing_views,node_publishing toneMint
class node_leads,node_billing,node_provider toneRose
class node_user,node_ai_service toneIndigo
```

## Components

### User access

- [Accounts](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/accounts/views.py): `apps/accounts/views.py`
- [Project dashboard](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/dashboard/views.py): `apps/dashboard/views.py`

### Site creation

- [Projects and versions](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/projects/models.py): `apps/projects/models.py`
- [Project workflows](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/projects/views.py): `apps/projects/views.py`
- [Generation jobs](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/generator/models.py): `apps/generator/models.py`
- [Database worker](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/generator/management/commands/runworker.py): `apps/generator/management/commands/runworker.py`
- [Generation pipeline](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/generator/services.py): `apps/generator/services.py`
- [AI client](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/ai/client.py): `apps/ai/client.py`
- [AI schemas](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/ai/schemas.py): `apps/ai/schemas.py`
- [AI prompts](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/ai/prompts.py): `apps/ai/prompts.py`

### Editing and publishing

- [Editor endpoints](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/editor/views.py): `apps/editor/views.py`
- [Document operations](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/editor/services.py): `apps/editor/services.py`
- [Preview and publishing](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/publishing/views.py): `apps/publishing/views.py`
- [Rendering and ZIP export](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/publishing/services.py): `apps/publishing/services.py`

### Product services

- [Lead capture](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/leads/views.py): `apps/leads/views.py`
- [Billing foundation](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/billing/services.py): `apps/billing/services.py`
- [Payment provider](https://github.com/ablelm/ai_web_sites_constructor/blob/main/apps/billing/providers.py): `apps/billing/providers.py`

### Other components

- **Site owner**
- **YouPilot AI service**

## Connections

- Site owner → Accounts: signs in
- Site owner → Project dashboard: manages sites
- Project dashboard → Projects and versions: lists projects (evidence: `apps/dashboard/views.py`)
- Site owner → Project workflows: submits brief
- Project workflows → Projects and versions: creates project (evidence: `apps/projects/views.py`)
- Project workflows → Generation jobs: queues generation (evidence: `apps/projects/views.py`)
- Database worker → Generation pipeline: runs jobs (evidence: `apps/generator/management/commands/runworker.py`)
- Generation pipeline → AI client: requests generation (evidence: `apps/generator/services.py`)
- AI client → YouPilot AI service: calls API (evidence: `apps/ai/client.py`)
- Generation pipeline → AI prompts: builds prompts (evidence: `apps/generator/services.py`)
- AI prompts → AI schemas: uses schemas (evidence: `apps/ai/prompts.py`)
- Generation pipeline → AI schemas: validates output (evidence: `apps/generator/services.py`)
- Generation pipeline → Projects and versions: saves versions (evidence: `apps/generator/services.py`)
- Site owner → Editor endpoints: edits site
- Editor endpoints → Document operations: applies changes (evidence: `apps/editor/views.py`)
- Document operations → Projects and versions: versions document (evidence: `apps/editor/services.py`)
- Document operations → AI client: requests AI edits (evidence: `apps/editor/services.py`)
- Site owner → Preview and publishing: previews or publishes
- Preview and publishing → Rendering and ZIP export: renders or exports
- Rendering and ZIP export → Projects and versions: reads site document (evidence: `apps/publishing/services.py`)
- Site owner → Lead capture: submits inquiry
- Site owner → Billing foundation: uses billing
- Billing foundation → Payment provider: supports adapter
