-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reviewing Open Saas docs #367
base: filip-empty
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superficial stuff I noticed while getting familiar with how Open Saas works
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, whenever you need to ensure a specific version of Node.js is used, run: | ||
|
||
```shell | ||
nvm use 20 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The text tells users to use Node > 18
, while the code tells them to install Node 20. While technically correct, it's a little confusing.
1. a user clicks the `BUY` button and a **Checkout session** is created on the server | ||
2. the user is redirected to the Checkout page where they enter their payment info | ||
3. the user is redirected back to the app and the Checkout session is completed | ||
4. Stripe / Lemon Squeezy sends a webhook event to the server with the payment info | ||
5. The app server's **webhook handler** handles the event and updates the user's subscription status |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We should start them all with capital letters.
const handleBuyClick = async (paymentPlanId) => { | ||
const checkoutSession = await generateCheckoutSession(paymentPlanId); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This example seems incomplete. We should add // ...
or something similar in the function's body.
}; | ||
``` | ||
|
||
The webhook handler is defined in the `src/payment/webhook.ts` file. Unlike Actions and Queries in Wasp which are only to be used internally, we define the webhook handler in the `main.wasp` file as an API endpoint in order to expose it externally to Stripe |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The webhook handler is defined in the `src/payment/webhook.ts` file. Unlike Actions and Queries in Wasp which are only to be used internally, we define the webhook handler in the `main.wasp` file as an API endpoint in order to expose it externally to Stripe | |
The webhook handler is defined in the `src/payment/webhook.ts` file. Unlike Actions and Queries in Wasp which are only to be used internally, we define the webhook handler in the `main.wasp` file as an API endpoint in order to expose it externally to Stripe: |
- [ ] Update meta tags in `app.head` (even if you don't have a custom domain yet, put one you would like to have, as this won't affect development). | ||
- [ ] Update `app.emailSender.defaultFrom.name` with the name of your app/company/whatever you want your users to see in their inbox, if you're using the `emailSender` feature and/or `email` Auth method. | ||
- [ ] Remove any features you might not use or need: | ||
- [ ] Auth methods - `app.auth.methods` | ||
- [ ] If you're not using `email` Auth method, remove the routes/pages `RequestPasswordReset`, `PasswordReset`, and `EmailVerification` | ||
- [ ] Email Sending - `app.emailSender`, `job emailChecker` | ||
- [ ] Plausible analytics - `app.head` | ||
- [ ] File Uploading - `entity File`, `route FileUploadRoute`, `action createFile`, `query getAllFilesByUser`, `getDownloadFileSignedURL` | ||
- [ ] Rename Entites and their properties, Routes/Pages, & Operations, if you wish. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This list is a little difficult to read. Same goes for other chapters.
This guide will show you how to integrate analytics for your app. You can choose between [Google Analytics](#google-analytics) and [Plausible](#plausible). | ||
|
||
Google Analytics is free, but uses cookies, so you'll probably want/need to implement the [Cookie Consent Modal](/guides/cookie-consent/) when using it. | ||
|
||
Plausible is an open-source, privacy-friendly alternative to Google Analytics. **You DO NOT have to use the cookie consent modal** with Plausible, as it does not use cookies. It's also easier to use than Google if you use their hosted service, but be aware it is a paid feature. It is completely free if you want to self-host it, although this comes with some additional setup steps. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The core sentiment here might be correct, but the explanation is a little off, and will probably raise eyebrows with experienced users.
TL;DR GDPR does not care about cookies, it cares about data.
See here for details: #125 (comment)
Go back to your Plausible dashboard, click on your username in the top right, and click on the `Settings` tab. Scroll down, find your API key and paste it into your `.env.server` file under the `PLAUSIBLE_API_KEY` variable. | ||
|
||
:::note[No Cookies] | ||
Plausible does not use cookies, so you don't need to add it to your [Cookie Consent Modal](/guides/cookie-consent/), hence the script can be added directly to `app.head` in your `main.wasp` file. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment for cookies as above.
|
||
### Plausible Analytics | ||
|
||
If you decide to go with [Plausible Analytics](/guides/analytics/#plausible), you **DO NOT** need to ask users for their consent to use cookies because Plausible, as a privacy-first analytics provider, [does not use cookies](https://plausible.io/privacy-focused-web-analytics). Instead, It collects website usage data anonymously and in aggregate form only, without any personally identifiable information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment about the cookies as above.
- the unused payment processor code within the `/src/payment/<unused-provider>` directory, | ||
- any unused environment variables from `.env.server` (they will be prefixed with the name of the provider your are not using): | ||
- e.g. `STRIPE_API_KEY`, `STRIPE_CUSTOMER_PORTAL_URL`, `LEMONSQUEEZY_API_KEY`, `LEMONSQUEEZY_WEBHOOK_SECRET` | ||
- Make sure to also uninstall the unused dependencies: | ||
- `npm uninstall @lemonsqueezy/lemonsqueezy.js` | ||
- or | ||
- `npm uninstall stripe` | ||
- Remove any unused fields from the `User` model in the `schema.prisma` file if they exist: | ||
- e.g. `lemonSqueezyCustomerPortalUrl` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: capitalize all bullet points
No description provided.