
TL;DR
A practical guide to building Next.js apps using Claude Code, Cursor, and the modern TypeScript AI stack.
Read next
The definitive full-stack setup for building AI-powered apps in 2026. Next.js 16, Vercel AI SDK, Convex, Clerk, and Tailwind - why each piece matters and how they fit together.
12 min readHow to go from idea to deployed SaaS product using Claude Code as your primary development tool. Project setup, feature building, deployment, and iteration.
10 min readWhat vibe coding actually means, how to do it well, the tools that enable it, and why it's changing how software gets built in 2026.
8 min readMost "build with AI" tutorials skip the part that actually matters: picking the right foundation. Your AI coding tools are only as good as the stack underneath them. Choose services that reduce boilerplate, and the AI has less room to hallucinate. For the strategic version of this stack choice, read the agentic development stack and the Next.js AI app stack guide.
Here is the stack that works in 2026:
Each of these tools is TypeScript-native. That matters. When your entire stack shares a type system, AI tools can reason about your code end-to-end. A Convex schema informs your API routes, which inform your React components. The AI sees one language, one type graph, one project. The same principle is why the TypeScript patterns for AI developers guide focuses on explicit schemas, discriminated unions, and typed tool boundaries.
Start in the terminal. Claude Code works best when you give it a clear, bounded task with real context.
npx create-convex@latest my-app --template nextjs-clerk
cd my-app
This gives you a Next.js project pre-wired with Convex and Clerk. The installation includes rules files that teach your AI tools how the stack works. Now open Claude Code and give it your first prompt:
Set up a SaaS app with:
- Clerk auth with Google OAuth
- Convex schema for projects (name, description, userId, createdAt)
- A protected dashboard that lists the user's projects
- A create project form with validation
Claude Code will generate the Convex schema, mutations, queries, middleware, and React components in one pass. The key is that it has real files to work with. It reads your convex/ directory, understands the Clerk integration, and produces code that fits.
A few rules for better results:
Be specific about data. "A projects table" is vague. "A projects table with name (string, required), description (string, optional), userId (string, indexed), and createdAt (number)" gives the AI what it needs to generate correct schema definitions and TypeScript types.
Set up API keys first. Configure your Clerk publishable key, Convex URL, and any third-party API keys before you start prompting. AI tools produce better code when they can validate against real endpoints.
Keep prompts focused. One feature per prompt. "Add a project creation form with Zod validation" is better than "build the whole dashboard with forms, tables, search, and pagination." If you want a starting set of focused-feature prompts to crib from, our prompt library is grouped by exactly this kind of task.
Once the foundation exists, you layer features. Each prompt builds on the last.
Add a settings page where users can update their display name
and notification preferences. Store preferences in Convex.
Use Clerk's useUser() for the current user.
Then:
Add real-time collaboration: when a user edits a project,
other team members see changes instantly via Convex subscriptions.
Then:
Add role-based access. Organization admins can delete any project.
Members can only edit their own. Use Clerk's org permissions.
Each prompt is small and testable. You verify the output, commit, and move on. This mirrors how experienced developers work with AI tools: small iterations, frequent verification, version control at every checkpoint.
The TypeScript compiler catches most structural mistakes immediately. If Claude Code generates a mutation that expects a field your schema does not have, tsc flags it before you even run the app. This feedback loop is why TypeScript matters so much for AI-assisted development.
Get the weekly deep dive
Tutorials on Claude Code, AI agents, and dev tools - delivered free every week.
From the archive
Mar 19, 2026 • 25 min read
Mar 19, 2026 • 5 min read
Mar 19, 2026 • 5 min read
Mar 19, 2026 • 5 min read
Cursor excels at the refinement phase. Where Claude Code is best for generating new files and wiring up integrations, Cursor's inline editing and multi-file awareness make it ideal for:
Open your project in Cursor and use the agent panel. Start with visual issues:
The project cards look flat. Add subtle shadows, consistent padding,
and a hover state that lifts the card slightly.
Make it match the rest of the Tailwind design system.
Then move to code quality:
Extract the Convex query patterns in the dashboard into a custom hook.
Add proper loading and error states to every data-fetching component.
Cursor's speed advantage shows up here. Refinement is inherently iterative. You make a change, check the result, adjust, repeat. Faster completions mean tighter loops.
Deployment with this stack is three commands:
npx convex deploy
vercel --prod
Convex deploys your backend functions and schema to production. Vercel deploys your Next.js app. Clerk has a toggle in the dashboard to switch from development to production mode.
Set your environment variables in Vercel:
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=pk_live_...
CLERK_SECRET_KEY=sk_live_...
NEXT_PUBLIC_CONVEX_URL=https://your-project.convex.cloud
Push to main, and Vercel auto-deploys. Your app is live with authentication, real-time data, and a production database. No Docker, no Kubernetes, no infrastructure to manage.
The biggest mistake developers make with AI coding tools is using one tool for everything. Each tool has a sweet spot:
Claude Code is best for greenfield scaffolding, complex integrations, and tasks that require reading and modifying many files. It runs in your terminal, has access to your full project, and generates code that fits your existing patterns. Use it when you need to wire up a new feature end-to-end.
Cursor is best for iteration, refactoring, and visual polish. Its inline editing and fast completions make it ideal for the dozens of small adjustments that turn a working prototype into a polished product. Use it when the feature exists but needs refinement.
Both tools together produce the fastest workflow. Scaffold with Claude Code, iterate with Cursor. The handoff is natural: Claude Code generates the files, you open them in Cursor, and refine from there. For the direct decision path, see Claude Code vs Cursor and the broader Claude Code vs Cursor vs Codex breakdown.
This workflow depends on TypeScript. Without static types, AI tools produce code that looks right but breaks at runtime. With TypeScript, the compiler acts as an automated reviewer that catches mistakes the AI makes.
Convex takes this further. Its schema definitions generate TypeScript types that flow through your entire application. When you change a field name in your schema, every query, mutation, and component that references it gets a type error. The AI can then fix all of those errors in one pass because the type system tells it exactly what changed.
This is why the "TypeScript everywhere" approach works so well with AI. The type system is the context. It tells the AI what your data looks like, what your functions accept, and what your components expect. More context means better code generation.
A realistic timeline for a production SaaS using this workflow:
Six hours to a deployed, authenticated, real-time SaaS application with billing. That is not a demo. That is a product you can put in front of customers.
The tools are not magic. You still need to understand what you are building, verify every output, and make architectural decisions. But the mechanical work of writing boilerplate, configuring services, and wiring components together is now handled by AI.
If you want to learn these tools in depth, check out the courses on this site:
The stack is set. The tools are ready. The only variable left is what you decide to build.
The recommended stack is Next.js 16 for the frontend, Convex for the database and real-time sync, Clerk for authentication, Claude Code for scaffolding, and Cursor for iteration. This stack is fully TypeScript-native, which allows AI tools to reason about your code end-to-end. The shared type system between your database schema, API routes, and React components reduces AI hallucinations and catches errors at compile time.
Use both. Claude Code excels at greenfield scaffolding, complex integrations, and tasks that touch many files. It runs in your terminal with full project access. Cursor excels at iteration, refactoring, and visual polish with fast inline editing. The ideal workflow is to scaffold with Claude Code, then refine with Cursor.
With the TypeScript stack described in this guide, you can go from zero to a deployed SaaS with authentication, real-time data, and billing in about six hours. This includes the dashboard, CRUD operations, organization support, role-based access, and production deployment. The AI handles boilerplate and wiring while you make architectural decisions and verify output.
You need enough programming knowledge to review AI output, catch bugs, and make architectural decisions. AI tools accelerate development but do not replace understanding. Developers who know TypeScript, React, and database design get dramatically better results than those prompting blind. The AI amplifies your existing knowledge - it does not substitute for it.
TypeScript provides the context AI tools need to generate accurate code. The compiler catches structural mistakes immediately, acting as an automated reviewer. When your schema, API, and components share types, the AI can reason about your entire application. A type error tells both you and the AI exactly what went wrong and where. Without static types, AI code looks correct but breaks at runtime.
Yes. The Convex, Clerk, and Next.js stack works with any AI coding tool that can read TypeScript files. Copilot, Codex, Windsurf, and other tools all benefit from the same TypeScript-native architecture. Claude Code and Cursor are recommended because they offer the best agentic capabilities for multi-file operations, but the stack is tool-agnostic.
Convex and Clerk both have generous free tiers suitable for development and early production. Vercel has a free hobby tier for deployment. Claude Code requires an Anthropic subscription (Pro at $20/mo or Max at $200/mo). Cursor Pro is $20/mo. A production SaaS with real users will cost $40-50/month minimum for the AI tools, plus usage-based costs for Convex and Clerk as you scale.
Add error handling as a dedicated iteration step after core features work. Prompt your AI tool to "add proper loading and error states to every data-fetching component" and let it update multiple files in one pass. The TypeScript compiler surfaces missing error handling as type errors when you use strict null checks. Always review AI-generated error boundaries before shipping to production.
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.
AI app builder - describe what you want, get a deployed full-stack app with React, Supabase, and auth. No coding requi...
View ToolStackBlitz's in-browser AI app builder. Full-stack apps from a prompt - runs Node.js, installs packages, and deploys....
View ToolFull-stack AI dev environment in the browser. Describe an app, get a deployed project with database, auth, and hosting....
View ToolThe TypeScript toolkit for building AI apps. Unified API across OpenAI, Anthropic, Google. Streaming, tool calling, stru...
View ToolStep-by-step guide to building an MCP server in TypeScript - from project setup to tool definitions, resource handling, testing, and deployment.
AI AgentsInstall the dd CLI and scaffold your first AI-powered app in under a minute.
Getting StartedReal-time prompt loop with history, completions, and multiline input.
Claude Code
The definitive full-stack setup for building AI-powered apps in 2026. Next.js 16, Vercel AI SDK, Convex, Clerk, and Tail...

How to go from idea to deployed SaaS product using Claude Code as your primary development tool. Project setup, feature...

What vibe coding actually means, how to do it well, the tools that enable it, and why it's changing how software gets bu...

A practical guide to using Claude Code in Next.js projects. CLAUDE.md config for App Router, common workflows, sub-agent...

Claude Code is Anthropic's terminal-based AI agent that ships code autonomously. Complete guide: install, CLAUDE.md memo...

From terminal agents to cloud IDEs - these are the AI coding tools worth using for TypeScript development in 2026.

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.