Package Exports
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (saas-forge) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
π₯ SaaS Forge
The Ultimate Production-Ready SaaS Boilerplate
Features β’ Quick Start β’ Documentation β’ Tech Stack β’ Contributing
π Overview
SaaS Forge is a production-ready, full-stack SaaS boilerplate built with modern technologies. Launch your SaaS product in days, not months. Built with scalability, performance, and developer experience in mind.
Why SaaS Forge?
- β‘ Lightning Fast Setup - Get up and running in minutes with automated CLI
- ποΈ Production Ready - Battle-tested architecture used in real products
- π¨ Beautiful UI - Pre-built components with shadcn/ui and Tailwind CSS
- π Enterprise Auth - Complete authentication with social logins and email verification
- π³ Payment Integration - Built-in payment handling with webhooks
- π± Responsive Design - Mobile-first approach with modern aesthetics
- π Optimized Performance - Redis caching, React Query, and Next.js 15 optimizations
- π§ͺ Type Safe - End-to-end type safety with TypeScript and tRPC
- π¦ Monorepo Architecture - Organized with Turborepo for scalability
- π― Developer Experience - Hot reload, ESLint, Prettier, and comprehensive tooling
β¨ Features
π Authentication & Authorization
π° Payments & Billing
|
π¨ UI/UX Components
π οΈ Developer Tools
|
π Content Management
- Notion CMS Integration - Manage content directly from Notion
- Dynamic landing pages
- Documentation system
- Legal pages (Terms, Privacy, Refund Policy)
- Newsletter & support forms
- n8n webhook automation
π Observability & Monitoring
- Centralized logging with Winston
- Logtail integration for log aggregation
- Request/response logging for Notion API
- Performance monitoring hooks
π Quick Start
Using CLI (Recommended)
npx saas-forge my-saas-app
cd my-saas-app
pnpm install
pnpm devManual Installation
# Clone the repository
git clone https://github.com/anoopkarnik/saas-forge.git
cd saas-forge
# Install dependencies
pnpm install
# Copy environment variables
cp apps/web/.env.example apps/web/.env
# Generate Prisma client
pnpm run generate
# Run development server
pnpm devVisit http://localhost:3000 to see your app! π
π Documentation
Environment Configuration
Create a apps/web/.env file with the following variables:
# Database
DATABASE_URL="postgresql://..."
# Redis (Upstash)
UPSTASH_REDIS_REST_URL="https://..."
UPSTASH_REDIS_REST_TOKEN="..."
# Better Auth
BETTER_AUTH_SECRET="..."
BETTER_AUTH_URL="http://localhost:3000"
# OAuth Providers
AUTH_GITHUB_ID="..."
AUTH_GITHUB_SECRET="..."
AUTH_GOOGLE_ID="..."
AUTH_GOOGLE_SECRET="..."
AUTH_LINKEDIN_ID="..."
AUTH_LINKEDIN_SECRET="..."
# Email (Resend)
RESEND_API_KEY="..."
# Notion CMS
NOTION_API_KEY="..."
LANDING_DATABASE_ID="..."
DOCUMENTATION_DATABASE_ID="..."
# Payments (Dodo)
DODO_API_KEY="..."
DODO_WEBHOOK_SECRET="..."
# Observability
BETTERSTACK_TELEMETRY_SOURCE_TOKEN="..."
BETTERSTACK_TELEMETRY_INGESTING_HOST="..."
# Webhooks (n8n)
N8N_SUPPORT_WEBHOOK="..."
N8N_NEWSLETTER_WEBHOOK="..."
N8N_CHATBOT_WEBHOOK="..."See apps/web/.env.example for a complete list.
ποΈ Tech Stack
Frontend
|
Backend
|
Tooling & DevOps
- Monorepo: Turborepo + pnpm workspaces
- Testing: Vitest
- Linting: ESLint 9 + Prettier
- CI/CD: GitHub Actions
- Deployment: Vercel (recommended)
π¦ Project Structure
saas-forge/
βββ apps/
β βββ web/ # Main Next.js application
β βββ app/ # App router pages
β β βββ (auth)/ # Authentication pages
β β βββ (home)/ # Protected home pages
β β βββ landing/ # Public landing pages
β β βββ api/ # API routes
β βββ blocks/ # Page-level components
β βββ components/ # Feature components
β βββ lib/ # Utility functions
β βββ server/ # Server-side utilities
β βββ trpc/ # tRPC configuration
β
βββ packages/
β βββ ui/ # Shared UI components
β βββ auth/ # Authentication logic
β βββ database/ # Prisma schema & client
β βββ email/ # Email templates
β βββ cms/ # Notion CMS integration
β βββ observability/ # Logging utilities
β βββ eslint-config/ # Shared ESLint config
β βββ typescript-config/ # Shared TS config
β
βββ scripts/
β βββ cli.js # CLI for project scaffolding
β
βββ templates/
βββ saas-boilerplate/ # Template for new projectsπ― Commands
Development
# Start all workspaces in dev mode
pnpm dev
# Start only web app
pnpm --filter web dev
# Build all workspaces
pnpm build
# Build only web app
pnpm --filter web buildCode Quality
# Lint all workspaces
pnpm lint
# Lint with auto-fix
pnpm --filter web lint:fix
# Format code with Prettier
pnpm format
# Type check
pnpm --filter web typecheckDatabase
# Generate Prisma client
pnpm --filter @workspace/database postgres:generate
# Run migrations
pnpm --filter @workspace/database postgres:migrate
# Reset database (β οΈ destroys data)
pnpm --filter @workspace/database postgres:resetTesting
# Run all tests
pnpm --filter @workspace/cms test
# Run specific test file
pnpm --filter @workspace/cms test -- testing/index.test.tsπ¨ Adding UI Components
SaaS Forge uses shadcn/ui for components. To add a new component:
# Add a component (e.g., button)
pnpm dlx shadcn@latest add button -c apps/web
# Import in your code
import { Button } from "@workspace/ui/components/button"Components are automatically placed in packages/ui/src/components and can be used across all apps.
π§ Customization
Theming
Modify theme colors in apps/web/app/globals.css:
@layer base {
:root {
--primary: 222 47% 11%;
--primary-foreground: 210 40% 98%;
/* ... more variables */
}
}Content Management
All content is managed through Notion databases:
- Landing Page: Configure in Notion database specified by
LANDING_DATABASE_ID - Documentation: Configure in Notion database specified by
DOCUMENTATION_DATABASE_ID - Legal Pages: Managed through the same landing database with filters
Update content in Notion, and it reflects automatically on your site!
Authentication Providers
Add/remove providers in packages/auth/src/better-auth/auth.ts:
socialProviders: {
github: {
clientId: process.env.AUTH_GITHUB_ID!,
clientSecret: process.env.AUTH_GITHUB_SECRET!,
},
// Add more providers...
}π’ Deployment
Vercel (Recommended)
- Push your code to GitHub
- Import project in Vercel
- Add environment variables
- Deploy!
Other Platforms
SaaS Forge works with any platform that supports Next.js:
- Railway: Railway.app
- Fly.io: Fly.io
- AWS Amplify: AWS Amplify
- Digital Ocean: App Platform
π€ Contributing
We love contributions! Please read our Contributing Guide before submitting a Pull Request.
Development Workflow
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes
- Run tests:
pnpm test - Commit changes:
git commit -m 'Add amazing feature' - Push to branch:
git push origin feature/amazing-feature - Open a Pull Request
Code Standards
- Write TypeScript with strict mode
- Follow ESLint rules
- Add tests for new features
- Update documentation
- Keep components small and focused
- Use semantic commit messages
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Acknowledgments
Built with amazing open-source projects:
- Next.js - The React Framework
- shadcn/ui - Beautiful components
- Turborepo - Monorepo tooling
- tRPC - Type-safe APIs
- Prisma - Next-gen ORM
- Better Auth - Authentication solution
- Notion - Content management
π¬ Support & Community
- π§ Email: support@saasforge.dev
- π Issues: GitHub Issues
- π‘ Discussions: GitHub Discussions
- π¦ Twitter: @anoopkarnik
πΊοΈ Roadmap
Current Focus
- β Core authentication flows
- β Payment integration
- β Notion CMS integration
- β Monorepo architecture
Upcoming Features
- π Multi-tenancy support
- π Advanced RBAC (Role-Based Access Control)
- π Team collaboration features
- π API key management
- π Advanced analytics dashboard
- π Email templates library
- π Mobile app support (React Native)
- π GraphQL support
- π i18n (Internationalization)
- π A/B testing framework
See our GitHub Projects for detailed progress.
β Show Your Support
If you find SaaS Forge helpful, please consider:
- β Starring the repository
- π Reporting bugs
- π‘ Suggesting new features
- π Improving documentation
- π Submitting pull requests