Documentation
Introduction
What Motoko Base is, what it includes, and how to use this documentation.
Motoko Base is a production-ready, full-stack SaaS starter for Next.js. It is not a finished end-user product — it is a foundation you clone, configure, and extend while keeping the same patterns for auth, data, billing, and integrations.
Use this documentation to understand how the starter is structured, what ships out of the box, and how to customize it for your own product.
What is Motoko Base?
Motoko Base gives you a complete application skeleton: authenticated dashboard, protected routes, database layer, billing abstraction, transactional email, optional storage and AI demos, analytics and monitoring plumbing, marketing pages, and developer tooling.
The goal is simple — build your SaaS, not its infrastructure. You focus on product features; the starter handles the repetitive wiring that every SaaS needs.
What is included in the starter?
Core foundation
- Authentication — Better Auth with email/password, verification, password reset, and optional Google and GitHub OAuth
- Database — PostgreSQL with Drizzle ORM, type-safe schemas, and migrations
- Billing — Polar integration with checkout, subscriptions, webhooks, and entitlements (soft-fails when not configured)
- Email — Resend for transactional mail (verification, password reset, templates)
- Dashboard shell — Sidebar navigation, settings, theme, and protected layout
- Marketing site — Landing page, pricing section, docs, and changelog
- Internationalization — next-intl with five locales, localized marketing URLs, message catalogs, and SEO hreflang
- Analytics & monitoring — PostHog and Sentry integrations (optional, non-blocking)
- AI-ready infrastructure — Vercel AI SDK with an OpenAI-compatible provider
Demo features
Demo features live under the Demos nav group. They show real architecture you can copy into your product or delete entirely:
- Link Manager — CRUD links with public redirect routes (
/r/[slug]) - File Storage — Cloudflare R2 uploads with ownership checks
- AI Email — Streaming AI endpoint integrated into the dashboard
Demos are intentionally removable. See the README for a safe deletion checklist.
Who is it for?
Motoko Base is built for developers and small teams who want to ship a SaaS product faster without assembling the same stack from scratch every time.
It is a good fit if you:
- Want a real, working application — not a minimal template with placeholder routes
- Prefer opinionated patterns over a blank canvas (server actions, feature folders, Zod validation)
- Need production integrations wired but soft-failing when env vars are unset
- Plan to own and modify the source — add features, remove demos, swap providers
It is not aimed at non-developers or teams looking for a no-code builder.
How this documentation is organized
Docs are version-controlled MDX files under content/docs/, rendered at /docs with Fumadocs.
- Sidebar — driven by
meta.jsonfiles in each folder; add pages by creating an MDX file and listing it in the folder'smeta.json - Getting started — installation and first-run setup (start here)
- Internationalization — locales, routing, message catalogs, and adding translations
- Guides — deeper dives into features and integrations (added as the docs grow)
- Changelog — product updates at
/changelog, also MDX undercontent/changelog/
Each page supports frontmatter (title, description) and standard Markdown. Code blocks, headings, and cross-links work out of the box.
For agent-oriented architecture rules, see AGENTS.md in the repository root.
Try the live demo
Before you install locally, explore the running application:
The demo lets you sign in, browse the dashboard, and try the included demo features — authentication, billing UI, settings, Link Manager, Storage, and AI Email — so you can see how the starter behaves in practice.
Next steps
Ready to set up your own copy?
Installation — Clone, configure env vars, run migrations, and start the dev server.
Project structure — Where code lives and how folders are organized.