product media.md

Host order tracking with Nuxt: public product media

Summary

Deploy an order tracking system built with Nuxt on Ample using the public media library pattern. This setup runs the app in an isolated microVM behind a public HTTPS URL. A managed PostgreSQL 16 database is auto-provisioned and injected as DATABASE_URL. A private S3-compatible bucket holds objects with credentials delivered as encrypted environment variables, while a published bucket serves public assets from the CDN host. Verified on Nuxt with an object written to a published bucket with an immutable Cache-Control header, a mapping row, and the CDN URL serving it publicly. The order tracking-specific behavior should be treated as application code.

Infrastructure requirements

Prerequisites

Exact tested configuration

Steps

  1. Build and start. run nuxt build then node .output/server/index.mjs (reads HOST and PORT on the node-22 template).
  2. Implement the pattern on PostgreSQL. The fixture's module implements a public media library; copy the approach into your schema and ensure migrations are idempotent.
  3. Wire object storage. Create the bucket(s), passing endpoint, region, bucket and keys as environment values. Keep private data in an unpublished bucket and publish only the bucket serving public assets.
  4. Deploy. Run the synchronous deploy once and read the result.
    ample deploy . --name <app-name> --public --env S3_ENDPOINT=... --env S3_REGION=... --env S3_BUCKET=... --env S3_ACCESS_KEY_ID=... --env S3_SECRET_ACCESS_KEY=... --env CDN_PUBLIC_URL=...  
    
  5. Verify. Fetch the live URL and check the pattern self-test route(s) from the example; run your own checks.
    ample logs <deployment_id> --kind build  
    

Tested examples

Success checks

Limitations

Cost estimate

Estimated 10.00 USD per month (size prices from pricing.toml).

Verification evidence

Execution binding

MCP tool ample_deploy, schema hash 876465fce906da0c observed.

Input schema

{
  "additionalProperties": false,
  "properties": {
    "env": {
      "description": "Encrypted environment variables (bucket credentials, secrets)",
      "items": {
        "pattern": "^[A-Z][A-Z0-9_]*=.*$",
        "type": "string"
      },
      "maxItems": 50,
      "type": "array"
    },
    "name": {
      "description": "App name",
      "maxLength": 63,
      "minLength": 1,
      "pattern": "^[a-z0-9-]+$",
      "type": "string"
    },
    "path": {
      "description": "Project directory or ample.toml service",
      "maxLength": 512,
      "minLength": 1,
      "type": "string"
    },
    "release_command": {
      "description": "Migration command run before activation",
      "maxLength": 512,
      "type": "string"
    }
  },
  "required": [
    "env",
    "name",
    "path"
  ],
  "type": "object"
}