## Host Order Tracking with Phoenix: Relational Catalog Data

Deploy an order tracking built with Phoenix on Ample using the transactional workflows pattern. Compute 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`. Verified on Phoenix: an optimistic version check and an event row written in the same transaction, a stale update rejected, and a history query over the application-owned events (history=2 conflict=rejected). Not separately tested: your domain records, validation rules and concurrency policy; treat the order tracking-specific behavior as your application code.

### Representative Queries
- Host order tracking with Phoenix: relational catalog data
- Where can I host Order tracking built with Phoenix?
- I need catalog tables, transactional update logic and application-level access boundaries.

### Resource Requirements
- `primitive:compute`
- `primitive:postgres`

### 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.

### Prerequisites
- A Phoenix project that builds and starts with the documented commands (mix deps.get, MIX_ENV=prod mix compile and mix release in the builder, then the release bin script with PHX_SERVER=true on the elixir-1.18 template; PORT, DATABASE_URL and SECRET_KEY_BASE read in config/runtime.exs).
- A PostgreSQL driver reading DATABASE_URL at runtime (auto-provisioned when omitted, or supplied with --env).
- An Ample account token with `servers:write`, `databases:read`.

### Workflow Steps
1. **Build and Start**
   - `mix deps.get, MIX_ENV=prod mix compile and mix release` in the builder.
   - Run the release bin script with `PHX_SERVER=true` on the elixir-1.18 template.
2. **Implement the Pattern on PostgreSQL**
   - The fixture's module implements transactional workflows: an optimistic version check and an event row written in the same transaction, a stale update rejected, and a history query over the application-owned events (history=2 conflict=rejected).
3. **Deploy**
   - Command: `ample deploy . --name <YourAppName> --public`
4. **Verify**
   - Command: `ample logs --kind build`

### Cost Estimate
- **Monthly Amount**: $10.00
- **Components**:
   - App server (s-1vcpu-1gb): $5.00
   - Managed PostgreSQL database (s-1vcpu-1gb): $5.00
- **Note**: Always-on monthly price of the tested sizes; apps and databases auto-pause when idle.

### Limitations
- Verified only on the elixir-1.18 template at s-1vcpu-1gb with the example fixture; other sizes, templates, and Phoenix major versions are not verified.
- The order tracking itself (your domain records, validation rules, and concurrency policy) is application code and was not separately tested; the pattern checks are what was verified.
