Documentation guide for Next.js SaaS setup, installation, and first deployment.
Getting started with Nexora.
Use this guide to install Nexora, configure the required services, run the app locally, test auth and Stripe billing, and deploy your SaaS boilerplate for the first time.
Installation
Set up the SaaS boilerplate locally.
Work through the setup in order. First make the app run locally, then connect external services, then deploy after the production build passes.
Step 1
Install dependencies
Install the Next.js SaaS setup locally, then start the development server to confirm the app boots before editing environment variables.
Command or environment example
npm install
npm run devStep 2
Create environment variables
Add app URL, auth secret, MongoDB, Stripe, email, and analytics keys in your local environment file.
Command or environment example
NEXT_PUBLIC_APP_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret
MONGODB_URI=your-mongodb-uri
STRIPE_SECRET_KEY=sk_test_...Step 3
Connect the database
Configure MongoDB for users, sessions, verification tokens, profile data, and subscription state.
Command or environment example
npm run type-checkStep 4
Configure Stripe
Create Stripe products and prices, add price IDs to the environment, and point webhook events to the API route.
Command or environment example
STRIPE_PRICE_ID_BASIC=price_...
STRIPE_PRICE_ID_PRO=price_...
STRIPE_WEBHOOK_SECRET=whsec_...Step 5
Test auth and billing flows
Create a test user, sign in, visit the dashboard, open checkout, and confirm webhook events update the app state as expected.
Command or environment example
npm run lint
npm run buildStep 6
Prepare first deployment
Deploy the SaaS boilerplate after build passes, production env vars are configured, and Stripe webhook URLs point at your live domain.
Command or environment example
npm run build
npm startFirst deployment
Deploy SaaS boilerplate with the right production checks.
A clean first deployment is mostly environment discipline. Make the app URL, auth callback, database, Stripe, and webhook settings agree before launch.
Set NEXT_PUBLIC_APP_URL and NEXTAUTH_URL to your production domain.
Add production MongoDB, Stripe, email, and analytics environment variables.
Create production Stripe products, prices, and webhook endpoint.
Confirm auth callbacks and billing return URLs use the live domain.
Run type-check, lint, and build before shipping.
Test signup, signin, checkout, billing portal, dashboard, and profile flows after deployment.
Deployment targets
Pick the hosting path that matches your team.
Vercel
Best fit for most Next.js SaaS setup flows. Add environment variables, connect the repo, and deploy from the main branch.
Node hosting
Use a Node-capable host when you want more control over runtime, logs, regions, or background service architecture.
Container deployment
Package the app when your infrastructure standardizes around containers, private networking, or platform teams.
Troubleshooting
Common setup issues and quick fixes.
Auth redirects to the wrong URL
Check NEXT_PUBLIC_APP_URL and NEXTAUTH_URL in both local and production environments.
Stripe checkout opens but webhooks do not update state
Confirm STRIPE_WEBHOOK_SECRET matches the active endpoint and that the live endpoint points to /api/stripe/webhook.
Database calls fail after deployment
Verify MONGODB_URI, database network access, and production environment variable names.
Build passes locally but fails in production
Compare Node versions, required env vars, and package lock state between local and deployment environments.
Setup questions
Answers before your first deploy.
What is the fastest Next.js SaaS setup path?
The fastest path is to install dependencies, configure environment variables, connect MongoDB, configure Stripe, test auth and billing, then deploy after a production build passes.
How do I deploy a SaaS boilerplate?
Deploy the boilerplate after setting production app URLs, database credentials, Stripe keys, webhook URLs, auth secrets, and email settings. Then test signup, checkout, dashboard, profile, and billing portal flows on the live domain.
Where does Nexora save setup time?
Nexora gives you the repeated SaaS foundation: auth, Stripe billing, dashboard routes, profile flows, analytics setup, SEO pages, and deployment-ready project structure.
Start from a setup path that already knows SaaS.
Nexora keeps installation, auth, billing, dashboards, analytics, SEO pages, and deployment structure aligned so your first deploy can focus on the product.