diff --git a/Cargo.toml b/Cargo.toml index 6cc6336e..127ac5df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,7 +36,7 @@ actix = "0.13.5" actix-web-actors = "4.3.1" chrono = { version = "0.4.39", features = ["serde", "clock"] } config = "0.13.4" -reqwest = { version = "0.11.23", features = ["json", "blocking", "stream"] } +reqwest = { version = "0.11.23", features = ["json", "blocking", "stream", "native-tls"] } serde = { version = "1.0.195", features = ["derive"] } tokio = { version = "1.28.1", features = ["full"] } tracing = { version = "0.1.40", features = ["log"] } diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 7eef27e2..703bdb8f 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -42,6 +42,9 @@ services: # Vault — must point to the real Vault service in the TryDirect network - VAULT_ADDRESS=https://vault.try.direct - VAULT_TOKEN=${STACKER_VAULT_TOKEN:-change-me} + # mTLS client cert for Vault — inline PEMs + - VAULT_CLIENT_CERT=${VAULT_CLIENT_CERT:-} + - VAULT_CLIENT_KEY=${VAULT_CLIENT_KEY:-} depends_on: stackerdb: condition: service_healthy diff --git a/docs/MARKETPLACE_PUBLISH.md b/docs/MARKETPLACE_PUBLISH.md new file mode 100644 index 00000000..5fcc6fd3 --- /dev/null +++ b/docs/MARKETPLACE_PUBLISH.md @@ -0,0 +1,288 @@ +# Publishing a Stack to the TryDirect Marketplace + +This guide walks creators through publishing a stack to the TryDirect marketplace +so other users can deploy it in one click and you earn on every sale. + +--- + +## Table of Contents + +- [Who this is for](#who-this-is-for) +- [What you get](#what-you-get) +- [Two ways to publish](#two-ways-to-publish) +- [Path A: Publish from Stack Builder (UI)](#path-a-publish-from-stack-builder-ui) +- [Path B: Publish from CLI (stacker.yml)](#path-b-publish-from-cli-stackeryml) +- [Required metadata](#required-metadata) +- [Pricing options](#pricing-options) +- [The review process](#the-review-process) +- [After approval](#after-approval) +- [Updating a published template](#updating-a-published-template) +- [Common rejection reasons](#common-rejection-reasons) +- [FAQ](#faq) + +--- + +## Who this is for + +You should publish to the marketplace if you have a working Docker Compose stack +or `stacker.yml` that: + +- Solves a clear business problem (e.g. "Internal AI Helpdesk", "RAG Knowledge Base") +- Wires multiple services together so buyers don't have to (database + cache + app + LLM, etc.) +- Has been tested end-to-end on at least one cloud provider + +Single-container stacks are accepted but multi-service bundles consistently +outperform them in deployments and revenue. + +--- + +## What you get + +- **75% revenue share** on every paid deployment, including subscription renewals +- **Monthly Net-30 payouts** via Stripe Connect or PayPal (minimum $50) +- Automatic marketplace promotion: SEO landing page at `/applications/`, + inclusion in weekly digests, "Trending" badge if your template gains traction +- A "Deploy with TryDirect" badge you can embed in your GitHub README +- Public deploy count and creator profile + +Full payout terms: see `config/docs/MARKETPLACE_PAYOUT_TERMS.md`. + +--- + +## Two ways to publish + +| Path | Best for | Effort | +|---|---|---| +| **Stack Builder (UI)** | Stacks you built visually inside TryDirect | Click "Publish to Marketplace" | +| **stacker.yml (CLI)** | Stacks defined in your own repo | `stacker publish` | + +Both paths produce the same `StackTemplate` record and follow the same review +process. Pick whichever fits how you author your stack. + +--- + +## Path A: Publish from Stack Builder (UI) + +1. Open your stack in **Stack Builder** at `/builder`. +2. Verify it deploys cleanly to a test server. +3. Click **Publish to Marketplace** in the project sidebar. +4. Fill in the publish form: + - **Name** — a business-oriented name, not just tech ("Client AI Agent Workspace", not "n8n+Qdrant+Ollama") + - **Short description** — one sentence: what problem does it solve? + - **Long description** — markdown supported; cover use cases, requirements, customisation + - **Category** — AI Agents, Data Pipelines, SaaS Starter, Dev Tools, etc. + - **Tags** — `n8n`, `qdrant`, `ollama`, `supabase`, `postgres`, etc. + - **License / pricing** — Free, Paid (one-time), or Subscription + - **Price** (if paid) — USD + - **Support URL** — GitHub repo, docs site, or contact form + - **No-secrets confirmation** — required checkbox: confirms you removed all + embedded credentials before submitting +5. Click **Submit to marketplace**. Your dashboard will show status: + `In review` → `Approved` or `Rejected (with reason)`. + +--- + +## Path B: Publish from CLI (stacker.yml) + +Add a `marketplace` section to your `stacker.yml`, then run `stacker publish`. + +### Example `stacker.yml` marketplace block + +```yaml +name: ai-helpdesk-starter +version: 1.0.0 + +# ... your existing app, services, deploy, etc. ... + +marketplace: + publish: true + display_name: "Internal AI Helpdesk" + short_description: "Self-hosted AI helpdesk with n8n workflows, Qdrant memory, and Ollama LLM." + long_description: | + Deploy a complete internal AI helpdesk stack: n8n handles ticket routing + and workflow automation, Qdrant stores conversation memory and document + embeddings, and Ollama serves the local LLM. + + Comes pre-wired with example workflows for common helpdesk patterns. + Customise via the n8n web UI after deployment. + category: ai-agents + tags: + - n8n + - qdrant + - ollama + - helpdesk + - rag + license: paid + pricing: + plan_type: one_time # one_time | subscription | free + price: 49 + currency: USD + support_url: https://github.com/your-org/ai-helpdesk-starter + no_secrets_confirmation: true +``` + +### Submit + +```bash +# From your project root +stacker publish + +# Stacker validates stacker.yml, packages the stack definition, +# and submits it to the TryDirect marketplace for review. +``` + +### Check status + +```bash +stacker publish --status + +# Shows: in_review | approved | rejected (with reason) +``` + +--- + +## Required metadata + +| Field | Required | Notes | +|---|---|---| +| Name | Yes | 5-80 chars, business-oriented | +| Short description | Yes | 20-200 chars, one sentence | +| Long description | Yes | Markdown, 100-5000 chars | +| Category | Yes | Must match an existing category code | +| Tags | Yes | 1-10 tags | +| License | Yes | `free`, `paid`, `subscription` | +| Price | If paid/subscription | USD, > 0 | +| Support URL | Yes | Public URL where buyers can reach you | +| No-secrets confirmation | Yes | Must be `true` | + +--- + +## Pricing options + +### Free +No revenue, but full marketplace promotion (SEO page, digest inclusion, trending +badges). Good for building reputation and audience. + +### One-time +Buyer pays once, deploys as many times as they want for their own use. +You earn 75% of the sale price. Most templates start here. + +### Subscription +Buyer pays monthly or yearly. You earn 75% of every renewal cycle, not just +the first sale. Best for templates that ship updates regularly. + +You can change pricing on future versions but not retroactively. Buyers of +v1.0.0 keep their original pricing for that version's lifetime. + +--- + +## The review process + +| Step | Time | Who | +|---|---|---| +| Submission received | Instant | Auto-confirmation email | +| Initial automated checks | < 1 hour | `stacker.yml` validation, no embedded secrets, no banned services | +| Manual review | 1-3 business days | TryDirect review team | +| Decision | — | Approved → live on `/applications`; Rejected → feedback in dashboard | + +Reviewers check: +1. **Deploys cleanly** on a fresh server +2. **No embedded credentials** in env vars, configs, or volumes +3. **No insecure defaults** (e.g. `--api.insecure=true`, `0.0.0.0/0` ACLs, hardcoded passwords) +4. **Metadata accurate** — what the listing claims matches what the stack actually does +5. **Support URL reachable** — opens to a real GitHub/docs/contact page + +--- + +## After approval + +Once approved, several things happen automatically: + +- **SEO landing page** generated at `/applications/` +- **Social post** to TryDirect Twitter/X: "New on TryDirect: