# Editable project ZIPs

This feature belongs to the main DocuDeck authoring application.

## Using it

1. Save your presentation and activities and wait for processing to finish.
2. From the project's action menu in the workspace, choose **Export editable project**.
3. To restore it, choose **Add new project → Import project ZIP**, select the `.docudeck.zip`, and optionally give the copy a new title.
4. The imported project opens in the authoring application. Review it, generate slide images if pending, and build a new SCORM package.

The import destination is the currently selected personal or organization workspace. Organization imports require an active organization administrator. Editable exports require the project owner, organization administrator, or ultimate administrator. Shared editors/viewers retain their existing permissions; package download permission does not grant editable export permission.

## Contents and independence

The version-one archive includes the original presentation, saved native drafts and restore documents, images, project fonts, slide structure, quizzes, assessments, media and captions, narration, H5P authoring data/assets, course flow, and project settings. Stable tracking keys and revision relationships are retained inside the copy.

Import creates a new project and remaps project/record IDs, file paths, and links. It assigns ownership to the importing user/workspace. Accounts, passwords, provider credentials, sharing grants, public links, organization assignments, job history, and compiled SCORM packages are excluded. Existing projects are not overwritten. The ZIP contains editable teaching content and should be shared only with intended recipients.

H5P activities use approved libraries already installed in the destination application. The archive records exact machine name, version, patch, and checksum; missing or unapproved versions produce an import error naming the required library. Project import does not install executable library code. This is an editable-project format, not a generic SCORM or PowerPoint ZIP importer.

## API and deployment

- `GET /api/v1/projects/{id}/export`: authenticated, manager-only, downloads a versioned project archive.
- `POST /api/v1/projects/import`: authenticated multipart `file`, optional `course_title`, optional `organization_id`; returns the new project summary with HTTP 201.

No database migration is required for this feature; deploy the backend code and built frontend together on a fully migrated DocuDeck installation. PHP's ZipArchive extension and a writable private system temporary directory are required. Destination workspace project and storage quotas apply.

Defaults: 512 MiB uploaded ZIP, 1 GiB expanded archive, 10,000 entries, 16 MiB manifest, 100 MiB individual JSON file, 2 MiB SVG, and 30,000 records. Configure `PROJECT_ARCHIVE_MAX_UPLOAD_KB` and `PROJECT_ARCHIVE_MAX_EXPANDED_BYTES` as needed. Also configure PHP `upload_max_filesize`, `post_max_size`, `memory_limit`, execution time, reverse-proxy request size/timeouts, and available temporary disk space to accommodate the intended course sizes. Regenerate cached Laravel configuration after changing environment values.

ZIP entries are streamed to private staging and checked for traversal, duplicates, encryption, symlinks, executable files, expanded size, compression ratio, sizes, and SHA-256 checksums. Manifest fields and relational scope are restricted. H5P content hashes are verified and updated when asset IDs change. Existing H5P malware-scanner policy also applies. Database and destination files are rolled back/removed on failed imports. Downloads are temporary files removed after sending.

The archive exports saved state; unsaved browser edits must be saved first. Runtime/LMS behavior and production deployment remain separate acceptance checks from automated round-trip tests.
