--- title: Chapters collection: AI Pitch Deck author: Suraj Kumar Jha updated: 2026-09-07 source: https://docs.chaicode.com/ai-pitch-deck/chapters --- # Chapters ![A founder typing an idea on a laptop screen that magically expands into an organized row of visual presentation slides.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/d4d9e85e68d7a9092c689ef0226d3311ce0bab0811e13c01d0a2ea5417a72cd5.jpg) AI Pitch Deck Builder Overview — Turn a raw business idea into a ready-to-pitch presentation deck in seconds. Got an idea for a 'Blinkit for fresh filter coffee'? Just enter the prompt. AI crafts the narrative, generates custom slide graphics, and saves everything. The result is delivered as an interactive, swipeable deck ready for Shark Tank. ![End-to-end flowchart from Browser to Next.js API, branching to Inngest background queue, OpenAI, ImageKit CDN, and Neon Postgres.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/18968e4a191c954b84a536e664df698abdbe240d291c6ad06a5f22a82fca3a4b.jpg) High-Level System Architecture — User submits a startup prompt via a Next.js App Router frontend. Lightweight API route creates a pending record and triggers a background event. Inngest orchestrates OpenAI agents to write content and create slide images. Images are hosted on ImageKit, deck data is saved in Postgres, and UI polls for completion. ![A terminal running 'pnpm dev' positioned beside a locked digital vault representing local environment variables.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/40c7d1c4ec439cb0434e43da1fa8d20043b9be479b770d754432af5f02c9f7a2.jpg) Project Setup & Environment Secrets — Modern Next.js 16 bootstrap using pnpm, TypeScript, Tailwind CSS, and shadcn/ui. Database powered by Neon Postgres with Prisma ORM for type-safe queries. Keep API keys for OpenAI, ImageKit, and Inngest strictly inside `.env`. Treat your `.env` secrets like your UPI PIN—never push them to public GitHub! ![Database schema diagram showing a 1-to-many relationship between a master 'Deck' table and child 'Slide' items with status indicators.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/fd616682e1c39aac5738dac17876cf4d749978cd93c9d8b76a5b0550f29a2742.jpg) Database Schema with Prisma — Parent-child data model: One Deck row connects to multiple Slide rows. Deck tracks startup idea, title, and lifecycle: PENDING → GENERATING → COMPLETE or FAILED. Slide stores order index, slide title, bullet points, and ImageKit CDN URL. Prisma migrations manage schema updates effortlessly on Neon serverless Postgres. ![A digital stencil filtering erratic AI text into neatly shaped, structured JSON blocks labeled title, content, and imagePrompt.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/66702d533c46a06300ce44a46428b052273da7bfeb34639d83627b3ccc853405.jpg) Structuring Output with Zod — Raw AI prompts can produce unpredictable, messy text that breaks frontends. Zod schema acts like a strict blueprint, forcing AI to return structured JSON. Enforces exactly 5 to 8 slides, each containing a title, bullet points, and image prompt. Guarantees that frontend components always receive clean, predictable data. ![Two shield icons flanking an AI brain: Shield 1 blocks short user inputs, Shield 2 reviews slides before approving the final output.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/5e250e33c67fd9b181b0d85605457aa306e1c1e70722c4cb14407556e9b02e73.jpg) AI Agent & Two-Way Guardrails — Input Guardrail: Discards vague prompts (like typing just 'hi') before wasting API tokens. Prompts must be at least 20 characters describing a realistic startup concept. Pitch Deck Agent: Generates slide headlines and arguments matching the Zod schema. Output Guardrail: An automated quality-checker agent inspects slides before saving. ![An AI illustration prompt converting into a clean graphic, uploading to an ImageKit cloud icon, and returning a fast HTTPS link.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/47a0a8d5db311fcc8a01b8b1016ca0afbc5bbb93f6797f533d5efc10e863ec02.jpg) Slide Imagery via ImageKit CDN — Each slide receives a tailored image prompt generated by the AI agent. OpenAI creates clean business illustrations matching the startup's theme. Generated image buffers upload directly to ImageKit CDN in a dedicated folder. Dev tip: Toggle placeholder images locally to test UI without spending API credits. ![A step-by-step horizontal progress tracker with checkmarks moving from 'load-deck' to 'run-agent', 'generate-images', and 'mark-complete'.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/af5e760e04c05f4be09eb5d9b0d67a601b745892e43dac1cb8b0a53c0e7a23b7.jpg) Background Orchestration with Inngest — Generating 6+ slides with high-res artwork takes 30+ seconds—too long for a standard API call. Inngest handles the entire workflow asynchronously step-by-step in the background. Breaks generation into atomic steps: load deck, run agent, create images, and save records. Provides automatic retries: if one slide image fails, the whole deck does not crash. ![A user hitting an API endpoint and immediately receiving a 201 Created ticket while a background worker picks up the job.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/ce5e5e3faa43c36e64f2c92e178560406e9a35f0d0a859a9f990492c1918db3c.jpg) Clean & Fast API Routes — API routes stay thin and fast because heavy AI generation runs in the background. POST /api/decks validates input length, saves a PENDING deck, and emits an Inngest event. Instantly responds with HTTP 201 so the user interface never freezes. GET /api/decks/[id] returns the latest status, error messages, and completed slides. ![A mobile UI mockup showing a loading radar that seamlessly swaps into a presentation carousel with 'Slide 3 of 7' pagination.](https://docs.chaicode.com/cdn-cgi/image/width=1600,format=auto,fit=scale-down/assets/15817f370b403dfad490f21a053a9d0e8b82eae276c06a2f1b1e62ce928e1f33.jpg) Frontend Polling & Slide Carousel — Home page (`/`): Founder enters their startup pitch and clicks 'Generate'. Detail page (`/decks/[id]`): Polls the API every 3s, like tracking a Swiggy delivery rider live. Shows a clean loading spinner during the GENERATING phase. Transitions automatically into an interactive slide carousel once status is COMPLETE.