create-solostack
v1.3.7
Published
The complete SaaS boilerplate for indie hackers - Next.js 15 with auth, payments, database, and email
Maintainers
Readme
🚀 SoloStack
The complete SaaS boilerplate for indie hackers
Generate a production-ready Next.js 15 SaaS application with authentication, payments, database, and email - all pre-configured and working out of the box.
Built with ❤️ by Danish Akhtar
Documentation • Report Bug • Request Feature
✨ Features
| Feature | Description | |---------|-------------| | 🚀 Quick Setup | Get a full SaaS up and running in minutes, not weeks | | 🔐 Authentication | NextAuth.js with email/password and OAuth (Google, GitHub) | | 💳 Payments | Stripe integration for subscriptions and one-time payments | | 📧 Emails | Resend for transactional emails with React Email templates | | 🗄️ Database | Prisma + PostgreSQL with pre-built models | | 🎨 UI Components | shadcn/ui components with Tailwind CSS | | 📱 Responsive | Mobile-first design out of the box | | 🔒 Type-Safe | Full TypeScript support |
Workflows & Architecture
System Architecture
graph TD
User[User / Browser] -->|HTTPS| CDN[CDN / Edge]
CDN -->|Request| App[Next.js 15 App]
subgraph "Application Layer"
App -->|Auth| Auth[NextAuth.js]
App -->|API| Routes[API Routes]
App -->|Pages| UI[shadcn/ui Components]
end
subgraph "Data Layer"
Routes -->|Query| Prisma[Prisma ORM]
Prisma -->|SQL| DB[(PostgreSQL)]
end
subgraph "External Services"
Auth -->|OAuth| Providers[Google / GitHub]
Routes -->|Payments| Stripe[Stripe API]
Routes -->|Emails| Resend[Resend API]
Stripe -->|Webhooks| Routes
endAuthentication & Payment Flow
sequenceDiagram
participant U as User
participant A as App
participant S as Stripe
participant D as Database
participant E as Resend
U->>A: Sign Up
A->>S: Create Customer
S-->>A: Customer ID
A->>D: Create User (with Stripe ID)
A->>E: Send Verification Email
E-->>U: Email Delivered
U->>A: Upgrade to Pro
A->>S: Create Checkout Session
S-->>U: Redirect to Checkout
U->>S: Complete Payment
S->>A: Webhook (checkout.completed)
A->>D: Update Subscription Status
A-->>U: Access Granted🚀 Installation
Get started in seconds with one command:
npx create-solostack my-saas-appAlternative package managers:
# pnpm
pnpm create solostack my-saas-app
# yarn
yarn create solostack my-saas-app📖 Usage
Run the CLI and follow the interactive prompts:
npx create-solostack my-appThe CLI will guide you through:
- 📝 Project name
- 🔐 Authentication provider (NextAuth.js)
- 🗄️ Database (PostgreSQL + Prisma)
- 💳 Payment provider (Stripe)
- 📧 Email provider (Resend)
- 🎨 Include shadcn/ui components? (Y/n)
- 🔧 Initialize git repository? (Y/n)
What's Included
File Structure
my-saas-app/
├── prisma/
│ ├── schema.prisma # Database schema
│ └── seed.ts # Seed script
├── src/
│ ├── app/
│ │ ├── (auth)/
│ │ │ ├── login/ # Login page
│ │ │ └── signup/ # Signup page
│ │ ├── api/
│ │ │ ├── auth/ # NextAuth routes
│ │ │ ├── stripe/ # Stripe routes
│ │ │ └── webhooks/ # Webhook handlers
│ │ ├── dashboard/ # Protected dashboard
│ │ │ ├── billing/ # Subscription management
│ │ │ └── settings/ # User settings
│ │ ├── globals.css
│ │ ├── layout.tsx
│ │ └── page.tsx
│ ├── components/ # React components
│ └── lib/
│ ├── auth.ts # NextAuth configuration
│ ├── db.ts # Prisma client
│ ├── stripe.ts # Stripe client
│ └── email/ # Email templates
├── .env.example
├── middleware.ts # Route protection
├── next.config.js
├── package.json
├── tailwind.config.ts
└── tsconfig.jsonDatabase Models
- User - User accounts with authentication
- Account - OAuth accounts
- Session - User sessions
- Subscription - Stripe subscriptions
- Payment - Payment history
- VerificationToken - Email verification
API Routes
/api/auth/[...nextauth]- NextAuth.js routes/api/auth/signup- User registration/api/stripe/checkout- Create checkout session/api/stripe/portal- Customer portal/api/webhooks/stripe- Stripe webhooks/api/user/update- Update user profile
Pages
/- Landing page/login- Login page/signup- Signup page/dashboard- User dashboard (protected)/dashboard/billing- Subscription management (protected)/dashboard/settings- User settings (protected)
Getting Started (Generated Project)
After generating your project:
1. Install Dependencies
cd my-saas-app
npm install2. Set Up Environment Variables
cp .env.example .envAdd your environment variables:
DATABASE_URL="postgresql://..."
NEXTAUTH_SECRET="..." # Generate with: openssl rand -base64 32
NEXTAUTH_URL="http://localhost:3000"
STRIPE_SECRET_KEY="sk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
RESEND_API_KEY="re_..."3. Set Up Database
npm run db:push
npm run db:seed4. Run Development Server
npm run devScripts
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run db:push- Push schema to databasenpm run db:seed- Seed databasenpm run db:studio- Open Prisma Studio
Configuration
Stripe Setup
- Create a Stripe account at stripe.com
- Get your API keys from the Dashboard
- Set up products and prices
- Configure webhook endpoint:
https://yourdomain.com/api/webhooks/stripe - Add webhook secret to
.env
Resend Setup
- Create a Resend account at resend.com
- Get your API key
- Verify your sending domain
- Add API key to
.env
Database Setup
- Create a PostgreSQL database
- Add connection string to
.env - Run
npm run db:pushto create tables - Run
npm run db:seedto add sample data
OAuth Providers (Optional)
For Google OAuth:
- Go to Google Cloud Console
- Create OAuth 2.0 credentials
- Add to
.env
For GitHub OAuth:
- Go to GitHub Settings > Developer settings > OAuth Apps
- Create a new OAuth App
- Add to
.env
🛠️ Tech Stack
| Category | Technology | |----------|-----------| | Framework | Next.js 15 (App Router) | | Language | TypeScript | | Styling | Tailwind CSS | | UI Components | shadcn/ui + Radix UI | | Database | PostgreSQL + Prisma | | Authentication | NextAuth.js 5 | | Payments | Stripe | | Email | Resend + React Email | | Form Handling | React Hook Form + Zod |
Requirements
- Node.js 18 or higher
- PostgreSQL database (local or hosted)
📚 Support & Resources
License
MIT © Danish Akhtar
🗺️ Roadmap
✅ Free Version
- ✅ Next.js 15 + TypeScript
- ✅ Authentication (NextAuth.js)
- ✅ Database (Prisma + PostgreSQL)
- ✅ Payments (Stripe)
- ✅ Emails (Resend)
- ✅ UI Components (shadcn/ui)
💎 Pro Version ($99)
- 🔜 Multi-tenancy support
- 🔜 Team/workspace management
- 🔜 Advanced admin dashboard
- 🔜 Analytics integration
- 🔜 Email campaigns
- 🔜 Advanced security features
- 🔜 SEO optimization
- 🔜 PWA support
Built with ❤️ for indie hackers and solo founders
Made by Danish Akhtar • GitHub • Version 1.3.3
