Skip to content
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

Add setup video & store ID info to docs #349

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 32 additions & 11 deletions opensaas-sh/blog/src/components/VideoPlayer.astro
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,40 @@ interface Props {
}

const { src, lgWidth = '55%', smWidth = '100%' } = Astro.props;

// Function to check if the URL is a YouTube URL and, if so, extract the video ID
function getYouTubeId(url: string): string | null {
const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
const match = url.match(regExp);
return match && match[2].length === 11 ? match[2] : null; // Note: all YouTube video IDs are 11 characters long.
}

const youTubeId = getYouTubeId(src);
const isYouTube = !!youTubeId;
---

<video
src={src}
preload="true"
autoplay
muted
controls
loop
class="video-player"
>
<track kind="captions">
</video>
{isYouTube ? (
<iframe
src={`https://www.youtube.com/embed/${youTubeId}`}
title="YouTube video player"
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
allowfullscreen
style="aspect-ratio: 16 / 9; width: 100%;"
>
</iframe>
) : (
<video
src={src}
preload="true"
autoplay
muted
controls
loop
class="video-player"
>
<track kind="captions">
</video>
)}

<style define:vars={{ lgWidth, smWidth }}>
.video-player {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import addVariant from '@assets/lemon-squeezy/add-variant.png';
import variantId from '@assets/lemon-squeezy/variant-id.png';
import subscriptionVariantIds from '@assets/lemon-squeezy/subscription-variant-ids.png';
import ngrok from '@assets/lemon-squeezy/ngrok.png';
import storeId from '@assets/lemon-squeezy/store-id.png';

This guide will show you how to set up Payments for testing and local development with the following payment processors:
- Stripe
Expand Down Expand Up @@ -244,6 +245,14 @@ Once you've created your account, you'll need to get your test API keys. You can
- Give your API key a name
- Copy and paste it in your `.env.server` file under `LEMONSQUEEZY_API_KEY=`

### Get your Lemon Squeezy Store ID

<Image src={storeId} alt="store id" loading="lazy" />

To get your store ID, go to the [Lemon Squeezy Dashboard](https://app.lemonsqueezy.com/settings/stores) and copy the `Store ID` from the top right corner.

Copy and paste this number in your `.env.server` file under `LEMONSQUEEZY_STORE_ID=`

### Create Test Products

To create a test product, go to the test products url [https://app.lemonsqueezy.com/products](https://app.lemonsqueezy.com/products).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ banner:
content: |
Open SaaS is now running on <b><a href='https://wasp-lang.dev'>Wasp v0.15</a></b>! <br/>⚙️<br/>If you're running an older version and would like to upgrade, please follow the <a href="https://wasp-lang.dev/docs/migration-guides/migrate-from-0-14-to-0-15">migration instructions.</a>
---
import VideoPlayer from '../../../components/VideoPlayer.astro';

This guide will help you get your new SaaS app up and running.

If you prefer video tutorials, you can watch this walkthrough below which will guide you through most of the setup (installation, authentication, payments, etc.). If you get stuck at any point, you can refer back to these docs for more information.

<VideoPlayer src="https://youtu.be/lFGtwbwt66k" lgWidth="100%" />

## Install Wasp

### Pre-requisites
Expand All @@ -22,38 +27,35 @@ To switch easily between Node.js versions, we recommend using [nvm](https://gith
Need help with nvm?
</summary>
<div>
Install nvm via your OS package manager (`apt`, `pacman`, `homebrew`, ...) or via the [nvm](https://github.com/nvm-sh/nvm#install--update-script) install script.

Install nvm via your OS package manager (`apt`, `pacman`, `homebrew`, ...) or via the [nvm](https://github.com/nvm-sh/nvm#install--update-script) install script.
Then, install a version of Node.js that you need:

Then, install a version of Node.js that you need:
```shell
nvm install 20
```

```shell
nvm install 20
```
Finally, whenever you need to ensure a specific version of Node.js is used, run:

Finally, whenever you need to ensure a specific version of Node.js is used, run:
```shell
nvm use 20
```

```shell
nvm use 20
```
to set the Node.js version for the current shell session.

to set the Node.js version for the current shell session.
You can run

You can run
```shell
node -v
```

```shell
node -v
```

to check the version of Node.js currently being used in this shell session.

Check NVM repo for more details: [https://github.com/nvm-sh/nvm](https://github.com/nvm-sh/nvm).
to check the version of Node.js currently being used in this shell session.

Check NVM repo for more details: [https://github.com/nvm-sh/nvm](https://github.com/nvm-sh/nvm).
</div>
</details>
:::


### Linux and macOS

Open your terminal and run:
Expand All @@ -73,9 +75,9 @@ Given that the wasp binary is built for x86 and not for arm64 (Apple Silicon), y
softwareupdate --install-rosetta
```
Once Rosetta is installed, you should be able to run Wasp without any issues.
:::

</details>
:::

### Windows

Expand Down
Loading