Installation Guide
Complete setup guide for all features including database, authentication, payments, and email services.
1. Unpack & Install Dependencies
Every customer receives StartupKit as a downloadable .zip file ready to import into your own Git host (or keep private). Unzip it, enter the folder, then install dependencies:
unzip startupkit.zip cd startupkit npm install2. MongoDB Setup
You’ll need a MongoDB database. We recommend MongoDB Atlas for production:
- Go to MongoDB Atlas
- Create a free account and a new cluster
- Click “Connect” and choose “Connect your application”
- Copy the connection string
- Replace
<password>with your database user password
Your connection string should look like:
mongodb+srv://username:password@cluster.mongodb.net/dbname?retryWrites=true&w=majority3. Environment Variables
Copy the example environment file:
cp .env.example .envRequired Variables
# Database
DATABASE_URL="your-mongodb-connection-string"
# NextAuth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="generate-with-openssl-rand-base64-32"Generate NEXTAUTH_SECRET
openssl rand -base64 324. Google OAuth Setup (Optional)
To enable Google authentication:
- Go to Google Cloud Console
- Create a new project or select an existing one
- Navigate to “APIs & Services” → “Credentials”
- Click “Create Credentials” → “OAuth client ID”
- Select “Web application”
- Add authorized redirect URI:
http://localhost:3000/api/auth/callback/google - Copy the Client ID and Client Secret
Add to your .env:
GOOGLE_CLIENT_ID="your-client-id"
GOOGLE_CLIENT_SECRET="your-client-secret"5. Stripe Setup
For subscription billing and payments:
Create Stripe Account
- Sign up at Stripe
- Go to Developers → API keys
- Copy your Publishable key and Secret key
Create Products and Prices
- Go to Products in Stripe Dashboard
- Create a product for each plan (Starter, Foundation, Accelerate)
- Add a recurring price to each product
- Copy the Price ID for each plan
Add to your .env:
STRIPE_SECRET_KEY="sk_test_..."
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_WEBHOOK_SECRET="whsec_..." # We'll get this in step 6
# Price IDs from your Stripe products
STRIPE_STARTER_PRICE_ID="price_..."
STRIPE_FOUNDATION_PRICE_ID="price_..."
STRIPE_ACCELERATE_PRICE_ID="price_..."Update Stripe Configuration
Edit src/lib/stripe.ts and update the plan details to match your Stripe products:
export const STRIPE_PLANS = {
STARTER: {
id: "starter",
name: "Starter",
price: 29, // Your price in dollars
priceId: process.env.STRIPE_STARTER_PRICE_ID!,
// ... update features
},
// ... update other plans
};6. Stripe Webhooks
Webhooks are required for subscription updates:
Local Development (Stripe CLI)
- Install Stripe CLI
- Login:
stripe login - Forward webhooks:
stripe listen --forward-to localhost:3000/api/stripe/webhook - Copy the webhook signing secret shown (starts with
whsec_) - Add it to your
.envasSTRIPE_WEBHOOK_SECRET
Production Webhooks
- Go to Developers → Webhooks in Stripe Dashboard
- Click “Add endpoint”
- Enter your endpoint:
https://yourdomain.com/api/stripe/webhook - Select these events:
checkout.session.completedcustomer.subscription.createdcustomer.subscription.updatedcustomer.subscription.deleted
- Copy the webhook signing secret to your production environment
7. Resend Email Setup
For transactional emails:
- Sign up at Resend
- Go to API Keys and create a new key
- Add your domain in Settings → Domains (or use
onboarding@resend.devfor testing) - Follow the DNS verification steps
Add to your .env:
RESEND_API_KEY="re_..."
EMAIL_FROM="noreply@yourdomain.com"
ADMIN_EMAIL="admin@yourdomain.com"⚠️ Email Deliverability
For testing, you can use onboarding@resend.dev as your EMAIL_FROM. For production, you must verify your domain to ensure email delivery.
8. Database Schema Setup
Initialize your database with Prisma:
npx prisma generate npx prisma db pushThis will create all required tables and generate the Prisma client.
9. Run the Application
Start the development server:
npm run devOpen http://localhost:3000 in your browser.
10. Test the Setup
Authentication:
- Create an account at
/register - Check your terminal for the verification email link
- Verify your email and log in
Subscriptions:
- Navigate to Billing in the dashboard
- Select a plan and use Stripe test card:
4242 4242 4242 4242 - Use any future expiry date and any CVC
- Verify subscription appears in your Stripe Dashboard
✅ Setup Complete!
Your SaaS application is now fully configured with authentication, billing, and email services.
Troubleshooting
Database connection errors
Verify your MongoDB connection string and ensure your IP is whitelisted in MongoDB Atlas.
OAuth not working
Check that your redirect URIs match exactly in Google Cloud Console. For production, update them to your domain.
Stripe webhooks failing
Ensure Stripe CLI is running for local development. Check webhook signing secret matches your .env file.
Emails not sending
Verify your Resend API key is correct. Use onboarding@resend.dev for testing, or ensure your domain is verified for production.
Next Steps
- Environment Variables Reference - Complete list of all variables
- Authentication Guide - Deep dive into auth system
- Billing Guide - Managing subscriptions
- Deployment Guide - Deploy to production