Skip to content
/ open-saas Public template
forked from wasp-lang/open-saas

A free, open-source SaaS app starter for React & Node.js with superpowers. Production-ready. Community-driven.

License

Notifications You must be signed in to change notification settings

Mike1455/open-saas

Repository files navigation

Wasp SaaS Template w/ GPT API, Google Auth, Tailwind, & Stripe Payments

Running it locally

Before you being, install Wasp by running curl -sSL https://get.wasp-lang.dev/installer.sh | sh in your terminal. ou have two options to run this template locally:

  1. Run wasp new <project-name> -t saas. This will clone and set up the repo in the background.
  2. Create a .env.server file in the root of the project
  3. Copy the env.example file contents to .env.server and fill in your API keys
  4. Make sure you have a Database connected and running. Here are two quick options:
  • run wasp start db if you have Docker installed (if not, on MacOS run brew install docker-machine docker). This will start a Postgres database for you. No need to do anything else! 🤯
  • or provision a Postgres database on Railway, go to settings and copy the connection url. Past it as DATABASE_URL=<your-postgres-connection-url> into your env.server file.
  1. Run wasp db migrate-dev
  2. Run wasp start. This will install all dependencies and start the client and server for you :)
  3. Go to localhost:3000 in your browser (your NodeJS server will be running on port 3001)
  4. Install the Wasp extension for VSCode to get the best DX
  5. Check the files for comments containing specific instructions
  6. Enjoy and Have fun. When you create an App with this template, be kind and let me know by tagging me on twitter @hot_town

How it works

  • 🐝 Wasp - allows you to build full-stack apps with 10x less boilerplate
  • 🎨 Tailwind CSS - CSS that's easy to work with
  • 🤖 OpenAI - GPT-3.5 turbo API
  • 💸 Stripe - for payments
  • 📧 SendGrid - for email

Wasp as the full-stack framework allows you to describe your app’s core features in the main.wasp config file in the root directory. Then it builds and glues these features into a React-Express-Prisma app for you so that you can focus on writing the client and server-side logic instead of configuring. For example, I did not have to use any third-party libraries for Google Authentication. I just wrote a couple lines of code in the config file stating that I want to use Google Auth, and Wasp configures it for me. Check out the comments main.wasp file for more.

Stripe makes the payment functionality super easy. I just used their Subscription feature. After the user pays, their hasPaid and datePaid fields are updated in the database via the webhook found in the src/server/serverSetup.ts file.

Wasp's integrated Jobs feature is used to run a cron job every week to send an newsletter email. I used SendGrid for the email service.

If you have any other questions, feel free to reach out to me on twitter

About

A free, open-source SaaS app starter for React & Node.js with superpowers. Production-ready. Community-driven.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 95.7%
  • JavaScript 2.8%
  • Other 1.5%