saas-factory-create-app
v0.1.0
Published
Interactive CLI for creating SaaS Factory projects
Maintainers
Readme
@saas-factory/create-app
Interactive CLI tool for scaffolding new SaaS Factory projects. Choose your design system, authentication setup, database, and templates to get a fully configured Next.js application in seconds.
Features
✅ Interactive Prompts (guided project setup)
✅ 6 Design Systems (choose your aesthetic)
✅ Auth Options (sessions + OAuth)
✅ Database Selection (Prisma, MongoDB, Supabase)
✅ Pre-built Templates (dashboard, marketing, full-stack)
✅ Git Integration (automatic repo initialization)
✅ Type-Safe (TypeScript pre-configured)
✅ Environment Setup (.env.local generation)
✅ Dependency Installation (automatic pnpm/npm)
✅ Example Components (ready to modify)
Installation
npm create saas-factory@latest my-app
# or
npx @saas-factory/create-app@latest my-appUsage
npm create saas-factory@latestInteractive Setup Flow
Welcome to SaaS Factory! 🚀
? What is your project name?
> my-awesome-app
? Choose your design system:
❯ Modern Minimal
Dark Professional
Colorful Playful
Enterprise Formal
Mobile-First
Retro/Neomorphic
? Include authentication?
❯ Yes
No
? Authentication methods:
❯ Session-based (default)
✓ OAuth (Google, GitHub)
Toggle: Press SPACE to toggle
? Choose your database:
❯ Prisma + PostgreSQL
MongoDB + Mongoose
Supabase
Skip for now
? Choose template:
❯ SaaS Dashboard (recommended)
Marketing Site + App
Minimal App (just auth + theme)
? Initialize git repository?
❯ Yes
No
? Install dependencies now?
❯ Yes (pnpm)
Yes (npm)
No, I'll do it later
✓ Project created! 🎉Command-Line Options
# Specify project name
npm create saas-factory@latest my-app
# Skip interactive prompts
npm create saas-factory@latest my-app --template minimal-dark --no-auth
# Use TypeScript (default)
npm create saas-factory@latest my-app --typescript
# Use JavaScript
npm create saas-factory@latest my-app --javascript
# Include all packages
npm create saas-factory@latest my-app --all
# Verbose output
npm create saas-factory@latest my-app --verbose
# Dry run (don't create files)
npm create saas-factory@latest my-app --dry-run
# Override existing directory
npm create saas-factory@latest my-app --forceGenerated Project Structure
my-app/
├── app/
│ ├── api/
│ │ └── auth/
│ │ └── [...auth]/route.ts
│ ├── (dashboard)/
│ │ ├── page.tsx
│ │ └── layout.tsx
│ ├── layout.tsx
│ └── page.tsx
│
├── components/
│ ├── auth/
│ │ ├── SignInForm.tsx
│ │ └── SignUpForm.tsx
│ ├── dashboard/
│ │ ├── Navbar.tsx
│ │ ├── Sidebar.tsx
│ │ └── Stats.tsx
│ └── ui/
│ └── Button.tsx
│
├── lib/
│ ├── auth.ts
│ ├── db.ts
│ └── utils.ts
│
├── prisma/
│ └── schema.prisma (if Prisma selected)
│
├── public/
│ └── assets/
│
├── styles/
│ ├── globals.css
│ └── variables.css
│
├── .env.local
├── .env.example
├── .gitignore
├── next.config.js
├── package.json
├── tailwind.config.ts
├── tsconfig.json
└── README.mdIncluded Packages
All created projects include:
- @saas-factory/auth (authentication)
- Selected UI system (design system)
- @saas-factory/animations (optional, can be excluded)
- TailwindCSS (styling)
- TypeScript (type safety)
- Next.js 14 (framework)
Environment Variables
Automatically generates .env.local with:
# Database
DATABASE_URL=your-database-url
# Authentication
AUTH_SECRET=random-generated-secret
SESSION_SECRET=random-generated-secret
# OAuth (if selected)
GOOGLE_CLIENT_ID=your-client-id
GOOGLE_CLIENT_SECRET=your-client-secret
GITHUB_CLIENT_ID=your-client-id
GITHUB_CLIENT_SECRET=your-client-secret
# App
NEXT_PUBLIC_APP_URL=http://localhost:3000
NODE_ENV=developmentNext Steps After Creation
- Update
.env.localwith your credentials (OAuth, database, etc.) - Review generated code in
app/andcomponents/ - Run migrations (if Prisma):
npx prisma migrate dev - Start development server:
npm run dev - Customize components to match your needs
- Deploy to Vercel, Netlify, or your platform
Customization After Creation
All packages are fully customizable:
# Update UI system
npm install @saas-factory/ui-dark
# Add another design system for reference
npm install @saas-factory/ui-playful
# Update auth package
npm install @saas-factory/auth@latestPre-built Templates
1. SaaS Dashboard (Recommended)
Complete admin dashboard with:
- User authentication
- Dashboard overview
- User management
- Settings pages
- Navigation (navbar + sidebar)
- Responsive design
2. Marketing Site + App
Combination template with:
- Landing page
- Pricing page
- Features showcase
- Sign up flow
- Authenticated app dashboard
- Email integration ready
3. Minimal App
Bare-bones setup with:
- Auth flows only
- Selected design system
- Basic layout
- Ready to build on
Database Options
Prisma + PostgreSQL
# Schema already configured
npx prisma migrate dev --name initMongoDB
# Use included Mongoose connection
# Update MONGODB_URI in .env.local
npm run devSupabase
# Uses Supabase Auth + Database
# Configure SUPABASE_URL and SUPABASE_ANON_KEY
npm run devDevelopment Commands
# Start dev server
npm run dev
# Build for production
npm run build
# Run production server
npm start
# Run linting
npm run lint
# Run tests
npm test
# Format code
npm run formatTroubleshooting
Installation fails?
- Ensure Node.js 18+ is installed
- Try
npm create saas-factory@latest --force - Clear npm cache:
npm cache clean --force
Dependencies not installing?
- Use
pnpm(faster, recommended) - Check your internet connection
- Try deleting
node_modulesand reinstalling
Authentication not working?
- Verify OAuth credentials are correct
- Check
.env.localis configured - Review auth setup in
app/api/auth/[...auth]/route.ts
Database connection issues?
- Verify
DATABASE_URLis correct - Check database server is running
- Run
npx prisma db pushfor Prisma
Examples
See the examples folder for more detailed project examples.
Contributing
Found a bug or want a feature? See CONTRIBUTING.md.
License
MIT
