add demo & deploy

This commit is contained in:
vincanger
2023-04-20 13:49:23 +02:00
parent f8426d7a04
commit e900c6d636

View File

@@ -6,6 +6,21 @@
<a href="https://www.producthunt.com/posts/free-saas-template-gpt-stripe-auth?utm_source=badge-featured&utm_medium=badge&utm_souce=badge-free&#0045;saas&#0045;template&#0045;gpt&#0045;stripe&#0045;auth" target="_blank"><img src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=389763&theme=neutral" alt="Free&#0032;SaaS&#0032;Template&#0032;&#0040;GPT&#0044;&#0032;Stripe&#0044;&#0032;Auth&#0041; - A&#0032;free&#0032;React&#0047;NodeJS&#0032;SaaS&#0032;template&#0032;for&#0032;quick&#0032;idea&#0032;execution | Product Hunt" style="width: 200px;" width="200" /></a>
<br/>
## What is it?
Entirely free SaaS template built with Prisma/Postgres, Express, React, Node (PERN stack). Use it as a springboard to build great products!
It has pre-configured:
- 🔐 Authentication (email + social)
- 📩 Emailing
- 🤑 Payments (Stripe)
- 🤖 GPT API,
and leverages:
- ⌨️ TypeScript
- 🎨 Tailwind CSS
Test it out here: [https://saas-template-gpt-client.fly.dev/](https://saas-template-gpt-client.fly.dev/)
## Running it locally
1. Make sure you have the latest version of [Wasp](https://wasp-lang.dev) installed by running `curl -sSL https://get.wasp-lang.dev/installer.sh | sh` in your terminal.
@@ -21,6 +36,19 @@
9. Check the files for comments containing specific instructions
10. 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](https://twitter.com/hot_town)
## Deploying it quickly to Fly.io
1. Create an account on Fly.io
2. Install the Fly CLI by running `curl -L https://fly.io/install.sh | sh` on Linux/MacOS
3. Run `wasp deploy fly setup my-wasp-app mia`
4. Run `wasp deploy fly cmd secrets set ENV_VAR_EXAMPLE=<your-env-var> --context=server`, making sure to fill in all of your env vars
5. Run `wasp deploy fly create-db mia`
6. Run `wasp deploy fly deploy`
7. make sure you've updated your Stripe webhook URL in your [Stripe dashboard](https://dashboard.stripe.com/) to point to your Fly app's URL
8. Also make sure you've updated your [Google Auth callback URL](https://wasp-lang.dev/docs/integrations/google#google-auth) to point to your Fly app's URL
You can also see the guides for deploying manually to Fly, Railway, and Netlify [here](https://wasp-lang.dev/docs/deploying).
## How it works
- 🐝 [Wasp](https://wasp-lang.dev) - allows you to build full-stack apps with 10x less boilerplate
@@ -31,7 +59,7 @@
[Wasp](https://wasp-lang.dev) as the full-stack framework allows you to describe your apps 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](https://stripe.com/) 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.
[Stripe](https://stripe.com/) 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/webhooks.ts` file.
[Wasp's integrated Jobs](https://wasp-lang.dev/docs/language/features#jobs) feature is used to run a cron job every week to send an newsletter email. I used [SendGrid](https://sendgrid.com/) for the email service.