# Open SaaS

A copy of Open SaaS by Wasp: a full-stack React 19 and Node.js app in TypeScript with Prisma and PostgreSQL, packaged to run as one container. It is for developers who want email auth, Stripe payments (with Lemon Squeezy and Polar as alternatives), an admin dashboard, S3 file uploads, an OpenAI demo app and an hourly analytics job in one codebase.

- Framework: Wasp (JavaScript)
- Category: Starters / SaaS
- Creates: a server app and a PostgreSQL database on the Shared tier (1 GB)
- Plan: Lite or above
- Price: Free
- Author: Light Cloud
- Page: https://templates.light-cloud.com/starters/saas/open-saas-starter
- Updated: 2026-11-21

## Features

- main.wasp.ts declares routes, auth, jobs and the email sender; Wasp generates the React client and Node.js server
- Email sign-up with verification and password reset; Google, GitHub and Discord sign-in prepared in src/auth/auth.wasp.ts
- Stripe Hobby and Pro subscriptions and a 10-credit pack, with a webhook at POST /payments-webhook and an account page
- Admin dashboard at /admin with revenue and traffic stats and a users table; ADMIN_EMAILS get admin rights on sign-up
- AI day planner at /demo-app on gpt-3.5-turbo: each run costs one of a new user's 3 credits unless they subscribe
- Presigned S3 uploads at /file-upload, up to 5 MB, for images, PDFs, text files and MP4 or QuickTime video
- An hourly pg-boss job pulls daily page views and sources from Plausible or Google Analytics for the admin stats
- Landing and pricing pages prerendered at build time, a cookie consent banner, dark mode and mock users via wasp db seed

## What you need

- A paid plan: deploying creates a PostgreSQL database, which the Free plan does not include
- To run it locally: Node.js, Docker for wasp start db, and the Wasp CLI 0.25 (npm i -g @wasp.sh/wasp-cli@0.25)
- SMTP_HOST, SMTP_PORT, SMTP_USERNAME and SMTP_PASSWORD from any email provider: sign-up needs a verification email, and the deploy's placeholders send none
- Optional: STRIPE_API_KEY, STRIPE_WEBHOOK_SECRET and the three PAYMENTS_*_PLAN_ID values to take payments; placeholders keep the server booting
- Optional: OPENAI_API_KEY for the AI demo app and the AWS_S3_* values for file uploads

## About

Wasp reads main.wasp.ts and the *.wasp.ts files under src/, then generates the client, the Express server and the Prisma layer, so most of your work is React pages plus Wasp queries and actions. The server validates every provider's variables at start through src/env.ts, which is why a deploy begins with placeholder values; when you drop a feature, remove its schema there as well. Set real SMTP values first and change defaultFrom in src/server/emailSender.wasp.ts and fromField in src/auth/auth.wasp.ts, because nobody can log in until the verification email arrives. On Light Cloud the server and client run in one container with exactly one instance, so the pg-boss job never runs twice, and every push to your copy redeploys.

## Variables

- `SMTP_HOST`: filled in. Email — signup & password reset
- `SMTP_PORT`: filled in. Email — signup & password reset
- `SMTP_USERNAME`: filled in. Email — signup & password reset
- `SMTP_PASSWORD`: filled in. Email — signup & password reset
- `ADMIN_EMAILS`: filled in. Admin dashboard access
- `STRIPE_API_KEY`: filled in. Payments (Stripe)
- `STRIPE_WEBHOOK_SECRET`: filled in. Payments (Stripe)
- `PAYMENTS_HOBBY_SUBSCRIPTION_PLAN_ID`: filled in. Payments — plan ids
- `PAYMENTS_PRO_SUBSCRIPTION_PLAN_ID`: filled in. Payments — plan ids
- `PAYMENTS_CREDITS_10_PLAN_ID`: filled in. Payments — plan ids
- `OPENAI_API_KEY`: filled in. AI demo app
- `AWS_S3_REGION`: filled in. File uploads (S3)
- `AWS_S3_IAM_ACCESS_KEY`: filled in. File uploads (S3)
- `AWS_S3_IAM_SECRET_KEY`: filled in. File uploads (S3)
- `AWS_S3_FILES_BUCKET`: filled in. File uploads (S3)
- `LEMONSQUEEZY_API_KEY`: filled in. Payments (Lemon Squeezy, alternative)
- `LEMONSQUEEZY_WEBHOOK_SECRET`: filled in. Payments (Lemon Squeezy, alternative)
- `LEMONSQUEEZY_STORE_ID`: filled in. Payments (Lemon Squeezy, alternative)
- `POLAR_ORGANIZATION_ACCESS_TOKEN`: filled in. Payments (Polar, alternative)
- `POLAR_SANDBOX_MODE`: filled in. Payments (Polar, alternative)
- `POLAR_WEBHOOK_SECRET`: filled in. Payments (Polar, alternative)
- `PLAUSIBLE_API_KEY`: filled in. Analytics (Plausible)
- `PLAUSIBLE_SITE_ID`: filled in. Analytics (Plausible)
- `PLAUSIBLE_BASE_URL`: filled in. Analytics (Plausible)
- `GOOGLE_ANALYTICS_CLIENT_EMAIL`: filled in. Analytics (Google)
- `GOOGLE_ANALYTICS_PRIVATE_KEY`: filled in. Analytics (Google)
- `GOOGLE_ANALYTICS_PROPERTY_ID`: filled in. Analytics (Google)

## Questions

### Why can I not log in after signing up to Open SaaS?

Open SaaS requires email verification, and no email is sent while the SMTP_* variables are placeholders. Set real SMTP values and redeploy; locally you can set SKIP_EMAIL_VERIFICATION_IN_DEV=true in .env.server instead.

### Which Wasp version does this Open SaaS template use?

Wasp 0.25, declared in main.wasp.ts as ^0.25.0. Install the matching CLI with npm i -g @wasp.sh/wasp-cli@0.25.

### How do I switch Open SaaS from Stripe to Lemon Squeezy or Polar?

In src/payment/paymentProcessor.ts, import lemonSqueezyPaymentProcessor or polarPaymentProcessor and export it as paymentProcessor in place of the Stripe one. Then set that provider's variables and follow the Open SaaS payments guide.

### How do I make myself an admin in Open SaaS?

Put your email in ADMIN_EMAILS before you sign up. Admin rights are granted when the account is created.

### Can I deploy Open SaaS without Light Cloud?

Yes. Nothing in the app depends on Light Cloud: wasp build produces a Node.js server with a Dockerfile and a static client, which run on any host with Node.js and PostgreSQL.
