# Creator businesses: client portal using Laravel

## Summary
A client portal blueprint for creator businesses built with Laravel on Ample. Domain schema: 
- **customer_workspaces** (name, membership_tier, joined_at): member accounts or communities;
- **content_items** (title, tier_required, object_key, published_at, version): versioned content releases;
- **customer_assets** (workspace_id, title, object_key, visibility): downloads granted to a member;
- **releases** (content_item_id, version, notes): release notes per version;
- **document_access** (document_id, principal_reference, role, granted_at): who may read which document.  
Public information: free content and previews, membership tiers, creator profile. Kept out of scope until handling is reviewed: member identity and payment status, private community posts. Member payment status comes from your payment provider; it is not modeled here and no PCI claim is made. Technical basis verified on Laravel: a role-to-document access model with negative tests (401 without identity, 403 for the wrong role) and a private-bucket round-trip for the allowed role (private=ok).

## Representative Queries
- Creator businesses: client portal using Laravel
- Where can I host Creator businesses: Client portal built with Laravel?
- I need a genuinely specialized client portal workflow covering sponsor/client workspaces, publication guides and content assets.

## Resource Requirements
- **primitive:compute**
- **primitive:postgres**
- **primitive:s3-compatible-object-storage**

## Infrastructure Requirements
1. **Compute**: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes.
2. **Postgres**: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied.
3. **S3-compatible object storage**: Buckets are S3-compatible with issued credentials; PutObject and GetObject are verified by canary.

## Prerequisites
- A Laravel project (composer install --no-dev from composer.lock, then FrankenPHP serving public/ (php-server with the index.php fallback) reading PORT on the php-8.5 template)
- A PostgreSQL driver reading DATABASE_URL (auto-provisioned when omitted)
- Bucket credentials from `ample bucket create` passed as encrypted S3_* environment variables
- A review of which creator businesses data classes may be handled at all; this blueprint models public information only

## Workflow Steps  
1. Model the creator businesses domain: Create the tables customer_workspaces, content_items, customer_assets, releases, document_access. Member accounts or communities lives in customer_workspaces; keep the sensitive classes (member identity and payment status, private community posts) out of this schema.
2. Model client entities and engagement periods; every document belongs to one engagement.
3. Authorize by client entity and role before any storage access (401 without identity, 403 for the wrong client).
4. Store documents in the private bucket and stream them through the app.
5. Deploy and verify the negative authorization tests and an authorized download.
6. 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) from the example (/p/private-document-library) and your own acceptance checks for the creator businesses workflow.

## Examples
- **Laravel pattern fixture**: Verified private document library basis for this blueprint.

## Success Checks
1. App responds on its public URL  - expect "ample canary laravel patterns".
2. Private-document-library self-test from the example - expect "see the pattern fixture checks".

## Limitations
- The technical basis (private document library on Laravel) was verified with the pattern fixture; the creator businesses schema and workflow are an original design for this blueprint and were not executed as a separate application.  
- No health, financial, privacy or other compliance claim is made. Member payment status comes from your payment provider; it is not modeled here and no PCI claim is made.
- Public content and synthetic examples only until actual data-handling requirements have been reviewed.

## Cost Estimate
- **Currency**: USD  
- **Monthly Amount**: 10.0  
- **Basis**: Size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty  
  - Components:
    1. App server: size s-1vcpu-1gb - quantity 1.0 - monthly amount 5.0
    2. Managed PostgreSQL database: size s-1vcpu-1gb - quantity 1.0 - monthly amount 5.0

## Formats
- **HTML**: [HTML Link](/content/blueprints/creator-businesses/client-portal/laravel/index.html)
- **Markdown**: [Markdown Link](/content/blueprints/creator-businesses/client-portal/laravel.md)  
- **JSON**: [JSON Link](https://api.ample.computer/v1/catalog/recipes/page%3Ablueprints%3Acreator-businesses%3Aclient-portal%3Alaravel)

## 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
- Read the existing agent authentication setup
- Browse Creator businesses
- Browse Client portal
- Browse Laravel
- Browse Deploy web app
