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.

GitHubView on GitHub
TypeScript
React
React
React Router
Tailwind CSS
DaisyUI
DaisyUI
BetterAuth
Better Auth
Polar
Prisma
Prisma
Postgres
PostgreSQL
GitHub
GitHub
Railway
MCP
Model Context Protocol

Perfect 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.

Iridium Dashboard Preview

BetterAuth: Flexible Authentication Out of the Box

BetterAuth Google and GitHub authentication

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

AI tool calling request - user asks about analytics and AI extracts function parameters

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.

AI tool calling response - function executes and returns structured data with visualization

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.

Iridium Admin Panel - feature flags, theme switching, and developer tools

Powered by PostHog: Analytics That Actually Help You Build

PostHog Integration - Real-time analytics, feature flags, and LLM tracking

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

Iridium documentation and instruction files

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.

Deploy on Railway

Railway offers a free tier to get started. One-click deployment provisions your PostgreSQL database and configures environment variables automatically.

Railway

Frequently Asked Questions

What exactly am I getting? What pages are included out of the box?
Iridium is turnkey—clone the repo and you have a working application immediately. Out of the box, you get: this landing page (with working A/B tests), a complete authentication system (sign-in, sign-up, password reset), a user dashboard with AI chat and thread management, a profile editor, and an admin panel with feature flag management and design system preview. Every page is production-ready with real functionality, not placeholder content. The dashboard includes a working AI chat interface with tool calling, message persistence, and conversation threads. The admin panel lets you toggle features, test components, and manage settings. It's a complete application you can immediately customize and build upon—not a bare-bones starter you need to finish.
What makes Iridium different from other React starters?
Iridium is deliberately opinionated. Instead of giving you a minimal setup and saying 'figure it out,' we've made the hard architectural decisions for you: config-based routing over file-based, CVA for component variants, Prisma with a custom output path, model-layer separation, hybrid form validation. You get working examples of AI chat, authentication flows, and analytics integration—not just empty templates. Every pattern is documented in the codebase, so you learn by reading production-quality code.
How long does it take to get started?
The fastest way is Railway's instant deploy—click the button, and you have a working instance with database and authentication in under 5 minutes. No local setup required. Perfect for testing the architecture and seeing everything work immediately. For local development: if you have Node.js and PostgreSQL installed, you can be running locally in under 10 minutes. Clone the repo, copy .env.example to .env, add your database URL and auth secret, run npm install and the database migrations, then npm run dev. The core features (auth, database, routing, components) work immediately. Optional integrations like OpenAI, Resend, and PostHog require API keys but aren't necessary to start building.
Do I need to know all these technologies to use Iridium?
No. If you're comfortable with React and TypeScript, you can start building immediately. The architecture guides you: routes are in routes.ts, database operations go in app/models/, components follow CVA patterns. You'll learn React Router 7, Prisma, and BetterAuth by working with real implementations. The .github/instructions/ folder has 30+ pattern guides that explain every integration with examples and anti-patterns.
Can I customize or remove features I don't need?
Absolutely. The AI chat demo, PostHog analytics, Resend emails, and Polar billing are all optional. Don't need AI? Delete app/routes/api/chat.ts and the related components. Don't need analytics? Remove the PostHog provider. The core foundation—routing, auth, database, validation, components—is designed to be extended or simplified based on your product needs. We deliberately kept the scope lean to make this easier.
Is this production-ready or just a learning project?
Production-ready. The patterns you see—role-based access control, error tracking, feature flags, secure session management—are battle-tested and designed for real applications. We've handled edge cases, security considerations, and performance optimizations so you don't have to discover them the hard way.
What's the learning curve like?
If you know React, the curve is gentle. The steepest part is learning React Router 7's config-based routing and data patterns (no useLoaderData hook, route type imports). But once you've built one feature following the existing patterns, the next one is straightforward. The documentation anticipates common mistakes—like route type import paths—and explains the 'why' behind each architectural choice.
What's included without needing external API keys?
Authentication with email/password, full database access with Prisma, all UI components and variants, form validation, protected routes, role-based access control, and the complete routing and middleware architecture. You can build a full-featured SaaS product before adding a single integration. External services (OpenAI, Resend, PostHog, Polar) are wired up and ready to use with API keys, but they're optional.
When should I use Iridium instead of building from scratch?
Use Iridium when you want to focus on your unique product logic, not infrastructure. If you've built authentication, database migrations, form validation, and deployment pipelines before, you know it's weeks of work that adds zero user value. Iridium handles the undifferentiated heavy lifting with proven patterns so you can ship features on day one. Build from scratch when you have specific architectural requirements that conflict with Iridium's opinionated choices.
How do updates work? Will I get locked into an outdated stack?
You own your fork. Clone or fork the repository and it's yours to customize. You can pull upstream updates or diverge completely—your choice. We're using stable, widely-adopted technologies: React 19, React Router 7, Prisma, PostgreSQL, TypeScript. These aren't experimental. The architectural patterns (model layer, CVA components, config-based routing) remain valid regardless of minor version bumps.
What kind of support and documentation is included?
Every integration has a detailed guide in .github/instructions/ with patterns, examples, and troubleshooting. The codebase includes inline JSDoc comments explaining why decisions were made. Common issues—like route type imports, Prisma client paths, form validation conflicts—are documented with solutions. You get both the code and the accumulated knowledge of how to use it correctly. This isn't a template dump; it's a curated learning resource. For questions and contributions, open an issue on GitHub.

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.

GitHubView on GitHub