Component boundaries
In the proposed design, the editor manages the author's intent, a worker prepares a version, and publishing serves visitors.
A long build does not hold a browser request open or replace a working page piece by piece.
Responsibilities
| Component | What it does | What it must not receive |
|---|---|---|
| Editor | Request, materials, progress, preview, history | AI and storage keys |
| API | Authentication, project permissions, jobs, version selection | Arbitrary generated code execution inside its process |
| Worker | Generation, file preparation, result checks | Unrestricted access to other projects |
| PostgreSQL | Owners, jobs, versions, domain bindings | Large images and build archives |
| Object storage | Materials and immutable results | Public drafts and internal repositories |
| Publication delivery | Domain → site → active version | An AI call on every visit |
This is a responsibility design. A dedicated generation worker and domain router do not exist yet.
Communication
The API first saves a job and returns its ID. The editor reads its state; events can speed up screen updates but are not the sole source of progress. After a tab reload, state is restored from saved data.
The worker receives the job, prepares a separate version and reports the result. The API does not consider a site ready just because the model answered: files and passed checks are required. Lifecycle.
Boundaries in code
CleanSlice separates responsibilities: HTTP accepts and validates input, the domain describes the use case, a gateway defines a data-access contract, and its implementation works with a specific storage system. Prisma schemas are assembled from slice files. These rules do not mean every slice becomes a separate service.
Existing entry points are listed in the technical foundation. New slice names, API methods and schema fields are not presented here as existing contracts.