Skip to content

Commit 13c79b9

Browse files
authored
Add setup video & store ID info to docs (wasp-lang#349)
* add video & store id info * Update VideoPlayer.astro
1 parent 17b0d76 commit 13c79b9

File tree

4 files changed

+63
-31
lines changed

4 files changed

+63
-31
lines changed
Loading

opensaas-sh/blog/src/components/VideoPlayer.astro

+32-11
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,40 @@ interface Props {
66
}
77
88
const { src, lgWidth = '55%', smWidth = '100%' } = Astro.props;
9+
10+
// Function to check if the URL is a YouTube URL and, if so, extract the video ID
11+
function getYouTubeId(url: string): string | null {
12+
const regExp = /^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/;
13+
const match = url.match(regExp);
14+
return match && match[2].length === 11 ? match[2] : null; // Note: all YouTube video IDs are 11 characters long.
15+
}
16+
17+
const youTubeId = getYouTubeId(src);
18+
const isYouTube = !!youTubeId;
919
---
1020

11-
<video
12-
src={src}
13-
preload="true"
14-
autoplay
15-
muted
16-
controls
17-
loop
18-
class="video-player"
19-
>
20-
<track kind="captions">
21-
</video>
21+
{isYouTube ? (
22+
<iframe
23+
src={`https://www.youtube.com/embed/${youTubeId}`}
24+
title="YouTube video player"
25+
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
26+
allowfullscreen
27+
style="aspect-ratio: 16 / 9; width: 100%;"
28+
>
29+
</iframe>
30+
) : (
31+
<video
32+
src={src}
33+
preload="true"
34+
autoplay
35+
muted
36+
controls
37+
loop
38+
class="video-player"
39+
>
40+
<track kind="captions">
41+
</video>
42+
)}
2243

2344
<style define:vars={{ lgWidth, smWidth }}>
2445
.video-player {

opensaas-sh/blog/src/content/docs/guides/payments-integration.mdx

+9
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import addVariant from '@assets/lemon-squeezy/add-variant.png';
1515
import variantId from '@assets/lemon-squeezy/variant-id.png';
1616
import subscriptionVariantIds from '@assets/lemon-squeezy/subscription-variant-ids.png';
1717
import ngrok from '@assets/lemon-squeezy/ngrok.png';
18+
import storeId from '@assets/lemon-squeezy/store-id.png';
1819

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

248+
### Get your Lemon Squeezy Store ID
249+
250+
<Image src={storeId} alt="store id" loading="lazy" />
251+
252+
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.
253+
254+
Copy and paste this number in your `.env.server` file under `LEMONSQUEEZY_STORE_ID=`
255+
247256
### Create Test Products
248257

249258
To create a test product, go to the test products url [https://app.lemonsqueezy.com/products](https://app.lemonsqueezy.com/products).

opensaas-sh/blog/src/content/docs/start/getting-started.md opensaas-sh/blog/src/content/docs/start/getting-started.mdx

+22-20
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,14 @@ banner:
44
content: |
55
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>
66
---
7+
import VideoPlayer from '../../../components/VideoPlayer.astro';
78

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

11+
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.
12+
13+
<VideoPlayer src="https://youtu.be/lFGtwbwt66k" lgWidth="100%" />
14+
1015
## Install Wasp
1116

1217
### Pre-requisites
@@ -22,38 +27,35 @@ To switch easily between Node.js versions, we recommend using [nvm](https://gith
2227
Need help with nvm?
2328
</summary>
2429
<div>
30+
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.
2531

26-
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.
32+
Then, install a version of Node.js that you need:
2733

28-
Then, install a version of Node.js that you need:
34+
```shell
35+
nvm install 20
36+
```
2937

30-
```shell
31-
nvm install 20
32-
```
38+
Finally, whenever you need to ensure a specific version of Node.js is used, run:
3339

34-
Finally, whenever you need to ensure a specific version of Node.js is used, run:
40+
```shell
41+
nvm use 20
42+
```
3543

36-
```shell
37-
nvm use 20
38-
```
44+
to set the Node.js version for the current shell session.
3945

40-
to set the Node.js version for the current shell session.
46+
You can run
4147

42-
You can run
48+
```shell
49+
node -v
50+
```
4351

44-
```shell
45-
node -v
46-
```
47-
48-
to check the version of Node.js currently being used in this shell session.
49-
50-
Check NVM repo for more details: [https://github.com/nvm-sh/nvm](https://github.com/nvm-sh/nvm).
52+
to check the version of Node.js currently being used in this shell session.
5153

54+
Check NVM repo for more details: [https://github.com/nvm-sh/nvm](https://github.com/nvm-sh/nvm).
5255
</div>
5356
</details>
5457
:::
5558

56-
5759
### Linux and macOS
5860

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

7879
</details>
80+
:::
7981

8082
### Windows
8183

0 commit comments

Comments
 (0)