This is an experimental variant of this alert message. PostHog feature flags let us test different UI variations with real users to find what works best!
Welcome to Iridium
Your shortcut to a production-ready SaaS. Iridium is an open source boilerplate packed with everything you need: secure authentication, optional billing integration, a powerful AI toolkit, and a stunning component library. Stop rebuilding boilerplate and start shipping features your users will love.
View on GitHubPerfect For
AI-Powered Products
Writing assistants, code generators, chat interfaces, and content analysis tools. Streaming responses, tool calling, and automatic cost tracking included.
Membership Platforms
Online courses, premium communities, gated content, and subscription sites. Role-based access control and user management built-in.
Internal Tools & Dashboards
Admin panels, workflow automation, team dashboards, and business intelligence tools. Feature flags for gradual rollouts.
Developer Tools
API platforms, integration services, and developer portals. Type-safe patterns, middleware architecture, and comprehensive error handling.
See It In Action
Production-Ready Dashboard
Iridium includes a fully functional dashboard with real metrics, thread management, and a working AI chat interface. Every button click, every message sent, every thread created triggers PostHog events. See exactly how to instrument your features by reading production code that actually works.
AI Chat with Tool Calling
Built with Vercel AI SDK and OpenAI, the chat interface demonstrates streaming responses, multi-turn conversations, and tool calling patterns. Messages persist to your database, threads organize conversations, and the @posthog/ai wrapper tracks token usage and costs automatically. Copy the implementation, adapt it to your product, and ship AI features in hours instead of weeks.
End-to-End Type Safety
From database schema to API response to UI component, every piece is type-safe. Prisma generates types from your schema, Zod validates runtime data, React Router 7 types your routes, and CVA ensures type-safe component variants. Catch errors at build time, not in production. Refactor with confidence knowing TypeScript has your back across the entire stack.

BetterAuth: Flexible Authentication Out of the Box

Google & GitHub Auth Pre-Configured
Iridium ships with Google and GitHub OAuth fully integrated and ready to use. No configuration guesswork—just add your OAuth credentials to your environment variables and users can sign in with their existing accounts. Email/password authentication is also included with secure session management and role-based access control built-in.
35+ Social Providers Supported
BetterAuth supports 35+ OAuth providers including Apple, Discord, Facebook, LinkedIn, Microsoft, Spotify, Twitch, and more. Adding a new provider is straightforward—install the plugin, add credentials, and update your auth configuration. The patterns are already established in the codebase, so extending to other providers takes minutes, not hours.
Session Management & Security
7-day secure sessions with HTTP-only cookies, CSRF protection, and automatic session refresh. BetterAuth handles the security complexity while giving you full control over user data and authentication flows. All session helpers (requireUser, requireAnonymous) are implemented and documented in the middleware patterns.
AI That Actually Works: Tool Calling Included

Function Calling Made Simple
The AI doesn't just chat—it executes real functions. Define tools with Zod schemas, and the Vercel AI SDK automatically extracts parameters from natural language, validates them, and executes your functions. See the screenshots: a user asks a question, the AI determines which tool to call, extracts the parameters, and returns structured, type-safe results.

Built-In Examples You Can Copy
Iridium includes working tool definitions for user analytics, data fetching, and content generation. Each tool is tracked by PostHog for cost and performance monitoring. Copy the pattern, adapt it to your domain, and ship AI features with confidence.
Developer-Friendly Admin Panel
Feature Flag Management
Toggle features on and off without deployments. The admin panel integrates with PostHog for real-time feature flag control, A/B testing, and gradual rollouts. Test new features with a subset of users, roll back instantly if needed, and iterate faster with confidence.
Built-In Developer Tools
Quick access to theme switching, form demos, and component galleries. The admin panel serves as a central hub for developers to test UI variations, preview components, and manage application settings without touching code. Links to external services like Polar.sh keep everything in one place.
Design System Playground
Test every component variant in isolation with the built-in design system preview. See all button styles, form states, and UI patterns at once. Perfect for validating design decisions, testing accessibility, and ensuring consistency across your application without hunting through routes.

Powered by PostHog: Analytics That Actually Help You Build

Event Tracking Built Into Your Code
Every meaningful action—sign-ups, thread creation, message sends, tool calls—automatically tracked. No guessing about user behavior. PostHog events are instrumented throughout the codebase, so you can see patterns like which features drive retention and where users get stuck.
Feature Flags for Confident Releases
Toggle features on and off without deploying. Run A/B tests to validate product decisions before committing. This landing page uses feature flags right now—different hero images and copy variants served to different users, measured in real-time.
LLM Analytics: Track AI Costs Automatically
The @posthog/ai wrapper captures every AI interaction: model used, tokens consumed, estimated cost, latency. See which prompts work, which tools get called, and how much your AI features actually cost—without manual logging.
Session Replay & Error Tracking
Watch user sessions to understand confusion and bugs. Automatic exception capture with stack traces means you know about issues before users report them. Debug with context instead of guessing from error messages.
Core Features
Authentication & Security
BetterAuth with email/password and social login. Session management, role-based access control, and protected route patterns. PostgreSQL with Prisma for robust data management.
AI-Powered
OpenAI integration with streaming chat using Vercel AI SDK. Message persistence, tool calling, and automatic LLM analytics tracking (tokens, costs, latency) via PostHog.
Forms & Validation
Hybrid client/server validation with Zod and React Hook Form. Type-safe schemas, instant feedback, and comprehensive error handling.
UI Components
DaisyUI 5 with CVA-powered variants for type-safe styling. Dark mode, responsive design, and accessible components throughout.
Analytics & Testing
PostHog integration for user analytics, session replay, A/B testing, and feature flags. Automatic event tracking and exception capture. The page you're reading uses feature flags right now.
Email & Notifications
Resend integration with React Email templates. Pre-built flows for welcome emails, password resets, and account notifications.
30+ Pattern Guides: Learn By Reading Production Code

Comprehensive Pattern Library
Over 30 instruction files in .github/instructions/ document every pattern: CVA component variants, form validation, CRUD operations, authentication flows, error boundaries, feature flags, and more. Each guide includes working examples, anti-patterns to avoid, and TypeScript best practices. You're not just getting code—you're getting the accumulated knowledge of how to use it correctly.
Complete Technical Documentation
The docs/ folder contains deep-dives on every integration: AI implementation with tool calling, authentication patterns, deployment guides, testing strategies, and architectural decisions. Each document explains the 'why' behind technical choices and provides step-by-step implementation guides. Learn by reading production-quality documentation that anticipates your questions.
Decision Records & Context
The docs/decisions/ folder documents why we chose React Router 7 over file-based routing, BetterAuth over Clerk, Prisma's custom output path, and CVA for component variants. Understanding the reasoning behind architectural decisions helps you make informed choices when extending or modifying the codebase. It's the context most starters never provide.
Optional Billing with Polar
Polar billing integration is pre-wired but completely optional. Add your credentials when you're ready to monetize, or remove it if you don't need billing.
Polar acts as a Merchant of Record, handling tax compliance, VAT, and payment processing for you.
Deploy with Railway
Deploy a working instance instantly with automatic database provisioning and environment setup. Perfect for testing the architecture and seeing Iridium in action.
Railway offers a free tier to get started. One-click deployment provisions your PostgreSQL database and configures environment variables automatically.

Frequently Asked Questions
Ready to Ship Faster?
Stop rebuilding the same infrastructure. Clone the repo, follow the setup guide, and start building your product in minutes. Open source and free forever.
View on GitHub