page:blueprints:wholesale distributors:product catalog:django
Wholesale distributors: product catalog using Django
Summary
A product catalog blueprint for wholesale distributors built with Django on Ample. Domain schema:
- products (sku, name, category, case_size, list_price, active): SKU catalog with case sizes;
- stock_movements (sku, warehouse, delta, reason, moved_at): receipts, picks, and adjustments;
- orders (order_no, account_reference, status, placed_at): trade orders with status transitions;
- order_lines (order_no, sku, cases, unit_price): order contents;
- events (seq, record_type, record_id, kind, at): application-owned history written in the same transaction.
Public information includes the catalog with case sizes, minimum order and delivery terms, and trade account application.
Technical Basis
Verified on Django with:
- An optimistic version check
- An event row written in the same transaction
- A stale update rejected
- A history query over the application-owned events (history=2 conflict=rejected).
Resource Requirements
- Compute
- Postgres
- S3-compatible object storage
Infrastructure Requirements
- Compute
Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle and wake on request; sizes are the priced VM sizes. - Postgres
Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when an app needs a database and no DATABASE_URL is supplied. - S3-compatible object storage
Buckets are S3-compatible with issued credentials; PutObject and GetObject are verified by canary. Other S3 operations are not verified.
Workflow Steps
Model the wholesale distributors domain
Create the tables products, stock_movements, orders, order_lines, events. SKU catalog with case sizes lives in products; keep sensitive classes (account pricing tiers, credit terms, delivery addresses) out of this schema.Workflow step 1
Model the SKU catalog with versioned updates.Workflow step 2
Record every catalog change as an event in the same transaction.Workflow step 3
Reject stale concurrent updates.Workflow step 4
Deploy and verify history and conflict handling.Deploy
Run the synchronous deploy once and read the result. Re-running with no change is a no-op.Command:
ample deploy . --name --public --start "python3 run.py" --env S3_ENDPOINT=... --env S3_REGION=... --env S3_BUCKET=... --env S3_ACCESS_KEY_ID=... --env S3_SECRET_ACCESS_KEY=...Verify
Run the pattern self-tests from the example and your own acceptance checks for the wholesale distributors workflow.Command:
ample logs --kind build
Examples
- Django pattern fixture
Verified transactional workflows basis for this blueprint.
Success Checks
- App responds on its public URL (expect: ample canary django patterns).
- Transactional-workflows self-test from the example (expect: see the pattern fixture checks).
Limitations
- The wholesale distributors 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. Account-specific pricing and credit terms are confidential; the catalog shown publicly carries list prices only.
- Verified on the python-3.12 template at s-1vcpu-1gb; region, request-duration limits, and other sizes are unknown or unverified.
Cost Estimate
- Currency: USD
- Monthly Amount: 10.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.
Evidence Summary
- Kind: Canary run
Django pattern fixture deployed on Ample; the transactional workflows checks passed.
Next Actions
- Browse the catalog index
Method:GET
Relative Path:/v1/catalog - Search published recipes by intent, stack, and constraints
Method:POST
Relative Path:/v1/catalog/search - Prepare a side-effect-free deployment plan for an authorized project
Method:POST
Relative Path:/v1/catalog/plan - Read the existing agent authentication setup
Method:GET
Relative Path:/mcp/setup - Browse Wholesale distributors
Method:GET
Relative Path:/v1/catalog/nodes/industry%3Awholesale-distributors - Browse Product catalog
Method:GET
Relative Path:/v1/catalog/nodes/workload%3Aproduct-catalog - Browse Django
Method:GET
Relative Path:/v1/catalog/nodes/stack%3Aframework-django - Browse Deploy web app
Method:GET
Relative Path:/v1/catalog/nodes/intent%3Adeploy-web-app