> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scriptonia.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Project-Delivery

> What you receive, how to download it, how to push to GitHub, and how to use the generated blueprint.

## Understanding Deliverables

***

### What you get

Scriptonia produces a **project blueprint**: structured docs, specs, **LLM prompts**, and infra notes.

It is **not** a fully runnable app out of the box. You use the **prompts** and **specs** to generate or implement code, then deploy using the **infra** guidance.

***

### Common artifacts (all platforms)

| Artifact                 | Purpose                                                                                                                                                                 |
| :----------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **README.md**            | Auto-generated project overview: session, platform, description, features, target audience, tech requirements, execution summary, and pointer to `FOLDER_STRUCTURE.md`. |
| **FOLDER\_STRUCTURE.md** | Tree of the project (folders and files).                                                                                                                                |
| **REVIEW\_REPORT.md**    | ReviewAgent output: structure check, completeness, and any issues.                                                                                                      |

***

### By platform

***

#### Website

* `docs/` — PRD.md, PLAN.md, SEO\_CONTENT.md
* `frontend/` — nextjs.md, pages.md, components.md
* `frontend/prompts/` — generate\_static\_site.txt
* `content/` — blog/, assets/
* `infra/` — hosting.md, cdn\_caching.md
* `meta/` — github\_push.yaml

***

#### Web Application

* `docs/` — PRD, PLAN, HUMAN\_REVIEW, PROJECT\_RULES
* `frontend/` — react\_nextjs, components, state\_management
* `frontend/prompts/` — generate\_frontend.txt
* `backend/` — node\_express, services, auth
* `backend/apis/` — openapi.md
* `db/` — schema, migrations, orm\_models
* `infra/` — terraform, ci\_cd, monitoring, secrets\_management
* `testing/` — unit\_tests, api\_tests
* `meta/` — github\_push.yaml

***

#### Android

* `android/` — kotlin\_ui, fragments, navigation
* `android/prompts/` — generate\_android.txt
* `backend/` — api\_contracts, push\_notifications, node\_firebase
* `db/` — firebase\_schema
* `infra/` — gcp\_deploy
* `meta/`

***

#### iOS

* `ios/` — swiftui, storyboards, navigation, permissions
* `ios/prompts/` — generate\_ios.txt
* `backend/` — api\_contracts, push\_notifications, node\_firebase
* `db/` — local\_storage (CoreData)
* `infra/` — ci\_cd
* `meta/`

***

### File types

* **Markdown (.md)** — PRD, PLAN, specs, infra, README, FOLDER\_STRUCTURE, REVIEW\_REPORT
* **YAML (.yaml)** — github\_push, CI/CD or config
* **Prompts (.txt)** — LLM prompts used to generate actual code

***

## Downloading Projects

***

### When the download is available

On the **Execution** page, after:

1. **Review passed** — `review_passed === true`
2. **ZIP generation finished** — `POST /api/projects/generate` completed
3. **“Download Project ZIP”** is shown and **“ZIP file ready!”** appears

If **Review failed**, the download button is not shown.

***

### How to download

1. Click **“Download Project ZIP”** on the Execution page
2. App requests `GET /api/projects/download?sessionId=...`
3. Server returns a ZIP:
   * From **ZipFile** table, or
   * Built from project directory
4. File is saved as `<projectName>.zip` or `<sessionId>.zip`

***

### What’s in the ZIP

* Same layout as in **Understanding Deliverables**
* All paths under a single project root
* No extra `sessionId` folder unless defined by the template

***

### Completion page

The **Completion** page (`/completion?sessionId=...`) shows a summary and next steps.

* Main delivery (download, GitHub) happens on **Execution**
* Completion is a follow-up view
* You can start a new project from there

***

### If download fails

* **“Project not found” / “Please generate files first”** — Execution did not finish or Review failed
* **“Failed to download ZIP file”** — Network or server error; retry or contact support with `sessionId`

***

## GitHub Integration

***

### Connect GitHub

1. On the **Execution** page, click **“Connect to GitHub”**
2. Redirect to `/api/github/authorize?sessionId=...`
3. GitHub OAuth (scope: **repo**)
4. Redirect to `/api/github/callback`, which:
   * Exchanges code for token
   * Sets cookies
   * Redirects back to Execution
5. Execution page shows **Connected as \<username>** and **Upload to GitHub**

***

### Upload to GitHub

1. Click **“Upload to GitHub”**
2. Set:
   * Repository name
   * Description (optional)
   * Private / public
3. Confirm → `POST /api/github/upload`
4. Server:
   * Creates repo
   * Reads project files
   * Commits and pushes
5. Repo opens in a new tab

***

### Requirements

* GitHub OAuth configured
* Project files exist after generate
* `github_access_token` cookie present

***

### If upload fails

* **GitHub not connected** — Complete OAuth
* **Project files not found** — Generate did not complete
* **Failed to create repository** — Name conflict or missing scope

***

## Using Generated Code

***

### Blueprint, not a full app

The ZIP contains **specifications, prompts, and infra**, not runnable code.

***

### Suggested order

1. README.md
2. docs/PRD.md, docs/PLAN.md
3. Specs (frontend, backend, db)
4. Prompts
5. infra/

***

### Prompts

* Located in `frontend/prompts/`, `ios/prompts/`, `android/prompts/`
* Each `.txt` is an LLM prompt
* Use with matching specs and PRD/PLAN
* Adjust as needed

***

### Environment and secrets

* Use `.env.example` as a template
* Fill real values in `.env` or deployment config
* Do not commit secrets

***

### Deploy

* Follow **infra/** docs
* Use **meta/github\_push.yaml** for CI/CD
* Website: Vercel/Netlify
* Web apps: Docker, AWS, Vercel
* Mobile: App Store Connect, Play Console, Xcode Cloud, GCP

***

## Next Steps After Delivery

1. Review
2. Customize
3. Generate runnable code
4. Configure
5. Deploy
6. Iterate
7. New project
