## B2B SaaS: Client Portal using Django

### Summary
A client portal blueprint for B2B SaaS built with Django on Ample. Domain schema: 
- **customer_workspaces** (name, plan, seat_count, created_at): customer tenants;  
- **workspace_members** (workspace_id, email, role): members and roles per workspace;  
- **doc_versions** (product_version, title, object_key, published_at): versioned product documentation;  
- **customer_assets** (workspace_id, title, object_key, visibility): assets scoped to one customer;  
- **document_access** (document_id, principal_reference, role, granted_at): who may read which document.

Public information includes product documentation by version, pricing and plan comparison, status, and changelog. Kept out of scope until handling is reviewed: customer data inside workspaces, usage and billing records, support attachments.

### Representative Queries
- B2B SaaS: client portal using Django  
- Where can I host B2B SaaS: Client portal built with Django?  
- I need a genuinely specialized client portal workflow covering customer workspaces, versioned product docs, and customer-specific assets.

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

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

### Framework 
- Django

### Workload 
- Client portal

### Industry 
- B2B SaaS

### Workflow Steps
1. **Model the B2B SaaS domain**: Create the necessary tables and structures, keeping sensitive data out of the schema.  
2. **Model client entities**: Each document belongs to one engagement.  
3. **Authorize by client entity and role**: Ensure security before any storage access.  
4. **Store documents securely**: Use a private bucket, ensuring proper access control.  
5. **Deploy and verify negative authorization tests**: Conduct tests to ensure deployment integrity.  
6. **Verify**: Ensure all components work together appropriately.

### Limitations
- The technical basis was verified with the pattern fixture; the B2B SaaS schema and workflow are an original design.  
- No health, financial, privacy, or other compliance claims are made.
- Verified on the python-3.12 template.

### Cost Estimate
- **Currency**: USD  
- **Monthly Amount**: 10.0  
  - App server: s-1vcpu-1gb - $5.0  
  - Managed PostgreSQL database: s-1vcpu-1gb - $5.0  
**Note**: Always-on monthly price of tested sizes.

### Evidence Summary
- **Canary run**: Verified Django pattern fixture.

### Final Note
The blueprint outlines the guidelines for creating a client portal using Django in a B2B SaaS context.
