# Law firms: form collection using Next.js

## Summary
A form collection blueprint for law firms built with Next.js on Ample.

### Domain schema:
- **client_entities** (name, entity_type, conflict_check_reference): clients with conflict-check status;
- **matters** (client_entity_id, practice_area, opened_at, closed_at, status): engagement periods as matters;
- **document_requests** (matter_id, title, due_at, status, uploaded_object_key): documents requested from the client;
- **shared_documents** (matter_id, title, object_key, authorized_role): documents released to authorized client contacts;
- **uploads** (id, owner_reference, object_key, content_type, size, uploaded_at): validated uploads linked to their owner.

### Public information:
- Practice areas and attorney profiles,
- Intake process and fee structure overview,
- Office locations.

### Kept out of scope until handling is reviewed:
- Privileged communications and case files,
- Identity and financial documents,
- Opposing-party information.

**Matter documents are privileged; the portal models per-matter authorization only.** Professional-conduct and confidentiality obligations are not established here.

### Technical basis verified on Next.js:
Content-type and size validation that rejects disallowed files, an object written to a private bucket and a row linking the record to the object key (reject=ok upload=ok linked=ok).

## Representative Queries
- "Law firms: form collection using Next.js"
- "Where can I host Law firms: Form collection built with Next.js?"
- "I need a genuinely specialized form collection workflow covering matter-based access separation and confidential document handling."

## Workflow Steps
1. **Model the law firms domain:** Create the tables client_entities, matters, document_requests, shared_documents, uploads.
2. **Model document requests per engagement with due dates and status.**
3. **Validate uploaded files** (type, size) before storing them in the private bucket and linking them to the request.
4. **Authorize uploads by client entity.**
5. **Deploy and verify rejection** of disallowed files and a linked upload.
6. **Run the synchronous deploy** once and read the result.
7. **Run the pattern self-test(s)** from the example and your own acceptance checks for the law firms workflow.

## Examples
- **Next.js pattern fixture:** Verified browser file uploads basis for this blueprint.

## Limitations
- No health, financial, privacy or other compliance claim is made. Matter documents are privileged; the portal models per-matter authorization only. Professional-conduct and confidentiality obligations are not established here.
- Verified on the node-22 template at s-1vcpu-1gb; region, request-duration limits and other sizes are unknown or unverified.

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

## Evidence Summary
**Next.js pattern fixture deployed on Ample; the browser file uploads checks passed.**

## Formats
- [HTML](/content/blueprints/law-firms/form-collection/next-js/index.html)
- [Markdown](/content/blueprints/law-firms/form-collection/next-js.md)
- [JSON](https://api.ample.computer/v1/catalog/recipes/page%3Ablueprints%3Alaw-firms%3Aform-collection%3Anext-js)
