Monorepo based on Next.js App Router and Turborepo + pnpm, with the main app separated from shared packages such as db, ai, agents, emails, storage, and ui
wonderkit — Next.js SaaS Template
By zimkk
WonderKit is an open-source AI SaaS starter kit built on Next.js, organized around the goal of letting coding agents extend it without human intervention, with built-in multi-tenant organizations, Stripe subscription billing, a multi-model AI abstraction layer, and a multi-agent runtime.
Explore the design
Compare the page layouts and mobile experience. Open any screenshot for a closer look.
Actual screenshot captured by the server browser.
All pages & views 3
Screenshots show visual appearance; interactive behavior may differ.
What stands out
A quick read of the recorded project description.
Auth.js v5 authentication; in development only DATABASE_URL and AUTH_SECRET are required, and magic links are printed directly to the terminal
Multi-tenant organizations and role system, with authorization uniformly handled through requireOrgRole, plus email invitations and a team management interface
Stripe subscription billing, with plans defined as data in plans.ts, gate() throwing PlanLimitError according to quotas, and support for usage-based token overage reporting
AI provider abstraction layer supporting Anthropic, OpenAI, OpenRouter, and Ollama, including pricing tables and streaming chat
Multi-agent runtime with four built-in agents—Orchestrator, Researcher, Writer, and Ops—persisting runs and steps to the database, and providing eval testing tools
Template Details
WonderKit is an open-source starter kit for AI SaaS scenarios, using the Next.js App Router and a Turborepo + pnpm monorepo structure. The main application lives in apps/web, while shared capabilities are split into packages such as db, ai, agents, emails, storage, and ui. It pre-wires common modules including authentication, multi-tenant organizations, API keys, subscription billing, AI calls, and agent runs, making it suitable as a base for further AI product development.
The project emphasizes an "agent-native" design: CLAUDE.md and AGENTS.md at the repository root provide operating rules for coding agents, docs/agent offers an architecture map, and docs/prompts collects 9 validated agent prompts. Conventions include: authorization always goes through requireOrgRole, LLM calls always go through packages/ai, asynchronous side effects always go through Inngest, environment variables are always read via @/env, and plan limits are always read from PLANS data via gate().
At the feature level, authentication uses Auth.js v5; in development, only DATABASE_URL and AUTH_SECRET are needed to start, and magic links are printed to the terminal. Organizations support OWNER/ADMIN/MEMBER roles and an invitation flow. API keys are stored only as SHA-256 hashes and shown once. Billing is implemented through Stripe with Free/Starter/Pro subscription tiers and usage-based token overage reporting. The AI layer abstracts four provider types: Anthropic, OpenAI, OpenRouter, and Ollama. The agent runtime includes four built-in agents—Orchestrator, Researcher, Writer, and Ops—and uses pgvector for semantic memory.
Limitations and boundaries: the repository materials do not give specific version numbers for dependencies, nor do they describe production performance or stability. Third-party assets such as demo images, fonts, and icons need separate license verification. External services such as domains, hosting, databases, payments, and AI may incur additional costs. The roadmap item "Demo video + hosted demo" remains incomplete.
Is it right for your project?
Use Cases
- Developing a team-oriented AI SaaS product starting from ready-made authentication, organization, billing, and AI call modules
- Needing multi-model switching and wanting to switch among Anthropic, OpenAI, OpenRouter, and Ollama via environment variables in the same codebase
- Building multi-agent workflows with persisted run records and semantic memory, such as collaboration among research, writing, and operations agents
- Preparing an extensible codebase for coding agents, using AGENTS.md, CLAUDE.md, and docs/prompts to constrain the scope of agent changes
Suitable For
- Developers familiar with Next.js, TypeScript, and Prisma who want to quickly build an AI SaaS skeleton
- Teams needing an integrated implementation of multi-tenant organizations, role permissions, and subscription billing
- Teams planning to involve coding agents in daily development and willing to follow the repository's conventions and prompts
- Projects intending to self-host or deploy to Vercel and accepting that they must configure external services such as databases, payments, and AI themselves
Getting started & customization
Use these recorded setup notes alongside the repository instructions for your chosen version.
- 1
Local running requires Node 22+, pnpm 10+, and Docker Desktop; first run pnpm install and copy .env.example to .env
- 2
Only DATABASE_URL and AUTH_SECRET are required to start; other environment variables are enabled as needed and feature-detected at startup
- 3
Use docker compose -f docker-compose.dev.yml up -d to start a local Postgres with pgvector, then run Prisma migrations and seed data
- 4
In development, enter any email on the login page; the magic link is printed to the terminal, so no Resend key is needed
- 5
Deployment can be on Vercel or self-hosted with Docker Compose; CI runs type checks, builds, and Prisma migrations via GitHub Actions on pushes to main
License & source material
Usage conditions & limitations
Free to use · keep license noticeThis entry covers the free version under the MIT license in the public repository; the free scope is the code of that version and does not mean external services or third-party assets are free.
Must comply with when using
- The code of this version may be used, modified, commercially used, and distributed for free.
- When distributing copies or substantial portions of the code, retain the original author's copyright notice and the full MIT license notice.
- The code is provided as is; warranties and limitations of liability are governed by the original license and applicable law.
Additional costs & items to verify
- Billing functionality depends on the external Stripe service; you must register a Stripe account and configure keys yourself, which may incur additional costs such as payment processing fees.
- File storage depends on the external Cloudflare R2 service; you must open an account and configure credentials yourself, which may incur storage and traffic fees.
- Production email sending depends on the external Resend service and requires configuring RESEND_API_KEY; in development it can simply print to the terminal.
- Asynchronous tasks depend on the external Inngest service; production requires configuring event keys, while development can run with local keys.
- AI capabilities require connecting to external providers such as Anthropic, OpenAI, OpenRouter, or Ollama; you must provide your own API keys and bear call costs.
- Deployment requires preparing a Vercel or VPS hosting environment yourself; domains, servers, and databases may incur additional costs.
- The roadmap's demo video and online demo are not yet complete, and the project currently does not provide a directly accessible hosted demo.
- Demo images, fonts, icons, and other third-party assets must be checked against their respective licenses and cannot be judged solely by the code's MIT license.
- External services such as domains, hosting, databases, payments, or AI may be charged separately.
View Original Text Basis
Permission is hereby granted, free of charge
Original License Text
Stripe Checkout + Customer Portal via server actions
Original README
Storage | Cloudflare R2 | Presigned uploads, org-scoped authz
Original README
Email | Resend + React Email | Typed templates, dev console transport
Original README
Jobs | Inngest | Durable agent runs, crons, retries
Original README
AI | Provider abstraction | Swap Anthropic / OpenAI / OpenRouter / Ollama via env
Original README
Deploy | Vercel or VPS | Docker Compose + GitHub Actions CI/CD
Original README
https://github.com/zimkk/wonderkit/blob/main/LICENSEhttps://github.com/zimkk/wonderkit/blob/main/README.mdDemo video + hosted demo
Original README
Compiled by DeepSeek based on repository license and README ·2026-10-01. Results only cover the materials read; dependencies, images, fonts, and subsequent term changes are subject to their respective original texts.
Project checks & description sources
Template Information
- Source platforms
- GitHub
- Documentation and maintenance reference score
- More documented · 88 / 100
- Technologies
- Next.js · React
- Website type
- SaaS · Starter
How this score is calculated
Our heuristic uses license records (up to 30), a demo link (12), a preview (10), stars (15), recorded maintenance (15), description completeness (8), feature records (5) and classification data (5). It is not a code, security or performance test, or a Google score. A link does not establish tested functionality.
What to verify for this project
- Repository update recorded
- 2026-06-11
- Screenshot last checked
- 2026-10-01
A demo link is listed. Check it with your own content and viewport sizes; its presence does not confirm that forms, authentication or payments work.
The catalog identifies Next.js as the primary stack. Check the actual dependency manifest and lockfile for versions and hosting requirements. These notes use recorded metadata, not a code audit or a deployment test.
Use a selection guide →How this description was prepared
AI-assisted description based on catalog records and repository material. Repository authors are not automatically the reviewers of this description.
Automatically checked against source and license rules; no manual editorial review.
Inspect the recorded source material
SHA-256: 7324c171436b56e866e6ad45185a5102fb3a2051a74dd0e747386ed0611c8a6d
2026-10-01T01:25:23.101Z
Source file / repository# WonderKit **The open-source, agent-native AI SaaS starter kit.** A fresh Claude Code session, given only this repo, can add a new AI feature, billing tier, or multi-agent workflow — without human rescue. That's the bar WonderKit is built to clear. [](LICENSE) [](https://www.typescriptlang.org/) [](https://nextjs.org/) [](https://github.com/zimkk/wonderkit/actions/workflows/ci.yml) --- ## What's inside | Layer | Tech | What it gives you | |---|---|---| | Framework | Next.js 15 App Router | RSC, streaming, server actions | | Database | PostgreSQL 16 + pgvector | Relational data + vector memory | | ORM | Prisma 6 | Type-safe queries, migrations | | Auth | Auth.js v5 | Magic link, Google, GitHub — feature-detect | | Billing | Stripe | Subscriptions + metered token overage | | Jobs | Inngest | Durable agent runs, crons, retries | | Email | Resend + React Email | Typed templates, dev console transport | | Storage | Cloudflare R2 | Presigned uploads, org-scoped authz | | AI | Provider abstraction | Swap Anthropic / OpenAI / OpenRouter / Ollama via env | | Agents | Multi-agent runtime | Orchestrator, researcher, writer, ops — persisted to DB | | Monorepo | Turborepo + pnpm | `apps/web` + shared `packages/*` | | Deploy | Vercel or VPS | Docker Compose + GitHub Actions CI/CD | --- ## Quickstart **Requirements:** Node 22+, pnpm 10+, Docker Desktop ```bash git clone https://github.com/zimkk/wonderkit.git cd wonderkit # Install dependencies pnpm install # Configure environment cp .env.example .env # Edit .env — only DATABASE_URL and AUTH_SECRET are required to start # Start local Postgres with pgvector docker compose -f docker-compose.dev.yml up -d # Run migrations and seed demo data pnpm --filter @kit/db exec prisma migrate dev pnpm --filter @kit/db exec prisma db seed # Start the dev server pnpm dev ``` Open **http://localhost:3000**. Enter any email on the login page — the magic link prints to your terminal (no Resend key needed in dev). --- ## Project structure ``` wonderkit/ ├── apps/ │ └── web/ # Next.js 15 app (dashboard, API, marketing) │ ├── src/app/ # App Router pages & layouts │ ├── src/auth.ts # Auth.js v5 config │ ├── src/env.ts # Typed env (t3-env) — never read process.env directly │ ├── src/lib/ # stripe.ts, billing.ts, org.ts │ └── inngest/ # Inngest client + functions ├── packages/ │ ├── db/ # Prisma schema, requireOrgRole, gate(), PLANS, typed errors │ ├── ai/ # LLM provider abstraction, pricing table, rate limiter │ ├── agents/ # defineAgent, runAgent, 4 built-in agents, eval harness │ ├── emails/ # 5 React Email templates + sendEmail() │ ├── storage/ # R2/MinIO signed URL helpers │ └── ui/ # Shared React primitives (Button, Card, cn) ├── docs/ │ ├── agent/ # Architecture map for coding agents │ └── prompts/ # 9 verified agent prompts (base → eval judge) ├── skills/ # Reusable agent skill cards ├── deploy/ │ ├── vercel/ # Vercel deploy guide │ └── vps/ # Docker Compose + Dockerfile for self-hosting ├── AGENTS.md # Agent operating manual — read before coding ├── CLAUDE.md # Golden rules enforced by ESLint boundary rules └── PROVENANCE.md # Authorship + dependency attribution ``` --- ## Agent-native design WonderKit is the only starter kit built around the question: *can a coding agent extend this without human rescue?* Every convention is a checkable rule: ``` // All authz via requireOrgRole — never inline role checks // All LLM calls via packages/ai — never import vendor SDKs in app code // All async side effects via Inngest — never fire-and-forget promises // All env via @/env — never read process.env directly // All plan gating via gate() reading PLANS — quotas are data, not code ``` `CLAUDE.md` at the repo root tells any coding agent exactly where things go, what not to touch, and how to verify its work. `AGENTS.md` is the full operating manual. `docs/prompts/` has 9 verified prompts covering every agent persona. --- ## Features ### Auth (zero config in dev) - Magic link sign-in — URL prints to terminal when `RESEND_API_KEY` is unset - Optional Google + GitHub OAuth (auto-detected from env) - Database sessions via Auth.js v5 + Prisma adapter - Auto-creates org + FREE subscription on first sign-in ### Multi-tenant organisations - One user → many orgs, one active at a time (cookie-based switcher) - Roles: `OWNER > ADMIN > MEMBER` - `requireOrgRole(session, orgId, role)` is the single authz primitive — no inline checks anywhere - Invitation flow: email-gated invite tokens, role assignment, plan member-limit enforcement - Team management UI: member list + remove, pending invitations + cancel, invite form - `/invite/[token]` accept page: validates token expiry and email match before creating membership ### API key management - `createApiKey()` generates `sk_live_*`, stores only SHA-256 hash, returns plaintext once - "Show once" copy widget in the UI — plaintext never persists on the server - `revokeApiKey()` for immediate invalidation - `resolveApiKey()` in `packages/db` for authenticating API requests ### Billing (Stripe) - Free / Starter ($29) / Pro ($99) plans defined as data in `packages/db/src/plans.ts` - `gate(orgId, feature)` throws `PlanLimitError(402)` when over quota - Stripe Checkout + Customer Portal via server actions - Webhook: raw body + signature verification — handles `checkout.session.completed`, `subscription.updated/deleted`, `invoice.payment_failed` - Inngest events emitted for all billing side effects ### AI provider layer - `LlmProvider` interface implemented for Anthropic, OpenAI, OpenRouter, and Ollama - `defaultProvider()` auto-selects based on available env vars - Pricing table with `costUsd()` for per-request cost tracking - Streaming chat with SSE — token costs written to `UsageEvent` after each response ### Multi-agent runtime - `defineAgent(config)` registers agents in a global registry - `runAgent(agentId, ctx)` persists `AgentRun` + `AgentStep` to the database - 4 built-in agents: **Orchestrator**, **Researcher**, **Writer**, **Ops** - pgvector semantic memory: `storeMemory()` + `retrieveMemories()` - Eval harness: `pnpm --filter @kit/agents eval --agent orchestrator --suite basic` ### Email - 5 typed templates: `WelcomeEmail`, `MagicLinkEmail`, `InviteEmail`, `PaymentFailedEmail`, `UsageAlertEmail` - `sendEmail(template, props, to)` — logs HTML to console in dev, sends via Resend in prod ### Jobs (Inngest) - Nightly usage rollup cron (`UsageEvent` → `UsageDailyRollup`) - `onPaymentFailed` → sends `PaymentFailedEmail` - `onSubscriptionProvisioned` → sends `WelcomeEmail` - `onUsageAlert` → sends `UsageAlertEmail` to org owner when usage ≥ 80% of monthly quota - Nightly rollup also reports metered overage tokens to Stripe (`subscriptionItems.createUsageRecord`) - Dev works without `INNGEST_EVENT_KEY` (uses `"local"` key) --- ## Environment variables Only two variables are required to run locally: ```bash DATABASE_URL=postgresql://wonderkit:wonderkit@localhost:5433/wonderkit AUTH_SECRET=<openssl rand -base64 32> ``` Everything else is optional and feature-detected at startup. See [`.env.example`](.env.example) for the full annotated list. --- ## Deployment **Vercel** (fastest): connect repo → add env vars → deploy. See [`deploy/vercel/README.md`](deploy/vercel/README.md). **Self-host**: Docker Compose stack (app + postgres). See [`deploy/vps/docker-compose.yml`](deploy/vps/docker-compose.yml) and the `Dockerfile`. **CI**: GitHub Actions runs typecheck → build → Prisma migrate on every push to `main`. See [`.github/workflows/ci.yml`](.github/workflows/ci.yml). --- ## Roadmap - [x] Phase 1 — Monorepo, auth, DB schema, dashboard shell - [x] Phase 2 — Stripe billing, Inngest jobs, email templates, R2 storage - [x] Phase 3 — AI provider layer (Anthropic/OpenAI/OpenRouter/Ollama), streaming chat - [x] Phase 4 — Agent context layer, AGENTS.md, 9 verified prompts, skills - [x] Phase 5 — Multi-agent runtime, pgvector memory, eval harness - [x] Phase 6 — Admin panel, deploy guides (Vercel + VPS), GitHub Actions CI - [x] Invitation flow + team management UI (`/app/settings/team`, `/invite/[token]`) - [x] API key management UI (`/app/settings/api-keys`, SHA-256 hash storage) - [x] Usage alerts (email at 80% quota via Inngest + UsageAlertEmail) - [x] Stripe metered billing for token overage (nightly rollup reports to Stripe) - [ ] Demo video + hosted demo --- ## Contributing Issues and PRs welcome. Read `AGENTS.md` before contributing — it's the same guide the AI coding agents use, and it tells you exactly where new code goes. --- ## License MIT © [Hassan Nazir](https://github.com/zimkk) — see [LICENSE](LICENSE).
Explore similar templates
Compare previews and descriptions within the same stack and category.

Next.js SaaS Starter
The official Next.js SaaS starter template, integrating email/password authentication, Stripe Checkout subscriptions, a dashboard with user/team CRUD, basic Owner/Member RBAC, and activity logging.
Next.js · SaaS

Next.js Commerce
Vercel's officially maintained Next.js App Router ecommerce starter with deep Shopify integration, offering a complete product catalog, cart, and checkout flow. Core logic is modular for swapping backends, and community provider versions exist for BigCommerce, Medusa, and Saleor.
Next.js · E-commerce

Next-js-Boilerplate
A developer-first Next.js 16 starter with Tailwind CSS 4 and TypeScript, supporting both App Router and Page Router.
Next.js · Starter

tailwind-nextjs-starter-blog
A Next.js and Tailwind CSS blog starter template using Contentlayer for Markdown/MDX, with built-in SEO, code highlighting, and tags. It targets personal technical blogs and migration from Jekyll/Hugo to React, and supports one-click Vercel deployment.
Next.js · Blog

next-forge
next-forge is a Turborepo-based Next.js template maintained by Vercel, positioned as a starting point for SaaS products.
Next.js · Starter

SaaS-Boilerplate
SaaS-Boilerplate is an open-source SaaS starter template built with Next.js App Router, React 19, TypeScript, Tailwind CSS, and Shadcn UI.
Next.js · SaaS
