### Construction contractors: vendor portal using Django

A vendor portal blueprint for construction contractors built with Django on Ample.

#### Domain schema:
- **listings** (reference, project_type, location, publishing_status, agency_id): showcase projects with publishing status;
- **agencies** (name, license_number, service_region): branches or divisions;
- **vendors** (name, trade, agency_id, prequalified): subcontractors and suppliers per branch;
- **reports** (agency_id, period, object_key, generated_at): branch progress reports;
- **document_access** (document_id, principal_reference, role, granted_at): who may read which document.

Public information includes: published project showcases, services and regions, licenses and insurance summary.

#### Key Points:
- Kept out of scope: site safety incidents, bid pricing, client contracts. Safety and bid data are confidential; only published showcases and branch reporting are modeled.
- Technical basis verified on Django: 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:
- Construction contractors: vendor portal using Django
- Where can I host Construction contractors: Vendor portal built with Django?
- I need a genuinely specialized vendor portal workflow covering project/vendor relationships, job progress and project reporting.

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

#### Infrastructure Requirements:
1. **Compute**  
   Status: verified  
   Summary: 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**  
   Status: verified  
   Summary: 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**  
   Status: verified  
   Summary: Buckets are S3-compatible with issued credentials.

#### Prerequisites:
- A Django project (pip install into .ample/python from requirements.txt, then waitress serving project.wsgi from run.py reading PORT on the python-3.12 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 construction contractors data classes may be handled at all; this blueprint models public information only.

#### Workflow Steps:
1. **Model the construction contractors domain**  
   Create the tables listings, agencies, vendors, reports, document_access.

2. **Workflow step 1**  
   Model vendors scoped to the agency with roles.

3. **Workflow step 2**  
   Authorize document access by vendor and role (401, 403 negative tests).

4. **Workflow step 3**  
   Store vendor documents in the private bucket.

5. **Workflow step 4**  
   Deploy and verify the negative tests and an authorized download.

6. **Deploy**  
   Run the synchronous deploy once and read the result.

7. **Verify**  
   Run the pattern self-test(s) from the example and your own acceptance checks for the construction contractors workflow.

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

#### Limitations:
- The technical basis (private document library on Django) was verified with the pattern fixture.
- No health, financial, privacy or other compliance 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 at build revision.

#### Evidence Summary:
- Summary of canary run: Django pattern fixture deployed on Ample and checks passed.
