OpenSaas Stack
⚠️ Work in Progress - Alpha Stage
This project is currently in active development and is in an alpha state. APIs may change in patches, and some features are still being implemented. Use in production at your own risk.
A modern stack for building admin-heavy applications with Next.js App Router, designed to be AI-agent-friendly with built-in security guardrails.
Features
- 🔒 Access Control First: Database operations automatically enforce access control patterns
- 🤖 AI-Safe Architecture: Built to be easy for AI coding agents to work with safely
- ⚡ Modern Next.js Integration: Works seamlessly with App Router and Server Components
- 🎯 Type-Safe: Full TypeScript support with generated types from schema
- 🔄 Prisma-Powered: Built on Prisma for reliable database operations
- 🧩 Fully Extensible: Custom field types without modifying core code
- 🎨 Fully Composable UI: Use primitives, fields, standalone components, or complete admin UI
- ♿ Accessible: Built with Radix UI and shadcn/ui for production-ready components
- 🔐 Authentication Ready: Optional Better-auth integration with OAuth support
- 🤖 AI Assistant Integration: MCP server for seamless AI assistant access
- 📁 File Storage: Abstract storage interface with S3 and Vercel Blob adapters
- 📝 Rich Text Editing: Tiptap integration for advanced content editing
- 🔍 Semantic Search: RAG integration with vector embeddings for AI-powered search
Project Structure
This is a monorepo containing:
Packages
packages/core: The core OpenSaas stack (config, fields, access control, generators)
packages/cli: CLI tools for code generation and development
packages/ui: Composable React UI components (primitives, fields, standalone components, full admin UI)
packages/auth: Better-auth integration for authentication and sessions
packages/mcp: Model Context Protocol server for AI assistant integration
packages/tiptap: Rich text editor integration (third-party field example)
packages/storage: Abstract storage interface for file uploads
packages/storage-s3: S3-compatible storage adapter (AWS S3, R2, MinIO, etc.)
packages/storage-vercel: Vercel Blob storage adapter
packages/rag: RAG (Retrieval-Augmented Generation) integration with vector embeddings and semantic search
Examples
examples/blog: Basic blog example demonstrating the stack
examples/custom-field: Custom field types demonstration
examples/composable-dashboard: Composable UI components examples
examples/auth-demo: Authentication integration with Better-auth
examples/mcp-demo: MCP server integration for AI assistants
examples/tiptap-demo: Tiptap rich text editor integration
examples/json-demo: JSON field type demonstration
examples/file-upload-demo: File upload and image handling with storage adapters
examples/rag-demo: RAG integration with semantic search and embeddings
Quick Start
New Project (Recommended)
Get started with a new project in 5 minutes:
# Create a new project
npm create opensaas-app@latest my-app
cd my-app
# Install dependencies
pnpm install
# Generate Prisma schema and types
pnpm generate
# Create database
pnpm db:push
# Start dev server
pnpm dev
With authentication:
npm create opensaas-app@latest my-app --with-auth
Your app is now running at http://localhost:3000!
Visit /admin to see your auto-generated admin UI.
Deploy to Production
Ready to deploy? Follow our Deployment Guide to deploy to Vercel + Neon in ~15 minutes.
Monorepo Development
Working on the OpenSaas Stack itself? Here's how to get started:
1. Install Dependencies
pnpm install
2. Build All Packages
# Build all packages in the monorepo
pnpm build
3. Try an Example
Choose one of the examples to get started:
Blog Example (Basic)
cd examples/blog
# Copy environment file
cp .env.example .env
# Generate Prisma schema and types from config
pnpm generate
# Push schema to database (creates SQLite file)
pnpm db:push
# Start development server
pnpm dev
Auth Demo (with Better-auth)
cd examples/auth-demo
# Copy environment file
cp .env.example .env
# Generate and setup database
pnpm generate
pnpm db:push
# Start development server
pnpm dev
File Upload Demo (with storage adapters)
cd examples/file-upload-demo
# Copy environment file and configure storage
cp .env.example .env
# Generate and setup database
pnpm generate
pnpm db:push
# Start development server
pnpm dev
RAG Demo (with semantic search)
cd examples/rag-demo
# Copy environment file and add OpenAI API key
cp .env.example .env