## Law firms: Project Tracker Using Next.js

### Summary
A project tracker 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;  
- **state_transitions** (record_type, from_state, to_state): the allowed state machine.  
Public information includes 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: 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 (transitions=true isolation=true).

### Representative Queries  
- Law firms: project tracker using Next.js  
- Where can I host Law firms: Project tracker built with Next.js?  
- I need a genuinely specialized project tracker 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, state_transitions. Clients with conflict-check status live in client_entities; keep the sensitive classes (privileged communications and case files, identity and financial documents, opposing-party information) out of this schema.
2. **Model engagements and workstreams with explicit status transitions**.
3. **Scope every query by client entity**.
4. **Attach deliverables as private objects linked to workstreams**.
5. **Deploy and verify transitions and cross-client isolation**.
6. **Run the synchronous deploy once and read the result**. Re-running with no change is a no-op.
   Command: `ample deploy . --name  --public --env S3_ENDPOINT=... --env S3_REGION=... --env S3_BUCKET=... --env S3_ACCESS_KEY_ID=... --env S3_SECRET_ACCESS_KEY=...`
7. **Verify**  
   Run the pattern self-test(s) from the example (/p/relational-records) and your own acceptance checks for the law firms workflow.  
   Command: `ample logs  --kind build`

### Examples
- **Next.js pattern fixture**: Verified relational records basis for this blueprint.  
  Source Ref: `tests/deploy-canaries/next-js-patterns`

### Success Checks  
- App responds on its public URL.  
   Kind: http_get  
   Path: `/`  
   Expect: ample canary next js patterns  
- Relational-records self-test from the example.  
   Kind: http_get  
   Path: `/p/relational-records`  
   Expect: see the pattern fixture checks.

### Limitations
- The technical basis (relational records on Next.js) was verified with the pattern fixture; the law firms 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. Matter documents are privileged; the portal models per-matter authorization only. Professional-conduct and confidentiality obligations are not established here.
- Public content and synthetic examples only until actual data-handling requirements have been reviewed.
- Verified on the node-22 template at s-1vcpu-1gb; region, request-duration limits and other sizes are unknown or unverified.
- Managed PostgreSQL 16 only; extensions, connection limits and backup or restore procedures are not verified.
- PutObject and GetObject with path-style addressing are verified; other S3 operations and CDN cache rules are not.

### Cost Estimate
- Currency: USD
- Monthly Amount: 10.0
- Authoritative: true
- Basis: size prices from pricing.toml (loaded by the API) at build revision 1ac5595375130d45290090e82ed0f554ccd45405-dirty
- Components:
  - **App server**: size: s-1vcpu-1gb, quantity: 1.0, monthlyAmount: 5.0  
  - **Managed PostgreSQL database**: size: s-1vcpu-1gb, quantity: 1.0, monthlyAmount: 5.0  
- Note: Always-on monthly price of the tested sizes; apps and databases auto-pause when idle. Buckets are allocation-priced per quota and not included.
