// AI-native · agent-friendly
Ship AI SaaS that your coding agent can extend without hallucinating.
A Next.js 16 starter with authentication, credit-based billing, streaming AI, tool-calling agents, and RAG already wired together - and a codebase documented so Cursor and Claude Code extend the patterns instead of inventing new ones.
agent · extend
› add a credit-metered “summarize” endpoint
reading CLAUDE.md → matched the billable-endpoint pattern
+ src/app/api/summarize/route.ts
+ src/modules/ai/summarize.ts
pnpm typecheck && pnpm lint
✓ types ✓ lint ✓ build▍the stack, already wired - Next.js 16 · React 19 · Better Auth · Drizzle + Postgres · Vercel AI Gateway · Stripe / iyzico · pgvector · Resend
// ai-native
The AI parts are the hard parts. They're done.
- Six recipes: chat, RAG + PDF, summarize, extraction, images, agents
- Agent registry: streaming tool calls, human approval, saved threads
- A credit ledger that meters real token usage per request
- Metered API keys - let users call your AI from their own code
- Abuse guards: verified-email signups & per-IP rate limits
// agent-friendly
A codebase your agent reads before it writes.
- One CLAUDE.md as the single source of truth
- Feature-based modules with strict types and JSDoc
- Thin routes, thick modules - patterns worth copying
- An MCP server makes the running app agent-accessible too
- No any, no magic, no hidden global state
// in the box
Everything a launch needs, none of the plumbing.
- Email/password, Google OAuth & magic-link auth
- Account settings: password, email, GDPR deletion
- Credit packs (Stripe or iyzico) + monthly subscription
- Token-based metering + Postgres rate limiting
- Six AI recipes, from streaming chat to typed extraction
- Agent registry: define a tool-calling agent in ~20 lines
- pgvector RAG + chat-with-your-PDF upload
- Public API with metered, revocable API keys
- MCP server - agents can talk to your running app
- Admin panel: stats, user search, credit grants
- Lifecycle emails + scheduled crons (digest & agent ops report)
- Marketing site: this landing, blog & docs with SEO
- Critical-path Vitest tests + GitHub Actions CI
- Typed, fail-fast environment validation
- Migrations + one-click Vercel deploy
Clone it. Point your agent at it. Ship.
Skip the wiring and spend your first week on the product, not the setup.