Production-ready SaaS template with authentication, payments, analytics, and everything a modern project needs. Perfect for learning modern fullโstack development or starting your next project.
Docs โข Getting Started โข Architecture โข Blog
If this saves you time, please โญ the repo.
Apps:
- ๐ Landing Page (
web) โ Marketing site - ๐ Dashboard (
app) โ Admin app with tasks, billing, analytics & TanStack Query - ๐ Serverless API (
api) โ Next.js 15 Route Handlers with Zod validation - ๐ Documentation (
docs) โ Astroโpowered docs with Starlight
Features:
- โก Monorepo โ Turborepo for fast builds and caching
- ๐ Authentication โ Custom JWT with protected routes & bcrypt
- ๐๏ธ Database โ Neon Postgres + Drizzle ORM with drizzleโzod
- ๐ Data Fetching โ TanStack Query with optimistic updates
- ๐ณ Payments โ Stripe subscriptions + webhooks
- ๐ง Email โ Resend with React Email templates
- ๐จ UI โ shadcn/ui + Tailwind CSS v4 + Radix UI primitives
- ๐ Analytics โ PostHog tracking + Axiom logging
- โ๏ธ Jobs โ Serverless cron by default; Trigger.dev background tasks
- ๐งช Testing โ Vitest unit tests + Playwright E2E
- ๐ Forms โ React Hook Form + Zod validation
- ๐ Theming โ Dark mode with nextโthemes
Typeโsafe stack: Database Schema โ Autoโgenerated Types โ Shared Packages โ API โ Frontend
- Separation of concerns โ clear boundaries between UI, domain, and data reduce coupling and increase clarity.
- Layered & modular โ features are encapsulated in layers/modules, making refactors and tech swaps low-risk.
- Monorepo with shared packages โ reusable types/utilities/components drive consistency and avoid duplication.
- End-to-end type safety โ a single source of truth for models cuts errors and surfaces issues at compile time.
- Portability & future-proofing โ parts can be moved, replaced, or scaled without disrupting the rest.
- Developer experience & speed โ monorepo caching, one-command flows, and a predictable layout.
- Testability & observability โ isolated interfaces make unit/E2E testing and logging/monitoring straightforward.
- Team-friendly ownership โ clear package boundaries enable independent changes without blocking others.
# 1) Use this template or clone
git clone https://github.com/YOUR-USERNAME/your-project-name
cd your-project-name
pnpm install
# 2) Set up environment variables (see below)
# 3) Initialize database
pnpm db:push
# 4) Start everything
pnpm devOptional: Rename โorion-kitโ to your own project name in
package.json, docs, env files, and the repo name.
Apps running:
- ๐ Landing: http://localhost:3000
- ๐ Dashboard: http://localhost:3001
- ๐ API: http://localhost:3002
- ๐จ Studio: https://local.drizzle.studio?port=3003
- ๐ Docs: http://localhost:3004
Required accounts (all have generous free tiers):
| Service | Purpose | Free Tier |
|---|---|---|
| Neon | Database | 0.5GB |
| Stripe | Payments | No fees |
| Resend | 3k emails | |
| PostHog | Analytics | 1M events |
| Axiom | Logging | 500MB/mo |
1. Create .env.local files:
cp apps/app/.env.example apps/app/.env.local
cp apps/api/.env.example apps/api/.env.local
cp packages/database/.env.example packages/database/.env2. Add your API keys (get them from the services above):
apps/app/.env.local:
# API
NEXT_PUBLIC_API_URL=http://localhost:3002
# PostHog
NEXT_PUBLIC_POSTHOG_KEY=phc_...
NEXT_PUBLIC_POSTHOG_HOST=https://app.posthog.com
# Stripe
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=pk_test_...apps/api/.env.local:
# Database
DATABASE_URL=postgresql://...
# JWT Authentication
AUTH_JWT_SECRET=your-jwt-secret-key-here
# Stripe
STRIPE_SECRET_KEY=sk_test_...
STRIPE_WEBHOOK_SECRET=whsec_...
# Email (Resend)
RESEND_API_KEY=re_...
FROM_EMAIL=onboarding@resend.dev
# Axiom
AXIOM_TOKEN=xaat-...
AXIOM_DATASET=orionpackages/database/.env:
DATABASE_URL=postgresql://...| App | Port | Description |
|---|---|---|
web |
3000 | Marketing landing page |
app |
3001 | Dashboard application |
api |
3002 | API backend |
docs |
3004 | Documentation |
| Package | Description |
|---|---|
@workspace/auth |
JWT authentication + user management |
@workspace/database |
Drizzle ORM + Neon + Zod schemas |
@workspace/email |
Resend + React Email templates |
@workspace/types |
Shared TypeScript types |
@workspace/ui |
shadcn/ui + Radix UI components |
@workspace/payment |
Stripe payments + subscriptions |
@workspace/analytics |
PostHog tracking + Vercel Analytics |
@workspace/observability |
Axiom logging + Web Vitals |
@workspace/jobs |
Trigger.dev background jobs |
Typeโsafe monorepo with endโtoโend types. Database schema generates Zod schemas which flow through shared types to API and frontend.
- Flow: Database โ Zod Validation โ Types โ API Routes โ TanStack Query hooks
- Single source of truth: Zod/Drizzle schemas validate on server and provide types on client
- Flexibility: Swap API framework/ORM/UI without breaking contracts
- Benefit: Change schema โ get compileโtime errors across the stack
pnpm dev # Start all apps
pnpm db:push # Push database schema
pnpm db:studio # Open database GUI
pnpm test # Run tests
pnpm build # Build for productionFor more inโdepth documentation and explanations, please see the official documentation site: https://orion-kit-docs.vercel.app/
- Getting Started: https://orion-kit-docs.vercel.app/getting-started/
- Architecture: https://orion-kit-docs.vercel.app/architecture/overview/
MIT
Built with โค๏ธ for developers