# Management consultancies: client portal using Laravel

## Summary
A client portal blueprint for management consultancies built with Laravel on Ample. Domain schema: 
- **client_entities** (name, industry, primary_contact_role): client organizations;
- **engagements** (client_entity_id, scope_title, phase, period_start, period_end): engagement periods and phases;
- **workstreams** (engagement_id, name, owner, status, due_at): tracked workstreams;
- **deliverables** (engagement_id, title, version, object_key, released_at): versioned deliverables shared with the client;
- **document_access** (document_id, principal_reference, role, granted_at): who may read which document.

Public information includes service offerings and anonymized case studies, consultant profiles, and engagement model. Client strategy documents, financial models, and interview notes are kept out of scope due to confidentiality.

Technical basis verified on Laravel with 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.

## Resource Requirements
- Compute
- Postgres
- S3-compatible object storage

## Infrastructure Requirements
1. **Compute**: Apps run in isolated x86_64 Firecracker microVMs; sizes are the priced VM sizes.
2. **Postgres**: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned.
3. **S3-compatible object storage**: Buckets are S3-compatible with issued credentials.

## Prerequisites
- A Laravel project (composer install --no-dev from composer.lock, then FrankenPHP serving public/).
- A PostgreSQL driver reading DATABASE_URL.
- Bucket credentials from `ample bucket create` passed as encrypted S3_* environment variables.
- Review of which management consultancies data classes may be handled at all; this blueprint models public information only.

## Tested Configuration
- **Template**: php-8.5
- **Runtime**: php
- **Size**: s-1vcpu-1gb

## Workflow Steps
1. **Model the management consultancies domain**: Create tables for client_entities, engagements, workstreams, deliverables, document_access.
2. **Authorize Access**: Based on client entity and role before any storage access.
3. **Store Documents**: In the private bucket and stream them through the app.
4. **Deploy and Verify**: Ensure authorization tests and authorized downloads are successful.

## Cost Estimate
- **Monthly Amount**: 10.0 USD
- **Components**:
  - App server: 5.0 USD
  - Managed PostgreSQL database: 5.0 USD
  
## Limitations
- No health, financial, privacy, or other compliance claims are made. Client strategy material is confidential.
- Public content only until actual data-handling requirements have been reviewed.

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

## Examples
- **Title**: Laravel pattern fixture
  **Description**: Verified private document library basis for this blueprint.
  **Source Ref**: tests/deploy-canaries/laravel-patterns

## Next Actions
1. **Browse the catalog index**: GET /v1/catalog
2. **Search published recipes**: POST /v1/catalog/search
3. **Prepare a side-effect-free deployment plan**: POST /v1/catalog/plan
4. **Read the existing agent authentication setup**: GET /mcp/setup
5. **Browse Management consultancies**: GET /v1/catalog/nodes/industry%3Amanagement-consultancies
