# Host mobile backend with Gin: stored input and output artifacts

Deploy a mobile backend built with Gin on Ample using the generated downloads 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, a private S3-compatible bucket holds objects with credentials delivered as encrypted environment variables. Verified on Gin: an export query rendered to a CSV artifact stored with metadata in a private bucket and returned only to an authorized caller (401 without token, export=ok rows=3). Not separately tested: your export formats, retention policy and entitlement model; treat the mobile backend-specific behavior as your application code.

## Representative Queries
- Host mobile backend with Gin: stored input and output artifacts
- Where can I host Mobile backend built with Gin?
- I need an input/output artifact contract, object metadata and access boundaries.

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

## Infrastructure Requirements
1. **Compute**: Apps run in isolated x86_64 Firecracker microVMs that auto-pause when idle.
2. **Postgres**: Managed PostgreSQL 16 runs in its own microVM and is auto-provisioned when needed.
3. **S3-compatible object storage**: Buckets are S3-compatible with issued credentials.

## Framework
Gin  
**Workload**: Mobile backend  
**Release Status**: published  
**Support Status**: verified  
**Execution Status**: ready  
**Docs Only**: false

## Prerequisites
- A Gin project that builds and starts with the documented commands.
- A PostgreSQL driver reading DATABASE_URL at runtime.
- A bucket from `ample bucket create` with its credentials.
- An Ample account token with specific permissions.

## Tested Configuration
- **Template**: ubuntu-24.04  
- **Runtime**: go  
- **Size**: s-1vcpu-1gb  
- Build command: CGO_ENABLED=0 go build -o app ./...  
- Start command: ./app

## Workflow Steps
1. **Build and start**: CGO_ENABLED=0 go build -o app ./... then ./app.
2. **Implement the pattern on PostgreSQL**: Copy the approach into your schema.
3. **Wire object storage**: Create the bucket(s) and pass the necessary credentials.
4. **Deploy**: Run the synchronous deploy once and read the result.
5. **Verify**: Fetch the live URL and pattern self-test route(s).

## Examples
- **Gin Pattern Fixture**: Multi-pattern Gin app whose generated downloads module was checked live.

## Success Checks
1. App responds on its public URL.
2. Generated-downloads self-test produces the expected output.

## Limitations
- Verified on specific templates; other sizes and versions not verified.
- Applications must follow specific idle behavior requirements.

## Cost Estimate
- **Currency**: USD  
- **Monthly Amount**: 10.0  
- **Basis**: size prices from pricing.toml.  
  **Components**:
  - App server: s-1vcpu-1gb, $5.0/month  
  - Managed PostgreSQL database: s-1vcpu-1gb, $5.0/month  
  **Note**: Monthly price based on tested sizes.

## Evidence Summary
- **Canary Run**: Gin pattern fixture deployed on Ample with successful checks for configuration.

## Next Actions
1. **Browse the catalog index**: [GET /v1/catalog](#)
2. **Search published recipes**: [POST /v1/catalog/search](#)
3. **Prepare a deployment plan**: [POST /v1/catalog/plan](#)
4. **Read existing authentication setup**: [GET /mcp/setup](#)
