# Architecture practices: form collection using Django

## Summary

A form collection blueprint for architecture practices built with Django on Ample. Domain schema: clients and project sites; projects engagement periods by RIBA/AIA-style stage; drawing_sets versioned drawing issues; approvals client sign-offs; uploads validated uploads linked to their owner. Public information includes portfolio and services, team and accreditations, studio locations. Drawings and surveys are client-confidential until issued.

## Infrastructure requirements

- Compute: verified (Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request.)
- Postgres: verified (Managed PostgreSQL 16 runs in its own microVM.)
- S3-compatible object storage: verified (Buckets are S3-compatible.)

## Prerequisites

- A Django project.
- A PostgreSQL driver reading DATABASE_URL.
- Bucket credentials passed as encrypted S3_* environment variables.

## Exact tested configuration

- template: `python-3.12`
- runtime: `python`
- size: `s-1vcpu-1gb`
- install: `python3 -m pip install --target .ample/python -r requirements.txt`
- start: `PYTHONPATH=.ample/python:${PYTHONPATH:-} python3 run.py`

## Steps

1. **Model the architecture practices domain.** Create the tables client_entities, projects, drawing_sets, approvals, uploads.
2. **Workflow step 1.** Model document requests per engagement with due dates and status.
3. **Workflow step 2.** Validate uploaded files (type, size).
4. **Workflow step 3.** Authorize uploads by client entity.
5. **Workflow step 4.** Deploy and verify rejection of disallowed files.
6. **Deploy.** Run the synchronous deploy once and read the result.
7. **Verify.** Run the pattern self-test(s) from the example.

## Tested examples

- **Django pattern fixture**: Verified browser file uploads basis for this blueprint.

## Success checks

- App responds on its public URL.
- Browser-file-uploads self-test from the example.

## Limitations

- The technical basis was verified with the pattern fixture.
- Verified on the python-3.12 template.
- Managed PostgreSQL 16 only.

## Cost estimate

Estimated 10.00 USD per month.
- app server x1 `s-1vcpu-1gb`: 5.00 USD
- managed PostgreSQL database x1 `s-1vcpu-1gb`: 5.00 USD

## Verification evidence

- canary_run: Django pattern fixture deployed on Ample; the browser file uploads checks passed.

## Execution binding

MCP tool `ample_deploy`, schema hash `876465fce906da0c`.
