Introduction
Official Beztack Documentation
Welcome to the Beztack docs. Beztack is a TypeScript monorepo starter for B2B SaaS that charges in Latin America and worldwide, with Mercado Pago and Polar behind one payment interface.
What is built today
- Billing: checkout, subscriptions and webhooks for both providers, plus plan changes: upgrades with a proration preview, downgrades at renewal, billing cadence changes, a pending plan change ledger, admin tier overrides and an admin retry for failed changes.
- Auth: email and password, two-factor, organizations with teams and invitations, and an admin role.
- App and API: a Vite + React SPA and a Nitro API, with PostgreSQL through Drizzle.
- Email, docs and env validation: React Email templates sent through Resend, this Fumadocs site, and T3 Env schemas.
Not built yet
- Template Sync (receiving template updates as pull requests). See Template Sync for the plan and for the experimental prototype that exists.
- More sign-in methods: OAuth providers, magic link, passkeys, multi-session, API keys and a breached-password check.
- More payment providers, for example Stripe.
Tech Stack
- Monorepo: Nx + pnpm for workspace management.
- Frontend: React 19 + Vite + Tailwind CSS v4 + shadcn/ui in
apps/ui. - Backend: Nitro with file-based routing in
apps/api. - Landing + Docs: Next.js +
Fumadocs in
apps/docs. - Auth: Better Auth with admin, organization, and twoFactor plugins.
- Payments: Provider-agnostic adapter pattern with Polar and Mercado Pago adapters in
packages/payments. - Database: Drizzle ORM + PostgreSQL in
@beztack/db. - Email: React Email + Resend in
@beztack/email. - Environment: T3 Env + Zod for centralized env validation in
@beztack/env. - AI:
@beztack/aire-exports the Vercel AI SDK and configures an Amazon Bedrock provider. No app uses it yet. - OCR: one Tesseract.js helper in
@beztack/ocr, used by an example page. - URL State: nuqs in
@beztack/state. - CLI:
beztack(packages/cli) scaffolds projects withpnpm create beztack.
Project Structure
The repo is organized into apps and shared packages:
apps/ui: React 19 SPA with TanStack Query, React Router v7, and i18next.apps/api: Nitro REST API with unified payment routes (/api/subscriptions/*) and admin routes (/api/auth/admin/*).apps/docs: Next.js landing page and documentation with Fumadocs.packages/: shared packages for auth helpers, database, payments (core, Mercado Pago, Polar), email, env validation, AI, OCR, state management, and the CLI.
Check out the sidebar sections to dive deeper into each aspect of Beztack development.