The TypeScript starter for B2B SaaS
that charges in LatAm and worldwide.
Beztack is a monorepo starter with Mercado Pago and Polar billing, Better Auth organizations, a Vite + React app and a Nitro API. Plan changes, proration preview and admin retries are already built.
pnpm create beztackBuilt on Modern Tools
This project wouldn't be possible without the following gems
Project Architecture
Three apps, one monorepo. Each optimized for its purpose.
apps/ui
Frontend SPA
- Fast HMR & instant refresh
- shadcn/ui components
- Client-side routing
apps/api
Backend Server
- Portable Nitro build
- File-based routing
- Zod-validated handlers
apps/docs
Landing & Docs
- SSR & static generation
- MDX documentation
- Full-text docs search
Everything You Need
Ship faster with best practices and modern architecture built-in
Authentication Ready
Email and password sign-in with better-auth, plus two-factor, organizations with invitations and an admin role. Other sign-in methods are not set up yet.
Integrated Plugins
- 2FA Support
- Admin & Roles
- Organizations
Roadmap (not implemented yet)
Type-Safe Database
Drizzle ORM with full TypeScript support. Write queries with confidence, autocomplete, and zero runtime overhead.
Payments
Two providers behind one adapter interface, selected with the PAYMENT_PROVIDER environment variable. Charge in local currency with Mercado Pago, or sell worldwide through Polar.
Included providers
- Mercado Pago - local-currency subscriptions in Latin America
- Polar - merchant of record, SaaS and digital products only
Billing flows in the API
- Upgrades, downgrades and cadence changes (Polar only for cadence)
- Proration preview before the customer accepts
- Pending plan change ledger, activated on renewal
- Admin tier overrides, no charge
- Admin retry for failed plan changes
Modern UI Components
Beautiful, accessible components with shadcn/ui. Customizable and production-ready out of the box.
URL State Management
Type-safe URL search params with nuqs. Synchronize component state with the URL effortlessly with full TypeScript support and SSR compatibility.
Built-in Parsers
AI SDK Package
@beztack/ai re-exports the Vercel AI SDK and configures an Amazon Bedrock provider. It is a starting point: no app uses it yet and the API has no AI routes.
Provided by the AI SDK
TYPE_SAFE_ENV
Powered by T3 Env and Zod. Environment variables validated at build time with full TypeScript support.
RAPID_DEVELOPMENT
Powered by Vite. Experience hot module replacement, instant server start, and optimized build times.
MONOREPO_ARCHITECTURE
Powered by pnpm workspaces and NX. Efficient dependency management and task orchestration. Template Sync, which delivers template updates as pull requests, is on the roadmap and not available yet.
Start with billing already built
Scaffold a project, add your Mercado Pago or Polar credentials and run it locally.
pnpm create beztack