## Developer tools: client portal using Next.js

### Summary
A client portal blueprint for developer tools built with Next.js on Ample. Domain schema includes:
- **customer_workspaces** (name, plan, api_key_count): customer organizations
- **doc_versions** (product_version, title, object_key, published_at): versioned reference docs and guides
- **sdk_releases** (language, version, changelog_object_key, released_at): SDK releases and changelogs
- **customer_assets** (workspace_id, title, object_key, visibility): customer-specific artifacts
- **document_access** (document_id, principal_reference, role, granted_at): who may read which document.

### Representative Queries
- Developer tools: client portal using Next.js
- Where can I host Developer tools: Client portal built with Next.js?
- I need a genuinely specialized client portal workflow covering organization access, versioned technical docs and build artifacts.

### Framework and Industry
- **Framework**: Next.js
- **Workload**: Client portal
- **Industry**: Developer tools

### Resource Requirements
- **Primitive**: Compute
- **Primitive**: PostgreSQL
- **Primitive**: S3-compatible object storage

### Infrastructure Requirements
1. **Compute**: Apps run in isolated x86_64 Firecracker microVMs.
2. **Postgres**: Managed PostgreSQL 16 runs in its own microVM.
3. **S3-compatible object storage**: Buckets are S3-compatible with issued credentials.

### Prerequisites
- A Next.js project (next build then next start -H 0.0.0.0 -p $PORT)
- A PostgreSQL driver reading DATABASE_URL (auto-provisioned when omitted)
- Bucket credentials passed as encrypted environment variables

### Workflow Steps
1. Model the developer tools domain.
2. Model client entities and engagement periods.
3. Authorize by client entity and role before any storage access.
4. Store documents in the private bucket and stream them through the app.
5. Run the synchronous deploy once and read the result.
6. Run the pattern self-test(s) from the example and your own acceptance checks.

### Cost Estimate
- **Currency**: USD
- **Monthly Amount**: 10.0
- **Basis**: Size prices from pricing.toml

### Success Checks
1. App responds on its public URL.
2. Private-document-library self-test from the example.

### Limitations
- Verified only with certain PostgreSQL and size configurations.
- API keys and usage logs are sensitive data and kept out of documentation workflows.
- The technical basis is verified, but the developer tools schema is an original design not separately executed.

### Evidence Summary
- Next.js pattern fixture deployed on Ample. The private document library checks passed, confirming a role-to-document access model.
