How To Build & Deploy an AI SaaS End To End
By David Ondrej
Key Concepts
- AI SAS: Artificial Intelligence Software as a Service – a software application leveraging AI delivered over the internet.
- Clot Code: An AI coding assistant powered by Anthropic’s Opus 4.5 model.
- Opus 4.5: Anthropic’s latest and most powerful language model.
- Gemini 3 Pro: Google’s advanced multimodal AI model.
- Nixpacks: A buildpack system for containerizing applications, facilitating deployment.
- VPS (Virtual Private Server): A virtualized server providing dedicated resources for hosting applications.
- Docker: A platform for developing, shipping, and running applications in containers.
- Dockploy: An open-source platform simplifying VPS management and application deployment.
- Prisma: An ORM (Object-Relational Mapper) simplifying database interactions.
- Text Stack: The combination of programming languages, frameworks, and databases used in an application.
- Git Ignore: A file specifying intentionally untracked files that Git should ignore.
Building and Deploying an AI SAS from Scratch
This video details the process of building and deploying an AI-powered prediction market application (an AI SAS) from scratch, emphasizing cost-effectiveness and self-hosting. The tutorial leverages AI coding assistants and focuses on practical deployment strategies.
1. Setting Up the Development Environment
The process begins with an empty folder and utilizes Clot Code, powered by Anthropic’s Opus 4.5, as the primary coding assistant. Alternatives like Gemini 3 Pro (accessible through Cursor or the Gemini CLI) are also mentioned. The speaker highlights a partnership with Gemini for a hackathon in Warsaw, Poland in January 2026, encouraging interested participants to follow on Instagram and DM "hackathon." Clot Code is installed via a terminal command, enabling code generation and execution within the project folder. Auto-accept mode is activated (Shift+Tab) to streamline the development process. The model is explicitly set to Opus 4.5 (/model).
2. Prompt Engineering and Initial Architecture
The core development strategy revolves around iterative prompt engineering. The first prompt (prompt_01.md) establishes a broad overview of the application, defines key features (yes/no questions, share buying, live odds), and crucially, specifies the text stack. The speaker stresses the importance of careful text stack selection, recommending thorough research (using tools like Perplexity, JBT, CLA) to avoid future refactoring pain. The prompt also outlines deployment intentions – a VPS using Docker and Nixpacks. The final part of the prompt instructs Clot Code to create the project structure and a detailed README file, without implementing any code initially. This approach prioritizes architecture and documentation.
3. Front-End Development with Next.js
The second prompt (prompt_2.md) focuses on building the front-end using Next.js with the app router, Tailwind CSS. Specific pages are requested: Home, List Markets, Market Detail, and Create Market. The instruction is to create a UI shell with mock data, deferring API integration. The speaker advocates for breaking down the project into smaller, manageable prompts to ensure quality and control.
4. Back-End Integration with Prisma and PostgreSQL
Prompt three (prompt_03.md) initiates the back-end development, integrating PostgreSQL as the database using Prisma. The speaker strongly advises sticking to popular technologies to leverage the extensive training data available to AI models. The prompt also includes instructions to create an .env file for storing sensitive information and to ensure compatibility with Nixpacks for deployment.
5. API Route Creation and Testing
Prompt four (prompt_04.md) directs Clot Code to build the API routes: Create Market, Get Markets, Place Bets, and Market Odds. Prisma is integrated with each endpoint. The prompt requests curl examples for testing. The speaker emphasizes the importance of considering deployment early in the development process to avoid compatibility issues.
6. Front-End Enhancement with Gemini 3 Pro
Prompt five focuses on improving the front-end's design. The speaker leverages Gemini 3 Pro (through a separate process) to enhance the UI/UX, explicitly instructing it not to alter the application's functionality. This demonstrates a strategic approach of utilizing different AI models for their respective strengths.
7. Deployment with Docker and Dockploy on Hostinger
The second half of the video focuses on deployment. The speaker advocates for self-hosting for cost predictability and control. The chosen platform is Hostinger for the VPS, and Dockploy for simplified deployment management. The process involves:
- Setting up a KVM2 VPS on Hostinger (using the coupon code "David" for a 10% discount).
- Installing Dockploy via the Hostinger control panel.
- Connecting the GitHub repository to Dockploy.
- Deploying the application using Nixpacks.
- Configuring the database connection (PostgreSQL) within Dockploy.
- Running Prisma migrations to create the database schema.
- Addressing deployment errors through AI-assisted debugging (using Clot Code to analyze logs).
8. Debugging and Finalization
The deployment process isn't without issues. The speaker demonstrates a practical debugging workflow:
- Identifying errors through browser console and Dockploy logs.
- Copying error messages and logs into Clot Code.
- Prompting Clot Code to analyze the logs and suggest solutions.
- Implementing the suggested fixes.
The final steps involve configuring environment variables and ensuring the database connection is correctly established.
Notable Quotes
- “The fewer lines of code, the better. If you're wondering how I'm doing this enter to the new line, because if you do shift enter, it will just send the message, right?” – Explaining a specific coding workflow within Clot Code.
- “The issue isn't that they add too little features, but that they add too many and they get overly excited and they keep bloating your codebase with unnecessary stuff.” – Highlighting the risk of feature creep with powerful AI coding assistants.
- “Changing the text stack later on is a very, very painful thing.” – Emphasizing the importance of careful technology selection early in the project.
- “What use is building an MVP if you don't know where to host it, if you don't know how to deploy it?” – Underscoring the importance of deployment planning.
- “If you're not building your own software, what are you doing?” – Encouraging viewers to leverage AI tools for software creation.
Data and Statistics
- Hostinger KVM2 VPS plans offer predictable costs, potentially significantly lower than cloud-hosted solutions like Vercel.
- The speaker mentions potential Vercel bills reaching hundreds of thousands of dollars due to serverless function usage.
- The hackathon with Gemini will have limited slots and take place in Warsaw, Poland in January 2026.
Conclusion
This video provides a comprehensive, practical guide to building and deploying an AI SAS. It demonstrates the power of AI coding assistants (Clot Code, Gemini 3 Pro) and emphasizes the importance of strategic prompt engineering, careful technology selection, and self-hosting for cost-effectiveness and control. The tutorial goes beyond simply building an application, showcasing a complete workflow from development to deployment and debugging, equipping viewers with the skills to bring their AI-powered ideas to life. The emphasis on using AI to learn and upskill is a key takeaway, positioning AI as a tool for empowerment rather than just automation.
Chat with this Video
AI-PoweredHi! I can answer questions about this video "How To Build & Deploy an AI SaaS End To End". What would you like to know?