Installation and environment setup for the current repository.
Use this guide when you need the full environment blueprint, service integration checklist, and database bootstrap flow for a clean local or staging installation.
Before you begin
Prerequisites
Node.js
Use a recent Node.js runtime compatible with Next.js 16.
PostgreSQL
A local or managed PostgreSQL database reachable from your app.
Email provider
Resend is preferred. SMTP is supported as the fallback path.
External services
OAuth, Stripe, and OpenRouter can be added after the first local boot.
Install the project
git clone <your-repository-url> saaskit
cd saaskit
npm install
cp .env.example .envPowerShell
Copy-Item .env.example .env instead of cp when needed.Environment blueprint
The block below reflects the variables currently referenced by the app, the docs, and the deployment flow.
123456789101112131415161718192021222324252627282930313233343536373839404142434445# Core applicationDATABASE_URL="postgresql://user:password@localhost:5432/saaskit?schema=public"NEXTAUTH_URL="http://localhost:3000"NEXTAUTH_SECRET="replace-with-a-strong-secret"NEXT_PUBLIC_APP_URL="http://localhost:3000"APP_NAME="AI SaaS"# OAuthGOOGLE_CLIENT_ID="..."GOOGLE_CLIENT_SECRET="..."GITHUB_ID="..."GITHUB_SECRET="..."# StripeSTRIPE_SECRET_KEY="sk_test_..."STRIPE_WEBHOOK_SECRET="whsec_..."NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY="pk_test_..."STRIPE_PRO_MONTHLY_PRICE_ID="price_..."STRIPE_PRO_YEARLY_PRICE_ID="price_..."STRIPE_BUSINESS_MONTHLY_PRICE_ID="price_..."STRIPE_BUSINESS_YEARLY_PRICE_ID="price_..."# OpenRouterOPENROUTER_API_KEY="sk-or-v1-..."OPENROUTER_BASE_URL="https://openrouter.ai/api/v1"# Email: preferred production pathRESEND_API_KEY="re_..."# Email: SMTP fallbackSMTP_HOST="smtp.gmail.com"SMTP_PORT="587"SMTP_SECURE="false"SMTP_USER="you@example.com"SMTP_PASS="app-password"SMTP_FROM="AI SaaS <you@example.com>"ADMIN_EMAIL="ops@example.com"# Optional monitoringSENTRY_DSN=""SENTRY_ORG=""SENTRY_PROJECT=""# Optional CI helperPRISMA_ENGINES_CHECKSUM_IGNORE_MISSING="1"Secrets
.env to version control. Keep secrets in local env files, CI secret stores, or your hosting platform's environment manager.Bootstrap the app
Generate the Prisma client
npm run prisma:generatePush the schema to PostgreSQL
Use the current bootstrap flow for this repository.
npm run db:pushSeed starter data
The seed creates roles, permissions, plans, categories, and tags.
npm run db:seedRun the development server
npm run devPrisma note
db:push. If you later introduce migrations, production deploys should switch to prisma migrate deploy.Configure the product services
Authentication
Set up Google and GitHub OAuth, session behavior, credentials sign-in, and RBAC.
Billing
Create Stripe products, wire price IDs, and configure the webhook endpoint.
AI Integration
Add your OpenRouter key, choose models, and validate credits and request flow.
Deployment
Take the local install to Vercel, Railway, or your own Node host.
Build verification
npm run build
npm run startInstallation checklist
The app loads at localhost:3000 and the docs shell renders correctly.
The database connection works and seed data is visible in Prisma Studio.
Auth pages load without missing-secret or callback errors.
Email delivery is configured for verification and notifications.
Stripe and OpenRouter credentials are ready for the next integration pass.
Next step
Once installation is complete, move into deployment to align production domains, Stripe webhooks, and the database bootstrap sequence with your hosting platform.