# "Build Deploy AI SaaS End To End"
<!--
ref: @content/youtube/david-ondrej/2025-12-11-build-deploy-ai-saas-end-to-end
triggers: [need to deploy a SaaS, want to self-host on a VPS, struggling with debugging, looking to upskill on deployment]
trigger_prompt: When you want to build and deploy a SaaS application while learning the necessary technologies and avoiding common pitfalls in the process.
version: 4
updated_at: 2026-10-31T18:33:35.078Z
-->

From David Ondrej, 2025-12-11: The bar for "impressive" is no longer building an MVP — anyone can prompt one out in an afternoon.

David Ondrej walks through building a Polymarket-style prediction-market SaaS from empty folder to a self-hosted production deployment, using Claude Code (Opus 4.5), Gemini 3 Pro, Dokploy, and a Hostinger VPS.

## Core Thesis
The bar for "impressive" is no longer building an MVP — anyone can prompt one out in an afternoon. The real differentiator in late-2025 indie SaaS is **shipping, hosting, debugging, and maintaining** the app yourself, and self-hosting on a cheap VPS via Dokploy is now accessible enough that avoiding it (in favor of Vercel/Supabase/Netlify) is a self-imposed cost and risk burden. Mastery comes from using AI agents to *upskill* on the unfamiliar layers (deployment, ORMs, git, env vars), not just to generate code.

## Key Insights

- **AI agents over-build, not under-build.** The dominant failure mode is feature bloat from "overly excited" agents — explicit scoping, line-count constraints ("the fewer lines of code, the better"), and "don't implement yet" directives matter more than expansive prompting.
- **Tech stack and deployment target are human decisions made upfront.** Both must appear in the very first prompt because retrofitting them later is "very, very painful" and can install dependencies that sabotage hosting.
- **Sequential prompt decomposition beats one-shot generation.** Prompt 1 = scaffolding + README only (no code). Prompt 2 = UI shell with mock data. Prompts 3+ = API and integration. Each layer is validated before proceeding.
- **Stick to mainstream stacks** (PostgreSQL + Prisma, Python, JS, SQL, Next.js) — they dominate model training data, so AI assistance is dramatically higher quality than with esoteric or just-released tools.
- **Multi-model workflow is optimal.** Claude Code (Opus 4.5) for backend/logic; Gemini 3 Pro for frontend visual polish. Copy-pasting between them is "unscalable but effective."
- **README-as-onboarding-contract.** Auto-generated READMEs are the fastest way for outsiders (or future-you) to understand stack, schema, and dependencies.
- **The "vibe coder" ceiling.** People who stall at MVP use AI only to generate code; people who ship use AI to *learn* the unfamiliar pieces (Prisma, curl, deployment, auth).
- **Self-hosting unlocks predictable costs, no 60-second function timeouts, direct DB connections, and full ownership** — and is no longer DevOps-gated thanks to Dokploy + AI agents.
- **Debugging is context-passing.** Screenshots + full logs (wrapped in XML tags) + "ultrathink" pasted into Claude Code is the single most important shipping skill.

## Actionable Takeaways

1. **Install Claude Code, run `claude` in an empty folder.** Use `Shift+Tab` for auto-accept, `/model` to pick Opus 4.5, `Ctrl+J` for newlines, and store prompts as versioned `prompts/prompt_NN.md` files the agent reads.
2. **Use the 4-part prompt framework** for the initial scaffolding prompt: (1) broad overview, (2) scoped feature list, (3) tech stack, (4) deployment target. Append: *"Nothing more, nothing less. The fewer lines of code, the better."*
3. **Create `.claude/settings.json`** with an allow-list of safe commands and a deny-list of risky ones (`rm -rf`, `sudo mv`). Use Perplexity Deep Research to generate the allow-list.
4. **Use XML tags in prompts** to separate research, instructions, schema requirements, and pasted logs.
5. **Default stack:** Next.js (App Router) + Tailwind + Prisma + PostgreSQL + Nixpacks + Dokploy on a Hostinger VPS.
6. **Tag files with `@`**, hit `Esc` to interrupt rushed agents, and use `think harder` / `ultrathink` keywords for higher reasoning effort.
7. **Git essentials worth learning by hand:** `git add`, `git commit`, `git push`, `git log`, `git reflog`. One-time setup: `git branch -M main` → `git remote add origin <URL>` → `git push -u origin main`.
8. **Buy Hostinger KVM2 (24-month) with code "David"** for ~10% off, pick Dokploy as the OS panel during setup, and use a region close to your customers.
9. **Dokploy deployment recipe:** create Project → Application service named "app" → connect via GitHub App (grant only-selected repos) → branch `main`, build type Nixpacks (auto-detected for Next.js) → use Dokploy's free domain.
10. **Add Postgres as a separate service**, copy the *internal* connection URL into `DATABASE_URL`, redeploy (env vars don't hot-reload), then run `npx prisma db push` from the app's terminal.
11. **If the build container doesn't include the Prisma schema**, expose Postgres port 5432 externally in Dokploy and run migrations from your local machine against the remote DB using the VPS IP.
12. **Debugging loop:** screenshot + logs (in `<logs>` tags) → paste into Claude Code → "Investigate. Ultrathink. Answer in short." → apply fix → redeploy.
13. **Rename clones** to avoid legal exposure (Polymarket → "David Market") and avoid "cringe vibe coding gradients" — use clean white/gray/black/metallic palettes.

## Notable Quotes

> "The issue isn't that they add too little features, but that they add too many."

> "Anybody can build an MVP… The real questions are: can you deploy it, host it, maintain it, get your first paying customer?"

> "The biggest difference between people who are just vibe coders and people who get stuck — they don't use AI to upskill themselves."

> "Brain has neuroplasticity until you die."

> "You're not going to get a surprise $300,000 Vercel bill."

> "We can remove a lot of that complexity while still maintaining full control over the VPS… that's the definition of high leverage."

> "Don't take errors personally. Any problem can be solved."

> "We literally live in the best time to build software. If you're not building your own software, what are you doing?"

> "You can paste in the screenshots, paste in the context into cloud code, and it can help solve anything."

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*