Welcome to the SaasLaunchpad! This project is designed to help you quickly build a SaaS application using Next.js. It includes features such as authentication, Stripe payment integration, and a user dashboard.
Note: This is an expanded version of the Next.js SaaS Starter, offering a richer feature set beyond the original template.
Live Demo: https://saaslaunchpad.vercel.app/
- 🏠 Animated marketing landing page (
/
) - 💳 Pricing page (
/pricing
) integrated with Stripe Checkout - 🛠️ User and team management dashboard with CRUD operations
- 🔒 Role-based access control (RBAC) with Owner and Member roles
- 💼 Stripe Customer Portal for subscription management
- 🔑 Social authentication using NextAuth.js
- 🛡️ Middleware for route protection and schema validation
- 📊 User activity logging
- ✉️ Email templates using Nodemailer
- 🔔 Push notifications via Firebase and OneSignal
- Framework: Next.js
- Database: PostgreSQL
- ORM: Drizzle
- Payments: Stripe
- UI Components: shadcn/ui
- Authentication: NextAuth.js
- Email Service: Nodemailer
- Push Notifications: Firebase, OneSignal
Clone the repository and install dependencies:
git clone https://github.com/Excelorithm/SaaSLaunchpad
cd SaaSLaunchpad
pnpm install
Set up your environment variables by running the setup script:
pnpm app:setup
Run database migrations and seed the database with initial data:
pnpm db:migrate
pnpm db:seed
Setup Firebase Push Notifications
pnpm push:setup
Start the development server:
pnpm dev
Visit http://localhost:3000 to view the application.
To handle Stripe webhooks locally, use the Stripe CLI:
stripe listen --forward-to localhost:3000/api/stripe/webhook
Use the following test card details for Stripe payments:
- Card Number:
4242 4242 4242 4242
- Expiration Date: Any future date
- CVC: Any 3-digit number
- Create a new webhook in the Stripe Dashboard for your production environment.
- Set the endpoint URL to your production API route (e.g.,
https://yourdomain.com/api/stripe/webhook
). - Select the events you want to listen for (e.g.,
checkout.session.completed
,customer.subscription.updated
).
- Push your code to a GitHub repository.
- Connect your repository to Vercel and deploy it.
- Follow the Vercel deployment steps to set up your project.
In your Vercel project settings, add the necessary environment variables for production:
APP_NAME
: Your app name.APP_LOGO
: Your app logo.BASE_URL
: Your production domain.POSTGRES_URL
: Your production database URL.STRIPE_SECRET_KEY
: Your Stripe secret key for production.STRIPE_WEBHOOK_SECRET
: The webhook secret from your production Stripe webhook.NEXTAUTH_URL
: Same as "BASE_URL".NEXTAUTH_SECRET
: A random string for authentication. Generate one usingopenssl rand -base64 32
.NEXT_PUBLIC_LOGIN_URL
: Login page URL, typically "BASE_URL/auth/signin".GOOGLE_CLIENT_ID
: Client ID for Google OAuth.GOOGLE_CLIENT_SECRET
: Client secret for Google OAuth.EMAIL_SERVER_USER
: Username for your email server.EMAIL_SERVER_PASSWORD
: Password for your email server.EMAIL_SERVER_HOST
: Host address for your email server.EMAIL_SERVER_PORT
: Port number for your email server.EMAIL_FROM
: The email address that your app will use to send emails.NEXT_PUBLIC_PUSH_NOTIFICATIONS_CHANNEL
: Channel name for push notifications.NEXT_PUBLIC_FIREBASE_API_KEY
: Firebase API key.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN
: Firebase Auth domain.NEXT_PUBLIC_FIREBASE_PROJECT_ID
: Firebase project ID.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET
: Firebase storage bucket.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID
: Firebase messaging sender ID.NEXT_PUBLIC_FIREBASE_APP_ID
: Firebase app ID.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID
: Firebase measurement ID.NEXT_PUBLIC_FIREBASE_VAPID
: Firebase VAPID key for push notifications.FIREBASE_ADMIN_PROJECT_ID
: Firebase Admin project ID.FIREBASE_ADMIN_PRIVATE_KEY
: Firebase Admin private key.FIREBASE_ADMIN_CLIENT_EMAIL
: Firebase Admin client email.NEXT_PUBLIC_ONESIGNAL_APP_ID
: OneSignal app ID for push notifications.ONESIGNAL_REST_API_KEY
: OneSignal REST API key for server-side push notifications.