# Video production: documentation site using Next.js

## Summary
A documentation site blueprint for video production built with Next.js on Ample. Domain schema includes:
- **customer_workspaces** (client_name, project_count): client organizations
- **projects** (workspace_id, title, stage, delivery_due_at): productions in flight
- **cuts** (project_id, version, object_key, review_status, reviewed_at): versioned cuts for review
- **customer_assets** (workspace_id, project_id, object_key, visibility): final deliverables and raw footage access
- **state_transitions** (record_type, from_state, to_state): the allowed state machine.

Public information includes: showreel and services, production process, contact. Kept out of scope until handling is reviewed: unreleased footage, talent releases and contracts, client brand material.

Technical basis verified on Next.js: a workspace-scoped table, an explicit state machine (draft to review to published) that rejects invalid transitions, and a cross-workspace read that returns nothing.

## Framework
- **Framework**: Next.js
- **Workload**: Documentation site
- **Industry**: Video production

## Prerequisites
- A Next.js project (next build then next start -H 0.0.0.0 -p $PORT on the node-22 template)
- A PostgreSQL driver reading DATABASE_URL (auto-provisioned when omitted)
- Bucket credentials from `ample bucket create` passed as encrypted S3_* environment variables and a published bucket for public assets (CDN_*)
- Review of which video production data classes may be handled at all.

## Workflow Steps
1. **Model the video production domain**
   - Create the tables customer_workspaces, projects, cuts, customer_assets, state_transitions.
2. **Workflow step 1**
   - Model versioned documents with a state machine (draft, review, published) scoped to a product version.
3. **Workflow step 2**
   - Publish assets for released versions to the CDN bucket.
4. **Workflow step 3**
   - Serve only published versions publicly.
5. **Workflow step 4**
   - Deploy and verify the version list and a published page.
6. **Deploy**
   - Run the synchronous deploy once and read the result. Re-running with no change is a no-op.
7. **Verify**
   - Run the pattern self-test(s) and your own acceptance checks for the video production workflow.

## Infrastructure Requirements
- **Compute**: Verified, apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle.
- **Postgres**: Verified, managed PostgreSQL runs in its own microVM and is auto-provisioned when needed.
- **CDN**: Verified, the CDN host serves objects from published buckets.

## Limitations
- The video production schema and workflow are original designs for this blueprint and were not executed as a separate application.
- Public content and synthetic examples only until actual data-handling requirements have been reviewed.

## Cost Estimate
- **Currency**: USD
- **Monthly Amount**: $10.0

| Component                      | Size             | Quantity | Monthly Amount |
|--------------------------------|------------------|----------|----------------|
| app server                     | s-1vcpu-1gb      | 1.0      | $5.0           |
| managed PostgreSQL database     | s-1vcpu-1gb      | 1.0      | $5.0           |

## Success Checks
1. **Check the app responds** on its public URL.
   - Expect: ample canary next js patterns
2. **Check the relational-records self-test** from the example.
   - Expect: see the pattern fixture checks

## Next Actions
- Browse the catalog index
- Search published recipes by intent, stack and constraints
- Prepare a side-effect-free deployment plan for an authorized project
