1
00:00:00,040 --> 00:00:03,960
Welcome to the Mongo DBTV 
Podcast live. 

2
00:00:04,480 --> 00:00:07,560
We are back here again. 
I'm your host today, Jesse Hall.

3
00:00:07,560 --> 00:00:09,840
I'm the staff developer advocate
here at Mongo DB. 

4
00:00:09,840 --> 00:00:14,120
Today we have a special guest. 
We're going to explore a really 

5
00:00:14,320 --> 00:00:19,480
a creative next generation 
commerce as code and this 

6
00:00:19,480 --> 00:00:23,160
platform is called Store Craft. 
So without further ado, I'd like

7
00:00:23,160 --> 00:00:26,200
to welcome on our guest Tomera. 
How are you? 

8
00:00:26,280 --> 00:00:27,800
Welcome. 
Thank you for coming on to the 

9
00:00:27,800 --> 00:00:30,440
show. 
Hi, Jesse, thank you for having 

10
00:00:30,440 --> 00:00:32,000
me. 
I'm excited to be here. 

11
00:00:32,400 --> 00:00:35,120
I'm so happy and I would love to
share about Storecraft. 

12
00:00:35,160 --> 00:00:37,280
My background is I'm a software 
engineer. 

13
00:00:37,280 --> 00:00:41,560
I've been creating codes and 
writing codes since I was a 

14
00:00:41,560 --> 00:00:44,160
little kid. 
I have a lot of experience with 

15
00:00:44,160 --> 00:00:49,360
C++ and the computer graphics, 
but also Android, the 

16
00:00:49,360 --> 00:00:51,840
development, you know, apps 
engineering. 

17
00:00:52,280 --> 00:00:56,320
And in the last few years I've 
been doing mainly deep learning 

18
00:00:56,320 --> 00:01:01,840
engineering, web development is,
is one of my, it's, it's my 

19
00:01:01,880 --> 00:01:04,760
passion. 
I'm eager to show you 

20
00:01:04,879 --> 00:01:06,640
Storecraft. 
Yeah, what you created, that's 

21
00:01:06,640 --> 00:01:09,120
amazing audience, let us know 
what are you excited about 

22
00:01:09,120 --> 00:01:10,680
today? 
And then what we're going to 

23
00:01:10,680 --> 00:01:14,320
talk about here is this really 
neat thing here called 

24
00:01:14,320 --> 00:01:16,720
Storecraft. 
I really love the aesthetics of 

25
00:01:16,720 --> 00:01:20,160
this of this landing page here. 
It's it's amazing. 

26
00:01:20,560 --> 00:01:23,240
And so talk to us about store 
craft. 

27
00:01:23,240 --> 00:01:24,640
What high level? 
What is it? 

28
00:01:24,640 --> 00:01:28,800
Store Craft is OK. 
It's it's a it's a JavaScript 

29
00:01:28,800 --> 00:01:32,280
framework to create commerce 
backends. 

30
00:01:32,640 --> 00:01:35,360
Commerce backends. 
It's like ACMSA content 

31
00:01:35,360 --> 00:01:38,960
management system where you can 
upload products, connect them 

32
00:01:38,960 --> 00:01:42,840
into collections, define 
discounts and create a check out

33
00:01:42,840 --> 00:01:45,840
experience. 
In addition to that it ships 

34
00:01:45,840 --> 00:01:49,920
with dashboard and you can 
program everything about it. 

35
00:01:50,160 --> 00:01:54,880
Most commerce systems as we know
today like Shopify and Woo 

36
00:01:54,880 --> 00:02:00,520
Commerce which is a PHP based 
system which they are amazing 

37
00:02:00,520 --> 00:02:02,920
but they are more configuration 
based. 

38
00:02:03,360 --> 00:02:09,120
Storecraft takes a different 
approach on that everything is 

39
00:02:09,120 --> 00:02:13,960
called where you commit to 
GitHub and hopefully CI or CD 

40
00:02:14,040 --> 00:02:18,560
process pushes your code, 
deploys your code into the 

41
00:02:18,560 --> 00:02:23,360
cloud. 
So if you need a new change in 

42
00:02:23,360 --> 00:02:27,600
your store, you can just open 
the ID, write some code, some 

43
00:02:27,600 --> 00:02:31,880
scripts, you know, hopefully it 
won't be a lot and it will be 

44
00:02:31,880 --> 00:02:37,560
live. 
So store Craft can run 

45
00:02:37,560 --> 00:02:40,280
everywhere. 
It can run on any JavaScript 

46
00:02:40,280 --> 00:02:43,040
runtime. 
You can essentially put Store 

47
00:02:43,040 --> 00:02:46,440
Craft inside the browser. 
You can run it, you can run it 

48
00:02:46,440 --> 00:02:51,200
inside the browser even it is 
agnostic to the platform it has.

49
00:02:52,600 --> 00:02:56,720
Every platform that can use 
Storecraft you have to implement

50
00:02:56,720 --> 00:03:00,760
some sort of an adapter the way 
that others other frameworks are

51
00:03:00,760 --> 00:03:04,880
doing such as Svelte and the 
Remix for example. 

52
00:03:04,880 --> 00:03:08,760
You can connect your own I would
say platform. 

53
00:03:09,520 --> 00:03:13,440
In addition to that Storecraft 
can connect to most storage 

54
00:03:13,440 --> 00:03:17,600
devices to store images and 
medias from your online store 

55
00:03:18,040 --> 00:03:22,840
and also databases and the main 
one is Mongo DB but you can 

56
00:03:22,840 --> 00:03:27,240
connect any SQL type of database
even cloud ones. 

57
00:03:28,560 --> 00:03:32,040
Nice. 
So I see, you know, get started 

58
00:03:32,080 --> 00:03:34,920
NPX Storecraft create. 
It's that easy, right? 

59
00:03:35,400 --> 00:03:37,040
Yeah. 
That's awesome. 

60
00:03:37,640 --> 00:03:41,760
It's that easy. 
So I I would like to to say a 

61
00:03:41,760 --> 00:03:43,640
few words on why I created Store
coughed. 

62
00:03:43,960 --> 00:03:46,000
Yeah, yeah. 
I would love to know how, how, 

63
00:03:46,120 --> 00:03:48,000
how did this come about? 
Like how did you even come up 

64
00:03:48,000 --> 00:03:52,920
with the idea? 
So about two years ago, my son, 

65
00:03:53,160 --> 00:03:58,240
which he loves retro games, you 
know, he trades video games, 

66
00:03:58,440 --> 00:04:02,120
like really old video games, 
like 20 years ago type of games.

67
00:04:02,800 --> 00:04:08,160
And he built a community around 
this hobby and the community 

68
00:04:08,160 --> 00:04:12,360
like exploded with many 
participants and he was selling 

69
00:04:12,360 --> 00:04:15,880
video games, trading video games
and buying video games. 

70
00:04:16,160 --> 00:04:18,800
And then when they approached 
him and said that you're a 

71
00:04:18,800 --> 00:04:22,600
software engineer, let's create 
an online store. 

72
00:04:23,480 --> 00:04:27,080
So of course I told him go to 
use Shopify and other pre made 

73
00:04:27,120 --> 00:04:33,160
solutions but he decided that he
wanted something that was more 

74
00:04:33,160 --> 00:04:39,760
cost effective for his needs. 
So so me, I love React, I love 

75
00:04:39,760 --> 00:04:44,360
JavaScript and I decided I 
decided to take the challenge. 

76
00:04:45,240 --> 00:04:47,720
But this is how Stoke of the 
came about. 

77
00:04:49,800 --> 00:04:54,480
And so, so your son, he's 
selling these games and his 

78
00:04:54,520 --> 00:04:57,080
website is built on this 
technology that you created. 

79
00:04:57,080 --> 00:04:58,400
So what? 
That's amazing. 

80
00:04:58,400 --> 00:05:01,360
That's amazing story of how it 
came about. 

81
00:05:02,080 --> 00:05:05,840
But then how did you go from, 
OK, just creating this this code

82
00:05:05,880 --> 00:05:08,840
for your son, for his website 
and but, and then turning that 

83
00:05:08,840 --> 00:05:11,840
into what it is today into 
something that anyone can use? 

84
00:05:12,920 --> 00:05:16,640
Yeah, good question. 
OK. 

85
00:05:16,640 --> 00:05:21,680
For me, I think it has. 
I think it's because who I am as

86
00:05:21,680 --> 00:05:25,960
a software engineer. 
When I write software, I'm I 

87
00:05:25,960 --> 00:05:28,240
love to build a lot of libraries
around it. 

88
00:05:28,720 --> 00:05:32,680
I'm more into it to build a 
technology and a technology that

89
00:05:32,680 --> 00:05:35,720
is reusable and can bring value 
to other users. 

90
00:05:36,160 --> 00:05:39,040
It's my passion. 
I do open source for more than 

91
00:05:39,040 --> 00:05:42,760
10 years. 
So when I started writing this 

92
00:05:43,600 --> 00:05:48,640
online store of his I, I, I 
thought to myself, what if I can

93
00:05:48,640 --> 00:05:52,480
connect to anything I want? 
If I can optimise the platform 

94
00:05:52,840 --> 00:05:56,520
or optimise the database type 
that fits to my use case. 

95
00:05:56,840 --> 00:05:59,440
You know, no two stores are 
alike. 

96
00:05:59,440 --> 00:06:03,840
You know, if you have a very 
simple store, then you can use 

97
00:06:03,840 --> 00:06:06,480
simple solutions. 
If you have a more demanding 

98
00:06:06,480 --> 00:06:10,720
store that requires a 
performance, a performance 

99
00:06:10,720 --> 00:06:15,000
database, then I want to be able
to hook into this database. 

100
00:06:15,320 --> 00:06:18,840
In all other solutions that I've
seen, they only offer just one 

101
00:06:18,840 --> 00:06:21,720
database, 1 storage or one 
platform to run on. 

102
00:06:22,320 --> 00:06:26,840
So I decided to, to hack it away
to start building upon it. 

103
00:06:27,120 --> 00:06:34,680
And fortunately it was, it made 
sense to me and and it worked. 

104
00:06:34,880 --> 00:06:39,080
I mean, it worked because I 
actually have friends and other 

105
00:06:39,200 --> 00:06:42,560
people around the world that are
using it to create crazy things 

106
00:06:42,560 --> 00:06:45,560
with it. 
Even, you know, and ecommerce 

107
00:06:45,560 --> 00:06:47,600
stores. 
It doesn't have to be a website 

108
00:06:47,600 --> 00:06:53,360
based, you know, it can be a bot
on on on Telegram or WhatsApp 

109
00:06:54,040 --> 00:06:56,040
and it can be a mobile 
experience. 

110
00:06:56,040 --> 00:07:00,960
You know, it doesn't have to be 
like a complete web store. 

111
00:07:01,320 --> 00:07:04,680
So the use cases are diverse. 
That's interesting. 

112
00:07:05,040 --> 00:07:07,800
That's very interesting. 
So let me ask you quickly then, 

113
00:07:07,800 --> 00:07:09,640
how much does it cost to use 
Storecraft? 

114
00:07:10,800 --> 00:07:14,760
OK. 
So it, it depends, it depends on

115
00:07:15,200 --> 00:07:18,520
on how you optimise it. 
So for example, if you can get a

116
00:07:18,520 --> 00:07:23,240
good deal, for example on Atlas,
you know, and you can connect 

117
00:07:23,560 --> 00:07:28,960
storage device like an S3 
compatible with Cloudflare, then

118
00:07:28,960 --> 00:07:32,960
you reach like really low cost, 
you know, low cost, lower than 

119
00:07:32,960 --> 00:07:37,880
what you would get with Shopify.
And my friend's store, it cost 

120
00:07:37,880 --> 00:07:41,680
him like nothing. 
You know, a lot of the online 

121
00:07:41,680 --> 00:07:43,840
databases, they offer a free 
tier. 

122
00:07:44,960 --> 00:07:48,160
And if your store is like 
occasionally used, you can 

123
00:07:48,280 --> 00:07:52,360
actually practically run it like
for like $5.00 a month. 

124
00:07:53,520 --> 00:07:55,040
Wow, nice. 
Super cool. 

125
00:07:55,960 --> 00:07:57,840
But that's, that's that is 
amazing. 

126
00:07:58,240 --> 00:08:01,200
But to be clear, you're not 
charging for the use of 

127
00:08:01,200 --> 00:08:03,960
Storecraft yourself. 
This project is actually open 

128
00:08:03,960 --> 00:08:06,560
source, right? 
Yeah, it's an open source. 

129
00:08:06,800 --> 00:08:09,920
You can self host it however you
want. 

130
00:08:09,960 --> 00:08:15,200
You can put all of this inside a
Cloudflare worker or on a server

131
00:08:15,200 --> 00:08:19,440
less on at Versal. 
By the way, connectors will 

132
00:08:19,440 --> 00:08:24,640
appear in the following weeks, I
mean integrations with Versales.

133
00:08:25,120 --> 00:08:30,160
Or you can, you know, spin an 
EC2 server and let it run 24/7, 

134
00:08:30,640 --> 00:08:33,240
connect it to Mongo DB for 
example. 

135
00:08:34,720 --> 00:08:39,080
These cases are diverse and. 
Yes, nice, nice. 

136
00:08:39,080 --> 00:08:41,400
That's that's really amazing. 
At Mongo DB. 

137
00:08:41,400 --> 00:08:44,560
We love to support open source 
projects and this is amazing 

138
00:08:44,560 --> 00:08:46,640
one. 
We talked about the, you know, 

139
00:08:46,640 --> 00:08:51,400
run it anywhere that you have 
different storage options and 

140
00:08:51,400 --> 00:08:55,640
different database options. 
Let's talk about why. 

141
00:08:55,640 --> 00:09:00,760
Why did you choose to use Mongo 
DB in in this as an option? 

142
00:09:01,560 --> 00:09:06,600
OK, so my Sunstorm, it runs on 
MongoDB. 

143
00:09:07,280 --> 00:09:10,920
I'm a huge fan of MongoDB. 
And not just me, most of my 

144
00:09:10,920 --> 00:09:13,480
friends are. 
And it's the easiest to get 

145
00:09:13,480 --> 00:09:17,320
started with, especially for 
JavaScript developers, You know,

146
00:09:18,120 --> 00:09:22,400
it actually complements the 
development experience. 

147
00:09:22,560 --> 00:09:26,520
And what I found out is that I 
can go into Atlas, you know, 

148
00:09:26,520 --> 00:09:31,360
start my database and just get 
this URL from the database and 

149
00:09:31,360 --> 00:09:33,920
just plug it in into the MongoDB
driver. 

150
00:09:34,360 --> 00:09:37,240
You know, it was super fast. 
There's a lot of ecosystem and 

151
00:09:37,240 --> 00:09:39,480
developer tools around it, 
everything. 

152
00:09:39,480 --> 00:09:41,760
If you need an ORM, you can use 
something like Mongoose. 

153
00:09:42,120 --> 00:09:47,880
You know, for me I'm just using 
the regular driver, which for me

154
00:09:47,880 --> 00:09:54,360
it's the best solution. 
So I think that I trust Mongo 

155
00:09:54,360 --> 00:09:56,200
DB. 
That's why I started with Mongo 

156
00:09:56,200 --> 00:10:01,000
DB and most of the development 
of Storecraft was with Mongo DB.

157
00:10:01,920 --> 00:10:03,480
Nice, nice. 
That's amazing. 

158
00:10:05,360 --> 00:10:08,840
Let's go ahead and let's let's, 
let's see some action. 

159
00:10:08,840 --> 00:10:13,480
Let's let's look at a quick demo
and see how to actually get this

160
00:10:13,480 --> 00:10:15,960
up and running. 
And I think you've got some some

161
00:10:15,960 --> 00:10:17,960
cool stuff lined up for us in 
this demo as well. 

162
00:10:18,320 --> 00:10:21,400
Yeah, when you're ready to share
your screen and let's let's get 

163
00:10:21,400 --> 00:10:23,240
into some code. 
Yeah, definitely. 

164
00:10:23,560 --> 00:10:30,720
So I will tell the viewers that 
we have set up some cool stuff 

165
00:10:31,000 --> 00:10:31,680
for them. 
Nice. 

166
00:10:32,400 --> 00:10:35,120
Yeah. 
So I will show Store Croft just 

167
00:10:35,120 --> 00:10:38,320
how to use it, you know, the the
back end, the dashboard and 

168
00:10:38,320 --> 00:10:40,800
everything. 
And then in the end, hopefully 

169
00:10:40,800 --> 00:10:44,280
we'll have time, I will show you
an extension of written that 

170
00:10:44,280 --> 00:10:47,760
uses vector search AI 
capabilities with Store Croft. 

171
00:10:48,480 --> 00:10:50,840
See, we haven't talked about 
that yet that this is a brand 

172
00:10:50,840 --> 00:10:53,200
new thing to store craft, right?
Yeah, yeah. 

173
00:10:53,840 --> 00:10:56,800
Yeah, that's another amazing 
thing about open source is it's,

174
00:10:56,800 --> 00:10:59,880
it's constantly being, you know,
worked on. 

175
00:10:59,880 --> 00:11:03,000
If, if, if anyone wants to, to 
help Tamara out, I'm sure he 

176
00:11:03,000 --> 00:11:06,400
would welcome some PRS or some 
suggestions as well, right? 

177
00:11:06,400 --> 00:11:08,000
That's how the open source 
community works. 

178
00:11:08,800 --> 00:11:11,240
But it's amazing seeing these 
projects continue to evolve. 

179
00:11:11,920 --> 00:11:14,040
Definitely I'm looking for 
contributors. 

180
00:11:14,080 --> 00:11:18,560
There is a big road map and a 
lot of things related to AI and 

181
00:11:18,640 --> 00:11:24,880
many cool things are coming. 
So I'm at the terminal and I all

182
00:11:24,880 --> 00:11:28,400
I have to do is use the NPX 
stalk of create command. 

183
00:11:29,400 --> 00:11:32,720
So I run it. 
As soon as I do that, you know, 

184
00:11:32,920 --> 00:11:37,040
there is some sort of some sort 
of a wizard that asked me a few 

185
00:11:37,040 --> 00:11:40,600
questions to help me scaffold 
stalk of application. 

186
00:11:42,280 --> 00:11:47,120
So let's see. 
OK, so admin emails super 

187
00:11:47,120 --> 00:11:52,720
important. 
I'll put my own e-mail, a port 

188
00:11:52,720 --> 00:11:56,120
e-mail, which is very important 
if you want to send 

189
00:11:56,120 --> 00:12:00,480
transactional emails or the 
platform to run the storm. 

190
00:12:00,760 --> 00:12:05,000
You have Node, Bantino, Cluffler
workers, AWS Lambda even and 

191
00:12:05,000 --> 00:12:08,320
Google Functions. 
I will go for Node because I'm 

192
00:12:08,320 --> 00:12:12,400
running locally and now you can 
select the database. 

193
00:12:12,440 --> 00:12:15,440
What we're going to do is use 
the MongoDB database. 

194
00:12:17,480 --> 00:12:22,400
Now for the connection URL, what
you normally do, you just go 

195
00:12:22,400 --> 00:12:28,000
into MongoDB Atlas just the 
second. 

196
00:12:28,400 --> 00:12:32,080
I have it here OK and. 
So you're watching another 

197
00:12:32,080 --> 00:12:33,400
video? 
Yes. 

198
00:12:33,440 --> 00:12:34,760
And what? 
Should I recognize that one? 

199
00:12:37,240 --> 00:12:39,200
You just go to the connect 
button. 

200
00:12:39,400 --> 00:12:43,240
I will not show my own URL 
because of privacy issues. 

201
00:12:43,360 --> 00:12:47,040
But from there you'll get URL 
and you can use it. 

202
00:12:47,520 --> 00:12:52,880
For now I will not put my own my
own key, but I will show you in 

203
00:12:52,880 --> 00:12:55,400
a minute. 
The database name that I'm going

204
00:12:55,400 --> 00:13:00,480
to use is called test. 
Now I will select A storage 

205
00:13:00,480 --> 00:13:03,600
device for Storecraft. 
I will go with the Node GS local

206
00:13:03,600 --> 00:13:09,080
storage. 
OK, Now for the e-mail provider,

207
00:13:09,080 --> 00:13:11,920
I will go with recent. 
Again, I will not share my API 

208
00:13:11,920 --> 00:13:14,200
key. 
And now you can select a payment

209
00:13:14,200 --> 00:13:16,160
provider. 
It can be Stripe or PayPal. 

210
00:13:16,920 --> 00:13:21,160
Honestly, we will not go into, 
we will not go into payment 

211
00:13:21,160 --> 00:13:24,800
providers right now. 
So I'll just go ahead. 

212
00:13:25,360 --> 00:13:30,880
And once we did that, it will 
actually install all of the 

213
00:13:30,880 --> 00:13:35,600
packages. 
It will scaffold skeleton for 

214
00:13:35,600 --> 00:13:39,520
your project. 
And now let's see. 

215
00:13:40,840 --> 00:13:48,920
OK, so now we will go into the 
the the folder and what we need 

216
00:13:48,920 --> 00:13:52,040
to do right now is. 
That There you go. 

217
00:13:52,680 --> 00:13:53,480
Yeah. 
OK, no. 

218
00:13:53,640 --> 00:13:56,840
You're good. 
Is to run NPM run migrate. 

219
00:13:57,680 --> 00:14:03,200
For me the database was already 
migrated OK, but I will run it. 

220
00:14:03,200 --> 00:14:05,600
But before I run it, I will do 
something. 

221
00:14:05,960 --> 00:14:08,360
I will show you the what was 
created. 

222
00:14:10,600 --> 00:14:14,720
OK, So what stalk of did is to 
create a single file, I mean a 

223
00:14:14,720 --> 00:14:18,240
bunch of files and one of them 
is the app JS file. 

224
00:14:19,520 --> 00:14:21,320
You can see the directory 
structure. 

225
00:14:21,760 --> 00:14:27,640
This is this on the left. 
OK, now if I see what's 

226
00:14:27,640 --> 00:14:30,600
happening here, we have the 
stalk of app. 

227
00:14:31,160 --> 00:14:33,400
There are some secret access 
tokens. 

228
00:14:33,400 --> 00:14:36,760
They're not relevant. 
You can put them inside an 

229
00:14:37,000 --> 00:14:40,000
environment file just for the 
demoing. 

230
00:14:40,000 --> 00:14:41,800
They will be. 
For the sake of the demo, they 

231
00:14:41,800 --> 00:14:44,920
will be here. 
But once they are created, you 

232
00:14:44,920 --> 00:14:47,080
know, just save them somewhere 
safe. 

233
00:14:48,480 --> 00:14:51,520
OK, so. 
So this is specific to to the 

234
00:14:51,560 --> 00:14:53,960
the back end environment of 
Storecraft. 

235
00:14:54,120 --> 00:14:58,920
Yeah, the secret, the secret 
access token and refresh token 

236
00:14:59,680 --> 00:15:02,840
secrets are used to for 
authentication and 

237
00:15:02,840 --> 00:15:04,560
authorizations. 
Gotcha. 

238
00:15:04,880 --> 00:15:07,880
You don't have to use them, you 
can plug your own if you want. 

239
00:15:08,400 --> 00:15:10,440
So if you try, if the audience 
tries to use them, they can't 

240
00:15:10,440 --> 00:15:12,240
because they're not. 
They're on your local computer. 

241
00:15:12,600 --> 00:15:14,320
Exactly. 
OK. 

242
00:15:15,760 --> 00:15:20,280
So from here, so once we have 
the instance of the app and a 

243
00:15:20,280 --> 00:15:23,040
batch of configuration, by the 
way, there's there are many more

244
00:15:23,040 --> 00:15:25,120
configurations that you can 
configure. 

245
00:15:25,680 --> 00:15:29,920
You also can configure the 
course options if you want and 

246
00:15:29,920 --> 00:15:33,200
many other things. 
For example if you have CDN that

247
00:15:33,200 --> 00:15:38,120
is connected to your S3 bucket, 
you can demand to rewrite the 

248
00:15:38,120 --> 00:15:41,560
URLs when the return from the 
back end in the product media. 

249
00:15:42,840 --> 00:15:48,720
OK, so once we go a little bit 
down, we see the platform, we 

250
00:15:48,720 --> 00:15:52,920
see the database. 
Now the database, we have the 

251
00:15:52,920 --> 00:15:58,320
URL here, but the store crafts 
connector for Mongo DB, it can 

252
00:15:58,320 --> 00:16:02,880
actually infer the mongo DBURL 
from the environment file. 

253
00:16:04,640 --> 00:16:07,720
Yeah, yeah. 
And besides that if you need to 

254
00:16:07,720 --> 00:16:10,840
customize things, you have the 
options, the Mongo client 

255
00:16:10,840 --> 00:16:14,400
options. 
So if you need things that more 

256
00:16:14,400 --> 00:16:19,000
things for authentication and 
whatnot, you can use that as 

257
00:16:19,000 --> 00:16:22,480
well. 
The thing about stalker that it 

258
00:16:22,480 --> 00:16:25,920
is highly non opinionated, you 
know? 

259
00:16:27,800 --> 00:16:30,480
So another thing here we have 
the resend. 

260
00:16:31,080 --> 00:16:37,000
Resend is an e-mail provider. 
I will use the recent key that 

261
00:16:37,040 --> 00:16:42,920
I've already have in my 
environment file, OK with 

262
00:16:42,920 --> 00:16:46,520
payment gateways. 
So here you have a handle and 

263
00:16:46,520 --> 00:16:50,080
the payment gateway itself. 
Maybe you know what there is 

264
00:16:50,080 --> 00:16:53,760
also we have a concept of dummy 
payment gateway. 

265
00:16:54,000 --> 00:16:57,520
I I I will import it, you know, 
OK, let's. 

266
00:16:57,640 --> 00:16:58,840
Oh. 
For testing that, that's 

267
00:16:58,840 --> 00:17:00,720
amazing. 
Yeah, definitely. 

268
00:17:00,720 --> 00:17:04,720
It's for testing. 
So we have payments and then we 

269
00:17:04,720 --> 00:17:08,880
have dummy. 
OK, let's see. 

270
00:17:11,040 --> 00:17:13,359
Yeah, there it is, dummy 
payments. 

271
00:17:14,760 --> 00:17:17,720
So here with the payment 
gateways, it's actually it's 

272
00:17:17,720 --> 00:17:21,640
essentially an object that I can
do something like this. 

273
00:17:22,680 --> 00:17:24,440
You know what, I will give it a 
key. 

274
00:17:25,720 --> 00:17:34,480
Now the keys are important 
because with the keys you can 

275
00:17:35,320 --> 00:17:37,520
the API, the REST API is using 
the key. 

276
00:17:37,520 --> 00:17:40,960
So for example, if you want to 
create a check out using one of 

277
00:17:40,960 --> 00:17:44,400
the payment gateways, you have 
to remember these handles which 

278
00:17:44,400 --> 00:17:50,080
are the keys. 
OK, OK, OK, so we also have a 

279
00:17:50,080 --> 00:17:53,120
bunch of extensions. 
The Postman extension is a cool 

280
00:17:53,120 --> 00:17:55,880
extension. 
And by the way, Next up we're 

281
00:17:55,880 --> 00:17:58,920
going to build an extension. 
So I will show what extension 

282
00:17:58,920 --> 00:18:02,760
means, I mean what build one. 
But the Postman extension is 

283
00:18:02,880 --> 00:18:07,240
just a simple extension that 
listens to events of store Koft.

284
00:18:08,000 --> 00:18:12,800
So it listens for example when 
checkout is complete and once it

285
00:18:12,800 --> 00:18:18,080
is complete it, it fetches an 
e-mail template from the back 

286
00:18:18,080 --> 00:18:23,360
end and put the information of 
the customer and then send him a

287
00:18:23,400 --> 00:18:27,640
transactional e-mail using the 
using the Mailer that we've seen

288
00:18:27,640 --> 00:18:31,880
here for example recent. 
So yeah, so when you said 

289
00:18:31,880 --> 00:18:35,840
Postman, I was thinking of 
Postman the the the testing 

290
00:18:36,840 --> 00:18:39,360
client. 
Yeah, yeah, definitely. 

291
00:18:40,720 --> 00:18:46,000
Maybe it's not a good name. 
OK, it's OK. 

292
00:18:46,320 --> 00:18:47,600
It's good to clarify that 
though. 

293
00:18:47,840 --> 00:18:52,080
Yeah. 
So by the way, if if we if we'll

294
00:18:52,520 --> 00:18:56,400
go back here. 
So if you need to to customize 

295
00:18:56,400 --> 00:19:00,160
anything that is related to 
events in stock of all you have 

296
00:19:00,160 --> 00:19:06,520
to do is to keep this and and 
then you have and you have a 

297
00:19:06,600 --> 00:19:11,000
listing again. 
So for example, if you want to 

298
00:19:11,000 --> 00:19:15,720
send an e-mail when a change 
password request, you know you 

299
00:19:15,720 --> 00:19:18,360
can do that. 
So by the way, the Postman 

300
00:19:18,360 --> 00:19:25,520
extension does that as well. 
But let's look at it, let's do 

301
00:19:25,520 --> 00:19:29,200
something like this. 
This would be an event. 

302
00:19:30,120 --> 00:19:34,560
OK, now every event object you 
can, you can stop the 

303
00:19:34,560 --> 00:19:38,840
propagation which means you can 
steal the event handling from 

304
00:19:38,920 --> 00:19:43,520
for example other extensions, 
which is super nice And then you

305
00:19:43,520 --> 00:19:46,960
have the event payload. 
And in this example, the event 

306
00:19:46,960 --> 00:19:52,600
payload is something that is 
called an oath user type, which 

307
00:19:52,600 --> 00:19:56,880
is essential for creating to 
responding to this event. 

308
00:19:57,680 --> 00:20:02,640
Anyway, let's. 
Lots of lots of customizability,

309
00:20:03,040 --> 00:20:08,640
yes, if that's a word. 
So before we start everything, I

310
00:20:08,640 --> 00:20:11,440
want to show you how the index 
files look like. 

311
00:20:12,000 --> 00:20:15,680
OK, so Storecraft, once we 
injected it with the node 

312
00:20:15,680 --> 00:20:19,800
platform, it has something that 
is called a handler. 

313
00:20:20,400 --> 00:20:24,640
Now the handler translate 
incoming messages from from 

314
00:20:24,640 --> 00:20:28,480
nodes incoming message. 
I mean it's the HTTP driver of a

315
00:20:28,480 --> 00:20:31,640
node. 
It translates into a web 

316
00:20:31,640 --> 00:20:36,240
standard request, OK. 
And then it sends it to a 

317
00:20:36,240 --> 00:20:41,040
virtual REST API controller 
which only knows about web 

318
00:20:41,040 --> 00:20:44,200
request and web response. 
And then the web response 

319
00:20:44,200 --> 00:20:48,440
returns and then it streams it 
back into the server response of

320
00:20:48,440 --> 00:20:54,000
node. 
So let's say OK, so let's let's 

321
00:20:54,000 --> 00:20:57,600
do it. 
So I run the migrate script. 

322
00:20:58,080 --> 00:21:02,640
OK, essentially it's a success 
because I've already migrated 

323
00:21:02,640 --> 00:21:07,480
migrating a MongoDB. 
Migrating MongoDB essentially 

324
00:21:07,480 --> 00:21:12,080
means succeeding some templates 
and also creating indexes for 

325
00:21:12,080 --> 00:21:15,600
MongoDB. 
Oh wow, so so can so can. 

326
00:21:16,560 --> 00:21:18,800
Are you able to show in Atlas 
like what that did? 

327
00:21:19,480 --> 00:21:22,600
Yeah, definitely, definitely. 
Because I'm curious, I want to, 

328
00:21:22,600 --> 00:21:23,960
I want to like really 
understand. 

329
00:21:24,160 --> 00:21:27,880
So it's it's added some data to 
your database. 

330
00:21:28,600 --> 00:21:29,640
Yes. 
So. 

331
00:21:30,120 --> 00:21:35,640
If we look at the test, what it 
did was essentially if I go for 

332
00:21:35,640 --> 00:21:41,280
example to the templates, it 
stated the database with 

333
00:21:41,920 --> 00:21:48,240
templates, Yeah. 
And also it created indexes for 

334
00:21:49,120 --> 00:21:53,000
almost everything. 
For example, I'll show you here.

335
00:21:53,680 --> 00:21:59,880
If I go to products and then 
insert into, enter into indexes 

336
00:22:02,040 --> 00:22:05,960
then yeah it seems to be loading
maybe? 

337
00:22:06,000 --> 00:22:08,680
It's the, it's just the joys of 
of live coding. 

338
00:22:08,680 --> 00:22:11,320
I mean, when you're trying to do
a demo, nothing ever works 

339
00:22:11,320 --> 00:22:16,080
exactly how it should. 
That's OK, but that that's 

340
00:22:16,080 --> 00:22:19,880
really interesting. 
So that migrate added some data 

341
00:22:19,880 --> 00:22:23,280
to your database, some templates
and some some other things and 

342
00:22:23,280 --> 00:22:26,320
then it's created those indexes 
automatically for you. 

343
00:22:26,320 --> 00:22:30,800
So that's that's that's a quick,
quick and easy way to get that 

344
00:22:30,800 --> 00:22:33,680
set up and and going. 
And if you need more indexes 

345
00:22:33,680 --> 00:22:38,920
issues, you can just go into 
your Atlas and do whatever. 

346
00:22:39,200 --> 00:22:41,480
You need something specific, 
yeah. 

347
00:22:42,600 --> 00:22:46,360
So let's see. 
OK, cool. 

348
00:22:46,440 --> 00:22:47,160
So. 
Here we go. 

349
00:22:47,720 --> 00:22:51,320
If you're if you're going into 
indexes, hopefully it will load.

350
00:22:52,720 --> 00:22:54,520
It might still actually because 
you just ran that. 

351
00:22:54,520 --> 00:22:56,920
So it actually might be creating
those indexes still because 

352
00:22:56,920 --> 00:23:01,720
those tend to take a should just
be a few seconds, but they I 

353
00:23:01,720 --> 00:23:04,920
don't know how many indexes it's
creating, so it could take a 

354
00:23:04,920 --> 00:23:07,880
little bit of time there. 
Yeah, definitely. 

355
00:23:08,440 --> 00:23:09,960
Definitely. 
But that's that's cool. 

356
00:23:09,960 --> 00:23:12,600
We can continue with the demo. 
I'm sure those are going to pop 

357
00:23:12,600 --> 00:23:16,760
up here in a minute. 
But it's very great to 

358
00:23:16,760 --> 00:23:19,000
understand that might what that 
what exactly that migrate 

359
00:23:19,000 --> 00:23:20,080
command did. 
Yeah. 

360
00:23:20,080 --> 00:23:27,720
Because it is important and in 
in store Craft I implement a 

361
00:23:27,720 --> 00:23:32,360
very robust query language like 
a boolean query language where 

362
00:23:32,360 --> 00:23:36,200
you can search for something 
that has this property or this 

363
00:23:36,200 --> 00:23:40,600
property but not this property. 
It also has a cursor which 

364
00:23:40,600 --> 00:23:45,840
requires indexes. 
Anyway, let's start it, let's 

365
00:23:45,840 --> 00:23:50,760
go. 
So once we hit NPM start, OK, we

366
00:23:50,760 --> 00:23:53,960
see this screen. 
Now this screen will give you 

367
00:23:53,960 --> 00:23:57,320
all the information about the 
requests, date requests. 

368
00:23:57,600 --> 00:24:01,120
And I'll show you in a second. 
One thing to note is that we 

369
00:24:01,120 --> 00:24:07,840
have an API reference which is 
being maintained by me and I use

370
00:24:07,840 --> 00:24:12,600
the greatest colour.com project 
is a super cool. 

371
00:24:12,600 --> 00:24:15,320
It's like it's like Postman 
essentially. 

372
00:24:17,000 --> 00:24:21,600
So you can use it to actually 
test requests and see what's 

373
00:24:21,600 --> 00:24:26,600
going on. 
And we will probably get back to

374
00:24:26,600 --> 00:24:32,200
this once we do the extensions, 
but let's see, let's go to 

375
00:24:32,200 --> 00:24:38,080
products. 
Let's see if we have listing 

376
00:24:38,080 --> 00:24:45,280
filter product items. 
OK, so you can do something like

377
00:24:45,320 --> 00:24:51,520
this. 
OK, now you can see the products

378
00:24:51,760 --> 00:24:53,840
that have returned. 
Nice. 

379
00:24:54,560 --> 00:24:56,160
Yeah. 
I've never used. 

380
00:24:56,160 --> 00:24:58,280
I've never seen this this this 
before. 

381
00:24:58,280 --> 00:25:01,520
This is a pretty cool product. 
Or what is this? 

382
00:25:01,520 --> 00:25:03,360
Is this a package? 
A JavaScript package I'm 

383
00:25:03,360 --> 00:25:05,440
assuming. 
Well, it's actually quite 

384
00:25:05,440 --> 00:25:08,000
amazing. 
What you do is that you write an

385
00:25:08,000 --> 00:25:13,600
open API file which lists all of
your backends functionality with

386
00:25:13,600 --> 00:25:15,600
examples and everything and 
endpoint. 

387
00:25:16,240 --> 00:25:21,720
And then I use a tool actually 
they, they read this open API 

388
00:25:21,720 --> 00:25:25,640
file and and they inject it into
their application. 

389
00:25:25,640 --> 00:25:27,840
It's it's an application, it's a
web application. 

390
00:25:28,440 --> 00:25:31,360
And then see everything. 
It's super cool. 

391
00:25:31,360 --> 00:25:37,640
I can serve it from the back end
itself and it's, it helps me a 

392
00:25:37,640 --> 00:25:40,520
lot. 
Now if you see it's Talker by 

393
00:25:40,520 --> 00:25:43,840
the way, you can see what's 
going on under the hood. 

394
00:25:44,080 --> 00:25:50,200
You'll see the the HTTP method, 
the path and the amount of time 

395
00:25:50,200 --> 00:25:53,080
it took. 
And if you have queries, you'll 

396
00:25:53,080 --> 00:25:55,560
see them too. 
So now I'm going to the 

397
00:25:55,560 --> 00:26:04,840
dashboard. 
OK, OK, so let me just, OK, so 

398
00:26:04,880 --> 00:26:07,800
the first time that you're 
connecting to Storecraft with 

399
00:26:07,960 --> 00:26:12,360
the authentic, the admin emails 
that you specified, the first 

400
00:26:12,360 --> 00:26:15,000
password is admin. 
So you can change it later 

401
00:26:15,000 --> 00:26:18,440
through the through the through 
the dashboard, through the 

402
00:26:18,440 --> 00:26:22,560
second page. 
OK, OK. 

403
00:26:23,280 --> 00:26:26,800
And then on here, if you could 
maybe just do command plus one, 

404
00:26:26,800 --> 00:26:31,280
one time, maybe, maybe now 2, 
Yeah, that's a little bit 

405
00:26:31,280 --> 00:26:32,200
better. 
Yeah, maybe one more. 

406
00:26:33,200 --> 00:26:37,040
Actually actually stock of 
dashboard is mobile friendly. 

407
00:26:37,640 --> 00:26:38,920
Oh, good. 
Nice, nice. 

408
00:26:41,920 --> 00:26:44,960
You see, everything falls falls 
into place. 

409
00:26:45,440 --> 00:26:46,280
Nice, nice. 
OK. 

410
00:26:47,080 --> 00:26:48,480
OK, so. 
Really good. 

411
00:26:49,320 --> 00:26:54,200
But I can do you see this 
sidebar, I can close and open 

412
00:26:54,200 --> 00:26:57,600
it. 
So if you're going to products, 

413
00:26:57,920 --> 00:27:00,400
for example, you know what, 
let's create a product. 

414
00:27:02,160 --> 00:27:05,800
Let's create like a simple, 
simple product. 

415
00:27:06,920 --> 00:27:11,800
So we'll give it a title. 
Let's say we want to have like 2

416
00:27:11,800 --> 00:27:14,920
products related to Nintendo. 
I love Nintendo. 

417
00:27:16,480 --> 00:27:23,200
The first one will be a Nintendo
Switch which is console a home 

418
00:27:23,200 --> 00:27:26,920
console for playing games. 
Now the handle handle is like an

419
00:27:26,920 --> 00:27:32,160
ID handles should be unique. 
I can also suggest it from the 

420
00:27:32,160 --> 00:27:36,920
title. 
Now I'll give it a description. 

421
00:27:37,520 --> 00:27:40,680
Actually have a made-up 
description for this. 

422
00:27:41,440 --> 00:27:47,040
I have content marked on file 
that I've created just you're. 

423
00:27:47,040 --> 00:27:50,480
Prepared. 
Yeah, actually it's important 

424
00:27:50,480 --> 00:27:54,120
for me because it's for the the 
semantic search. 

425
00:27:54,160 --> 00:27:57,560
I want it to be rich. 
Gotcha. 

426
00:27:58,520 --> 00:28:04,360
So you put it here, you have 
rich editor now media. 

427
00:28:04,360 --> 00:28:10,760
Media is super cool. 
What we do is that I have an 

428
00:28:10,760 --> 00:28:14,920
image here which I can drag and 
drop OK. 

429
00:28:15,640 --> 00:28:18,400
Nice. 
And you actually have a very 

430
00:28:18,400 --> 00:28:22,840
nice editor. 
You can crop, you can scale up, 

431
00:28:22,840 --> 00:28:28,440
scale down and translate. 
And you can also decide on the 

432
00:28:28,440 --> 00:28:33,880
format and the quality. 
I will go like this. 

433
00:28:33,920 --> 00:28:38,640
I will put this OK. 
And the next thing I'll give you

434
00:28:38,640 --> 00:28:42,040
the price of 100, although I 
wish it was the price. 

435
00:28:42,520 --> 00:28:46,520
That's pretty cheap. 
Let's say we have two of them. 

436
00:28:47,760 --> 00:28:52,520
I'll show you something cool. 
So, so once we create the 

437
00:28:52,520 --> 00:28:58,560
product, we see the eligible 
discounts that this product is 

438
00:28:58,960 --> 00:29:02,280
eligible for. 
But The thing is that is more 

439
00:29:02,280 --> 00:29:06,680
important for me. 
Storecraft is a developer first 

440
00:29:07,080 --> 00:29:09,480
framework. 
So you also always have the 

441
00:29:09,480 --> 00:29:15,080
Jason, you know upfront in the 
cards, you can see the discounts

442
00:29:15,080 --> 00:29:17,680
and everything and what you 
should expect from it. 

443
00:29:19,160 --> 00:29:22,880
You can also things like related
products and tags which are 

444
00:29:22,880 --> 00:29:25,560
super important for querying and
filtering. 

445
00:29:25,920 --> 00:29:29,160
And you can also connect it into
a collection. 

446
00:29:30,760 --> 00:29:33,960
But right now we won't do it. 
What we are going to do, we'll 

447
00:29:33,960 --> 00:29:40,480
create another product, so we'll
add another one and the second 

448
00:29:40,480 --> 00:29:46,400
one will be and call it Super 
Mario T-shirt. 

449
00:29:47,640 --> 00:29:48,600
OK. 
OK. 

450
00:29:49,320 --> 00:29:50,840
Who doesn't love a Mario 
T-shirt? 

451
00:29:51,880 --> 00:29:53,160
There you go. 
Nice. 

452
00:29:53,160 --> 00:29:57,520
OK. 
And I also have a description. 

453
00:29:58,880 --> 00:30:03,760
Actually, I came up with this 
description and probably you can

454
00:30:03,760 --> 00:30:08,840
guess I'm not a marketing guy. 
Very, very short and 

455
00:30:08,840 --> 00:30:10,680
descriptive. 
Yeah, exactly. 

456
00:30:10,680 --> 00:30:15,160
So we'll take the image and 
here. 

457
00:30:16,000 --> 00:30:21,320
Nice. 
It also looks fine and just and 

458
00:30:21,320 --> 00:30:25,880
then we give it 100 as well. 
That's an expensive T-shirt. 

459
00:30:26,200 --> 00:30:30,360
Yeah, that's an expensive 1. 
You pay premium for Mario. 

460
00:30:33,280 --> 00:30:36,760
OK, cool. 
So now we have the Super Mario 

461
00:30:36,760 --> 00:30:42,600
T-shirt and the Nintendo Switch.
What can we do with it? 

462
00:30:43,120 --> 00:30:48,680
We can let's create a discount 
for for this type of product. 

463
00:30:48,680 --> 00:30:52,040
So we're going to do discounts 
and we'll, we make something 

464
00:30:52,040 --> 00:30:54,400
cool. 
We'll make some something like 

465
00:30:54,520 --> 00:30:57,360
if you buy a Nintendo Switch, 
then you get a Super Mario 

466
00:30:57,360 --> 00:31:00,840
T-shirt for 50%. 
Sounds cool. 

467
00:31:01,400 --> 00:31:05,360
That sounds that sounds better. 
50% yeah, $50 is better than 

468
00:31:05,360 --> 00:31:11,200
$100 a hundred T-shirt. 
Which with Mario shirt how we 

469
00:31:11,200 --> 00:31:16,680
call it the discount code use 
the handle and the way we do it 

470
00:31:16,680 --> 00:31:21,040
is we use the discount details 
and buy X get white up type of 

471
00:31:22,440 --> 00:31:25,960
discount. 
Now the buy X1, what you have to

472
00:31:25,960 --> 00:31:31,120
do you just have to define the 
filters of what is the X in our 

473
00:31:31,120 --> 00:31:35,800
case just the switch. 
So we make a product belongs to 

474
00:31:35,800 --> 00:31:39,360
filter and then we will search 
the oh there it is. 

475
00:31:39,720 --> 00:31:46,080
So if I switch let's save it. 
And then if we go a little bit 

476
00:31:46,080 --> 00:31:50,280
down, you have if customer buys 
X of the things that were 

477
00:31:50,280 --> 00:31:55,400
filtered up above, then the 
customer gets YA quantity of 

478
00:31:55,400 --> 00:31:58,280
something with the following 
filter. 

479
00:31:58,520 --> 00:32:03,480
Now what we'll do is here we 
will take the Super Mario shirt.

480
00:32:04,720 --> 00:32:08,160
OK, that makes sense. 
Cool. 

481
00:32:08,240 --> 00:32:10,120
And now you decide how many 
percents off. 

482
00:32:11,920 --> 00:32:15,520
So we made the 50 percents off. 
You can see the pricing 

483
00:32:15,520 --> 00:32:19,760
explanation right here. 
So because, you know, pricing, 

484
00:32:19,760 --> 00:32:24,280
it's like, it's like a little 
bit of mathematics and, you 

485
00:32:24,280 --> 00:32:26,400
know, people get confused and 
everything. 

486
00:32:26,600 --> 00:32:28,920
So yeah. 
What math are you using behind 

487
00:32:28,920 --> 00:32:32,640
the scenes? 
Show them exactly what it is. 

488
00:32:33,120 --> 00:32:40,200
It's very simple math, but for 
me it was more important to to 

489
00:32:40,880 --> 00:32:44,640
test it thoroughly. 
You know that there is a big 

490
00:32:44,880 --> 00:32:48,840
suite of tests for store cough. 
Now, all of this count is very 

491
00:32:48,840 --> 00:32:54,800
important because if you 
discounted, if you discounted 

492
00:32:54,800 --> 00:32:58,360
something, then it cannot be 
discounted again by another 

493
00:32:58,360 --> 00:33:00,720
discount. 
So the way the discount engine 

494
00:33:00,720 --> 00:33:04,880
works is that there is a stack 
of discounts that goes one after

495
00:33:04,880 --> 00:33:09,640
the other and you can specify 
the priority of this discount. 

496
00:33:09,920 --> 00:33:13,200
So this discount will always be 
will have the highest priority. 

497
00:33:15,480 --> 00:33:19,720
OK, I think that's that will cut
it. 

498
00:33:22,000 --> 00:33:26,120
OK, yes, OK, so it's created, 
everything looks good. 

499
00:33:26,240 --> 00:33:30,400
We also have the Jason super 
important for developers who 

500
00:33:30,400 --> 00:33:33,520
develop their own back end. 
They want to see what is going 

501
00:33:33,520 --> 00:33:35,960
on. 
We also see that this discount 

502
00:33:35,960 --> 00:33:38,960
is eligible for one product, 
which is the Nintendo Switch, 

503
00:33:39,120 --> 00:33:43,520
and it was applied zero times. 
OK, so you can keep track of how

504
00:33:43,520 --> 00:33:46,000
many times it's been used? 
Yes. 

505
00:33:46,400 --> 00:33:50,640
Nice. 
So think about it like if you 

506
00:33:50,640 --> 00:33:54,880
had some sort of a bot. 
OK you have you have a script 

507
00:33:54,880 --> 00:33:59,480
that every time that the user 
signs up, you create a coupon 

508
00:33:59,480 --> 00:34:02,360
which is a which is a manual 
discount for him. 

509
00:34:02,520 --> 00:34:05,360
You can do it in store cost with
a few hours of code. 

510
00:34:06,400 --> 00:34:09,080
Custom discount per per person. 
Yeah. 

511
00:34:09,679 --> 00:34:14,159
So this is the older page for 
this. 

512
00:34:14,159 --> 00:34:17,159
I will. 
I hope it's OK. 

513
00:34:17,920 --> 00:34:19,320
Yeah, it's good. 
That's good. 

514
00:34:19,800 --> 00:34:21,639
Yeah, and just yeah. 
That's good. 

515
00:34:22,600 --> 00:34:27,880
OK, cool. 
So first of all, let's let's say

516
00:34:27,880 --> 00:34:31,719
we're buying the Nintendo Switch
and the Super Mario T-shirt. 

517
00:34:32,719 --> 00:34:36,719
OK, so right off the bat we see 
that the total, the subtotal is 

518
00:34:36,719 --> 00:34:39,880
200. 
We'll pick up a delivery method,

519
00:34:40,760 --> 00:34:44,320
just something random that I've 
chosen and then we'll calculate 

520
00:34:44,320 --> 00:34:48,600
price. 
Now we we see that we have a 

521
00:34:48,600 --> 00:34:50,719
discount the switch with Mario 
shirt. 

522
00:34:51,560 --> 00:34:58,920
The Mario shirt cost 100 and it 
was discount by health to OK. 

523
00:34:59,160 --> 00:35:02,360
You can also. 
You can also in stock after you 

524
00:35:02,360 --> 00:35:07,120
can create a tax engine but it's
not on the scope of this. 

525
00:35:09,160 --> 00:35:12,880
So the discount was applied 
automatically based on the 

526
00:35:12,880 --> 00:35:15,760
quantity and the type of 
products, so the customer didn't

527
00:35:15,760 --> 00:35:17,680
actually have to put in the 
discount code. 

528
00:35:18,400 --> 00:35:20,280
Exactly. 
So discounts. 

529
00:35:21,360 --> 00:35:23,000
So you have two types of 
discounts. 

530
00:35:23,000 --> 00:35:25,040
You have automatic discounts and
many on discounts. 

531
00:35:25,240 --> 00:35:27,440
Many on discounts are actually 
your coupon codes. 

532
00:35:27,440 --> 00:35:31,000
You know the ones someone hands 
to you and say use this coupon 

533
00:35:31,000 --> 00:35:33,720
code. 
In Storecraft you can restrict 

534
00:35:33,840 --> 00:35:37,120
coupon codes to be specific to a
user, for example. 

535
00:35:39,440 --> 00:35:43,440
That's very nice. 
OK, so that's it like that. 

536
00:35:44,200 --> 00:35:48,760
This is enough now. 
OK, so first of all, we will 

537
00:35:48,760 --> 00:35:51,520
create the order. 
By the way, most of orders are 

538
00:35:51,520 --> 00:35:54,000
not created manually like this. 
That's right. 

539
00:35:54,440 --> 00:35:59,520
Yeah, they only created using 
using a website or using an API 

540
00:35:59,520 --> 00:36:03,920
call using. 
The exactly and what you've, 

541
00:36:03,920 --> 00:36:06,640
what you've shown us here, this 
is all of the back end dashboard

542
00:36:07,120 --> 00:36:11,920
of, of the of Storecraft. 
So you would normally connect to

543
00:36:11,920 --> 00:36:13,200
this from some sort of front 
end. 

544
00:36:13,600 --> 00:36:18,000
Exactly exactly. 
OK, so yes, and the the 

545
00:36:18,000 --> 00:36:21,640
documentation on on my website 
specify exactly how to do 

546
00:36:21,640 --> 00:36:23,360
checkouts. 
When I started with commerce, 

547
00:36:23,440 --> 00:36:26,640
checkouts seem to me like the 
toughest part. 

548
00:36:28,360 --> 00:36:30,560
So you can choose a payment 
gateway. 

549
00:36:30,840 --> 00:36:33,320
So you have the PayPal and the 
dummy payments. 

550
00:36:33,760 --> 00:36:37,240
We will go with dummy payments 
right now and I'll create a 

551
00:36:37,240 --> 00:36:40,640
checkout. 
So what happened behind the 

552
00:36:40,640 --> 00:36:48,480
scene is that you see this post 
request The API checkout create 

553
00:36:48,960 --> 00:36:53,200
was created with the gateway 
with handle dummy the same dummy

554
00:36:53,560 --> 00:36:56,520
that we defined earlier in the 
code. 

555
00:36:59,280 --> 00:37:04,440
OK, and and get back to it. 
OK, so something cool because 

556
00:37:04,440 --> 00:37:07,760
this is a dummy payment gateway 
you can void. 

557
00:37:07,800 --> 00:37:10,680
You can capture capture the the 
amount of money. 

558
00:37:11,040 --> 00:37:15,400
For example, if it was PayPal or
Stripe, you can actually capture

559
00:37:15,400 --> 00:37:21,760
the the order from here or void 
it or refund it, which is so 

560
00:37:21,760 --> 00:37:24,800
let's do something really, 
really quick before actually 

561
00:37:24,840 --> 00:37:27,960
something else before we no, 
actually, you know what, I'll 

562
00:37:27,960 --> 00:37:32,040
show it here. 
So a checkout key can be in 

563
00:37:32,040 --> 00:37:34,520
several states. 
One of them, the most important 

564
00:37:34,520 --> 00:37:37,520
ones are the created state and 
the complete state. 

565
00:37:38,160 --> 00:37:44,040
So if it was a website, then it 
would complete the checkout. 

566
00:37:44,520 --> 00:37:50,480
Let's save it. 
And once it does that, I should 

567
00:37:50,480 --> 00:37:53,480
receive an e-mail, a 
transactional e-mail from 

568
00:37:53,480 --> 00:37:58,080
Storecraft. 
So there it is. 

569
00:37:58,080 --> 00:38:01,040
Nice. 
Hi, Tom, Thank you for your 

570
00:38:01,040 --> 00:38:04,240
purchase. 
There is a nice table that tells

571
00:38:04,240 --> 00:38:07,880
me what I've bought in the 
shipping, the subtotal discounts

572
00:38:07,880 --> 00:38:11,560
and the total. 
Yeah. 

573
00:38:12,320 --> 00:38:14,680
And that's, that's being used 
again, that's being used through

574
00:38:14,840 --> 00:38:17,120
resend. 
And you, you had your, your API 

575
00:38:17,120 --> 00:38:19,280
key in your environment 
variables and so that went 

576
00:38:19,280 --> 00:38:21,520
through resend. 
It was already automatically set

577
00:38:21,520 --> 00:38:23,160
up for you. 
Exactly. 

578
00:38:23,600 --> 00:38:26,400
Nice. 
It is important for me to show 

579
00:38:27,200 --> 00:38:30,960
that people, when I show it to 
people, they're like, yeah, but 

580
00:38:30,960 --> 00:38:33,360
how they customize the templates
and everything. 

581
00:38:33,760 --> 00:38:38,040
So it's easy. 
You just go a little bit down to

582
00:38:38,040 --> 00:38:41,880
templates and here you search 
for the. 

583
00:38:43,200 --> 00:38:46,040
Let's put. 
These are your e-mail templates.

584
00:38:46,480 --> 00:38:51,640
Exactly, so you have checkout 
complete. close this. 

585
00:38:51,920 --> 00:38:54,800
OK, so here we have the checkout
complete. 

586
00:38:54,840 --> 00:39:01,360
Now the Postman extension uses 
the Checkout complete template 

587
00:39:01,400 --> 00:39:04,760
to send the e-mail and right 
here inside Storecraft you have 

588
00:39:04,760 --> 00:39:11,800
an editor complete code that you
can code the entire template 

589
00:39:12,120 --> 00:39:16,600
with the Handlebars language. 
It's a common template. 

590
00:39:16,600 --> 00:39:20,320
Language that's that's pretty 
cool. 

591
00:39:21,360 --> 00:39:23,520
Yeah, it's like very useful, you
know? 

592
00:39:23,520 --> 00:39:28,160
Yeah, If we go downstairs, you 
also have a template for text. 

593
00:39:28,920 --> 00:39:31,240
You know. 
Some people cannot receive 

594
00:39:32,000 --> 00:39:36,720
something like HTML and you also
have an example input for 

595
00:39:36,720 --> 00:39:39,760
templates. 
So you can, you know, debug your

596
00:39:39,880 --> 00:39:41,640
template, you know, and and make
it. 

597
00:39:42,720 --> 00:39:46,480
And also in addition to that, 
Storecraft is going to ship in 

598
00:39:46,480 --> 00:39:52,360
the next few weeks with, I would
say, a marketing, a marketing 

599
00:39:52,600 --> 00:39:57,800
functionality where you can 
connect one template and send a 

600
00:39:57,800 --> 00:40:00,880
massive amount of e-mail, 
personalized emails at once. 

601
00:40:01,560 --> 00:40:04,880
And it would be through the 
dashboard and you it will be 

602
00:40:04,880 --> 00:40:07,280
also accessible through the REST
API. 

603
00:40:08,160 --> 00:40:10,440
So you could set up like 
marketing campaigns where it 

604
00:40:10,440 --> 00:40:13,880
sends a a series of emails maybe
over some period of time. 

605
00:40:14,160 --> 00:40:15,880
Yeah. 
Nice. 

606
00:40:16,440 --> 00:40:18,800
And right here you can see also 
the extensions. 

607
00:40:19,240 --> 00:40:21,320
You, you see you have two 
extensions. 

608
00:40:21,440 --> 00:40:25,040
One of them is the notification 
extension, which is, by the way,

609
00:40:25,040 --> 00:40:29,680
if we look at the right corner, 
we have notifications, even the 

610
00:40:30,000 --> 00:40:36,760
even these notifications, it is 
essentially if you go to, if you

611
00:40:36,760 --> 00:40:42,360
go right here into Atlas, open 
the notification collection. 

612
00:40:43,120 --> 00:40:47,600
The it's actually an extension 
that listens to key events in 

613
00:40:47,600 --> 00:40:53,360
Storecroft and sends them. 
Nice. 

614
00:40:53,360 --> 00:40:55,040
And then they pop up there in 
the top right. 

615
00:40:55,480 --> 00:40:57,240
Exactly. 
Nice. 

616
00:41:00,840 --> 00:41:06,000
Amazing. 
So are we at the point where do 

617
00:41:06,000 --> 00:41:08,680
you, do you have part of your 
demo where we would access the 

618
00:41:08,680 --> 00:41:12,680
back end from a front end? 
How? 

619
00:41:12,760 --> 00:41:14,320
How would you go about? 
How would you go about 

620
00:41:14,320 --> 00:41:16,760
connecting everything to a front
end? 

621
00:41:17,760 --> 00:41:22,480
OK. 
So essentially, essentially 

622
00:41:22,480 --> 00:41:27,600
stock of these are headless 
commerce system, headless 

623
00:41:27,600 --> 00:41:31,440
systems. 
They don't ship with with the 

624
00:41:31,440 --> 00:41:34,680
front end. 
This is this is the thing about 

625
00:41:34,680 --> 00:41:36,000
it. 
I mean, they became super 

626
00:41:36,000 --> 00:41:41,000
popular in the last I think five
years after people got tired of 

627
00:41:41,000 --> 00:41:44,960
seeing the same old templates, 
you know, for things like 

628
00:41:45,920 --> 00:41:50,120
whoppers. 
So so stokers. 

629
00:41:51,760 --> 00:41:54,320
I'm sorry, I was going to say 
this is where Postman would come

630
00:41:54,320 --> 00:41:57,320
in, where you can see all those 
different routes, test them 

631
00:41:57,320 --> 00:42:00,400
there, and then implement those 
routes into your front end. 

632
00:42:00,680 --> 00:42:02,760
Yeah. 
So essentially, so this is the 

633
00:42:02,760 --> 00:42:05,960
back end. 
You can use the store craft to 

634
00:42:05,960 --> 00:42:09,520
query the products. 
We have a very robust query 

635
00:42:09,520 --> 00:42:11,840
engine. 
You can create the checkouts and

636
00:42:11,840 --> 00:42:16,880
the complete experience. 
I am looking for contributors to

637
00:42:16,880 --> 00:42:22,240
actually build a set of maybe 
reactive tools to help website 

638
00:42:22,240 --> 00:42:26,080
developers to start developing 
and connect to Storecft. 

639
00:42:26,320 --> 00:42:32,480
And also Storecft comes with 
chips with a JavaScript API, a 

640
00:42:32,480 --> 00:42:36,760
universal one. 
It's actually here in the SDK 

641
00:42:36,760 --> 00:42:44,640
tools and and I guess that views
that we want to to dive deeper, 

642
00:42:44,800 --> 00:42:48,040
we'll look at it, but it's a 
complete SDK. 

643
00:42:48,040 --> 00:42:51,640
You can run it from back end, 
You can run it even from the 

644
00:42:51,760 --> 00:42:54,680
browser to create your own 
commerce experiences. 

645
00:42:55,840 --> 00:43:01,160
Wow, amazing. 
Is there anything else before we

646
00:43:01,160 --> 00:43:03,440
get on to the extension part? 
Is there anything else that you 

647
00:43:03,440 --> 00:43:06,000
wanted to show off here or 
should we move on to the 

648
00:43:06,000 --> 00:43:12,360
extension? 
I don't know if we have. 

649
00:43:12,400 --> 00:43:14,720
Do you think we have time? 
We have more time. 

650
00:43:15,880 --> 00:43:19,080
We have about 15 minutes or so. 
So let's start with the 

651
00:43:19,080 --> 00:43:22,600
extension. 
OK, let's do it. 

652
00:43:23,040 --> 00:43:24,520
Yeah, this is the exciting part 
for me. 

653
00:43:24,520 --> 00:43:26,840
I want to see this. 
OK, cool, cool, cool. 

654
00:43:27,000 --> 00:43:34,080
So, OK, let's see how I OK, the 
way to kick off this extension 

655
00:43:34,080 --> 00:43:37,280
is actually to go into to to 
Atlas. 

656
00:43:37,640 --> 00:43:40,760
OK, so in Atlas I have the 
database, the the test database,

657
00:43:41,000 --> 00:43:44,280
OK. 
And under there we have a tab 

658
00:43:44,280 --> 00:43:46,720
that is called Atlas Search, 
right? 

659
00:43:47,800 --> 00:43:51,840
OK, so in Atlas search, what you
want to do is to create a search

660
00:43:51,840 --> 00:43:56,120
index and in Atlas vector 
search. 

661
00:43:57,240 --> 00:44:01,200
Yeah, I hope everyone sees that 
the next button. 

662
00:44:02,080 --> 00:44:07,520
OK, So under the vector index, 
I've taken by the way most of 

663
00:44:07,520 --> 00:44:09,880
this information from your 
videos. 

664
00:44:12,120 --> 00:44:17,960
So the first thing you like is 
is to is to is to pick up the 

665
00:44:17,960 --> 00:44:20,080
database. 
For me it's a test and what I 

666
00:44:20,080 --> 00:44:23,440
want to do maybe first I'll say 
what the the extension is going 

667
00:44:23,440 --> 00:44:25,560
to do. 
The extension is going to help 

668
00:44:25,560 --> 00:44:28,840
us semantically search for 
products by their description 

669
00:44:28,840 --> 00:44:33,080
and titles. 
So we're going to use AI to find

670
00:44:33,080 --> 00:44:38,160
products and and also just to 
take a step back here, this this

671
00:44:38,240 --> 00:44:42,560
Storecraft is so customizable. 
What we're doing here is we're 

672
00:44:42,560 --> 00:44:45,480
creating a custom extension for 
the specific use case. 

673
00:44:45,480 --> 00:44:50,160
So any developer can create any 
extension that they want in 

674
00:44:50,160 --> 00:44:52,920
store Craft to do a number of 
things right? 

675
00:44:53,480 --> 00:44:58,160
Yeah, definitely. 
I think I hit it OK. 

676
00:44:58,560 --> 00:45:04,760
OK So what you have to do is 
just go take the products 

677
00:45:04,760 --> 00:45:09,520
collection and just create the 
index with the following the 

678
00:45:09,520 --> 00:45:13,400
following configuration. 
The dimensions that you're using

679
00:45:13,400 --> 00:45:16,080
is is 1956. 
Actually, I. 

680
00:45:16,440 --> 00:45:18,760
Let's see, I. 
Actually, that might be. 

681
00:45:19,960 --> 00:45:22,000
I'll tell you exactly because I 
have it here. 

682
00:45:22,560 --> 00:45:28,240
OK, perfect. 
I have it OK, vector index, edit

683
00:45:28,240 --> 00:45:30,840
index definition, sorry yes 
good. 

684
00:45:31,720 --> 00:45:34,920
Just making sure 1536. 
Yeah, exactly. 

685
00:45:35,120 --> 00:45:40,000
So it's actually from your 
developer relationships and and 

686
00:45:40,080 --> 00:45:44,080
articles from the MongoDB site. 
I think I even saw one of your 

687
00:45:44,280 --> 00:45:46,480
videos for that. 
Yeah. 

688
00:45:46,640 --> 00:45:49,400
So it depends on which which 
embedding model you use. 

689
00:45:50,160 --> 00:45:55,440
The Open AI embedding model that
we use mostly has 1536 

690
00:45:55,840 --> 00:45:58,680
dimensions. 
So you just want to specify that

691
00:45:58,720 --> 00:46:03,880
so that so that vector search is
searching the right area 

692
00:46:03,880 --> 00:46:07,320
properly basically. 
Yeah, yeah. 

693
00:46:07,320 --> 00:46:11,600
Well, once I've done that, just 
tell the viewers that while it 

694
00:46:11,600 --> 00:46:15,000
will do, it will create an index
that will help MongoDB to search

695
00:46:15,000 --> 00:46:19,240
faster for this for these 
embeddings. 

696
00:46:19,720 --> 00:46:24,720
OK, So once we have that, we can
go on and write our extension. 

697
00:46:26,320 --> 00:46:33,640
So let's see. 
OK, So beforehand I made I made 

698
00:46:33,640 --> 00:46:37,480
an open iuts which is called 
embedded text. 

699
00:46:38,640 --> 00:46:41,560
It's super simple. 
If you don't know anything about

700
00:46:41,920 --> 00:46:48,960
embeddings just go inside. 
Let's see OK inside the open AI 

701
00:46:51,200 --> 00:46:57,040
reference and create embeddings.
I just copy pasted OK the curl 

702
00:46:57,280 --> 00:47:02,720
and created this Http://request.
I'll get back to the editor. 

703
00:47:03,800 --> 00:47:07,880
Just a POST request. 
What it does it it gets a text 

704
00:47:08,160 --> 00:47:12,320
and uses the model text 
embedding embedding 3 small and 

705
00:47:12,360 --> 00:47:14,720
it has the exact dimensions of 
our index. 

706
00:47:15,880 --> 00:47:21,240
Once it does that it passes it 
as Jason and then we pick the 

707
00:47:21,920 --> 00:47:25,800
the embedding from the Jason. 
So that's it. 

708
00:47:25,880 --> 00:47:29,360
You don't have to install 
anything to make the following 

709
00:47:29,360 --> 00:47:32,360
extension work. 
So we will create an extension, 

710
00:47:32,360 --> 00:47:39,680
we'll call it MongoDB, let's say
vector search. 

711
00:47:40,240 --> 00:47:45,680
OK, OK, so the Intellisense, we 
use a TypeScript for 

712
00:47:45,680 --> 00:47:49,120
Intellisense. 
It it says that we're actually 

713
00:47:49,120 --> 00:47:50,920
missing something. 
So let's see what we want. 

714
00:47:51,600 --> 00:47:56,920
So we have to have a few things.
One of them is info, which is 

715
00:47:56,920 --> 00:48:02,520
the name call it Mongo vector 
search. 

716
00:48:03,080 --> 00:48:08,120
OK, and it's also missing 
something that is called on a on

717
00:48:08,120 --> 00:48:12,480
a knit. 
Now every extension has an A 

718
00:48:12,920 --> 00:48:18,080
knit site phase that we need to 
implement. 

719
00:48:18,400 --> 00:48:22,200
And on a knit is simply simply 
the following thing. 

720
00:48:22,200 --> 00:48:28,240
It's something that gets 
injected with app, OK, the stock

721
00:48:28,240 --> 00:48:30,040
after app that you're currently 
using. 

722
00:48:30,440 --> 00:48:35,600
Now what we're going to do, 
we're going to put an event 

723
00:48:35,600 --> 00:48:38,920
handler. 
And So what I want to do 

724
00:48:39,160 --> 00:48:44,400
essentially is every time a 
product is absorted, it goes 

725
00:48:44,400 --> 00:48:48,680
into the the back end. 
I want to compute its embedding 

726
00:48:48,680 --> 00:48:53,640
nice and to inject it. 
OK. 

727
00:48:53,640 --> 00:48:58,240
So let's see, you have. 
Yeah, every time you add a new 

728
00:48:58,240 --> 00:49:01,000
product, it's going to take that
product's description, I would 

729
00:49:01,640 --> 00:49:04,720
imagine, and create an embedding
for that and save it back to the

730
00:49:04,720 --> 00:49:06,400
database. 
Exactly. 

731
00:49:06,880 --> 00:49:10,480
Nice. 
So every time, so the payloads, 

732
00:49:10,600 --> 00:49:16,840
the payload, I mean Top Stock of
this fully typed for events, so 

733
00:49:16,840 --> 00:49:18,440
you know exactly what you're 
getting. 

734
00:49:18,440 --> 00:49:22,480
You get the previous one, the 
current one that is born. 

735
00:49:22,480 --> 00:49:27,880
So we're actually hijacking the 
payload of the product before 

736
00:49:27,920 --> 00:49:31,520
it's being accepted to the 
database, which is a good 

737
00:49:31,520 --> 00:49:36,000
opportunity for us. 
So what I'm going to do, I will 

738
00:49:36,000 --> 00:49:43,040
call it product, OK? 
And then what we want to do is 

739
00:49:43,280 --> 00:49:48,160
we want to do something like 
embed text and then we create a 

740
00:49:48,160 --> 00:49:56,880
text. 
OK, So OK, so this product is 

741
00:49:57,160 --> 00:50:13,840
called and use the product title
has a price of let's say price 

742
00:50:14,920 --> 00:50:18,960
and description. 
And the following I will break 

743
00:50:18,960 --> 00:50:27,240
line and the following 
description and then I will 

744
00:50:27,240 --> 00:50:35,240
check the description. 
So what we want to do right now 

745
00:50:35,240 --> 00:50:37,000
we want to do the following 
thing. 

746
00:50:37,280 --> 00:50:42,680
What we want to do is this, we 
want to take the product and we 

747
00:50:42,680 --> 00:50:51,120
specified on Atlas, if you 
remember we specified that the 

748
00:50:51,160 --> 00:50:55,880
path is called embedding which 
is which is the field that it 

749
00:50:55,880 --> 00:50:57,440
will be the. 
Field that we want to, yeah, we 

750
00:50:57,440 --> 00:50:59,120
want to index on that field. 
Perfect. 

751
00:50:59,200 --> 00:51:04,120
Exactly types tricks. 
I can ignore this message. 

752
00:51:04,160 --> 00:51:08,880
OK, so this is it. 
This is all we have to do in the

753
00:51:08,880 --> 00:51:13,160
on a need stage. 
OK, well every new product will 

754
00:51:13,160 --> 00:51:16,200
be embedded and indexed by 
MongoDB. 

755
00:51:16,200 --> 00:51:20,720
And now the other thing we want 
to be able to communicate with 

756
00:51:20,720 --> 00:51:23,360
this extension to send it 
queries, right? 

757
00:51:24,840 --> 00:51:27,960
So the other thing that we need 
to implement is something that 

758
00:51:27,960 --> 00:51:32,960
is called invoke action. 
So every extension in in 

759
00:51:32,960 --> 00:51:40,680
Storecraft essentially let's 
show this, we call it action 

760
00:51:40,680 --> 00:51:43,440
handle. 
Every extensions in storecraft 

761
00:51:43,880 --> 00:51:50,800
gets mounted as an HTTP REST 
API. 

762
00:51:51,440 --> 00:51:55,600
So for example the name of this 
extension is mongo DB vector 

763
00:51:55,600 --> 00:51:59,320
search. 
So I will show how you can 

764
00:51:59,440 --> 00:52:04,720
actually using the path like API
slash extension slash mongo, DB 

765
00:52:04,720 --> 00:52:08,120
vector search slash and 
operation or action that you 

766
00:52:08,120 --> 00:52:12,160
want to invoke. 
So we'll do something like this 

767
00:52:12,160 --> 00:52:21,120
if action handle equals search. 
So actually let's bail out 

768
00:52:21,680 --> 00:52:28,080
quickly and we'll do something 
like this. 

769
00:52:28,240 --> 00:52:33,280
OK, so one interesting part. 
OK, so if we have a search, what

770
00:52:33,280 --> 00:52:37,280
we need to return is the 
following thing. 

771
00:52:38,280 --> 00:52:42,720
We need to to return a function 
that returns a promise. 

772
00:52:43,000 --> 00:52:46,360
Now the arguments are arguments 
that we're going to receive from

773
00:52:46,360 --> 00:52:51,880
the POST request. 
So it's going to be it's 

774
00:52:51,880 --> 00:52:58,160
definition is going to be like 
this OK, because I design this 

775
00:52:58,160 --> 00:53:04,160
way. 
So this this can be async 

776
00:53:05,080 --> 00:53:08,760
actually. 
OK, So what we want to do now 

777
00:53:08,760 --> 00:53:11,040
and actually is something, 
something very simple. 

778
00:53:11,040 --> 00:53:13,440
We want to actually query the 
the database. 

779
00:53:14,240 --> 00:53:20,920
Now, if you like, we look at the
at the MongoDB documentation, 

780
00:53:21,520 --> 00:53:24,240
this we have to use something 
that's called aggregations. 

781
00:53:24,720 --> 00:53:28,520
And in aggregations we have a 
vector search pipeline. 

782
00:53:29,280 --> 00:53:33,520
Yes, nice. 
So what we can do is something 

783
00:53:33,520 --> 00:53:36,440
like this. 
We have the app because of 

784
00:53:36,440 --> 00:53:39,000
JavaScript hoisting. 
We have DB which is the MongoDB.

785
00:53:39,920 --> 00:53:47,600
OK, just a second, OK, And now 
we can do something like this. 

786
00:53:47,600 --> 00:53:53,400
We can go into collection, the 
products collection, OK, and 

787
00:53:53,400 --> 00:53:57,920
aggregate OK, And then let's 
see. 

788
00:53:57,920 --> 00:54:02,160
So this was. 
Let's copy all of this. 

789
00:54:02,480 --> 00:54:03,680
There you go, Make it easy on 
yourself. 

790
00:54:05,280 --> 00:54:06,920
Make it easy on yourself to copy
paste. 

791
00:54:07,800 --> 00:54:10,960
It's a lot of typing. 
Yeah, yeah, yeah, yeah. 

792
00:54:11,400 --> 00:54:13,600
I actually have something a 
little bit ready. 

793
00:54:14,080 --> 00:54:15,880
So Oh, nice. 
Yeah, yeah, yeah, I. 

794
00:54:16,240 --> 00:54:20,120
Might put this but totally my in
my in my head. 

795
00:54:20,240 --> 00:54:22,840
I mean I. 
Now you're doing amazing. 

796
00:54:23,040 --> 00:54:26,200
That's a lot to to to code by by
memory. 

797
00:54:26,920 --> 00:54:28,520
OK, thank you. 
Good, good. 

798
00:54:29,400 --> 00:54:34,640
OK, so OK, so we have the 
aggregation also do a project to

799
00:54:34,640 --> 00:54:39,960
remove the embedding field and 
vent array, OK. 

800
00:54:40,200 --> 00:54:44,880
And what I do is is I just 
return it OK? 

801
00:54:44,960 --> 00:54:50,320
That's this is the extension. 
OK, And now I'll show how it 

802
00:54:50,320 --> 00:54:54,760
works if the viewers want to see
how quick it was. 

803
00:54:55,520 --> 00:54:58,000
Yeah, we definitely want to see 
see it working. 

804
00:54:58,520 --> 00:55:02,080
Yeah, so now I'll show you how 
it's working by the way. 

805
00:55:02,240 --> 00:55:04,960
But if I would do it, I'd 
probably make a class out of it 

806
00:55:05,080 --> 00:55:07,640
like most of the extension. 
But I just wanted to to show the

807
00:55:07,640 --> 00:55:10,760
views the inline extension 
pattern. 

808
00:55:11,560 --> 00:55:12,920
How quick and easy it can be, 
yeah. 

809
00:55:13,360 --> 00:55:17,280
Yeah. 
So OK, so let's see. 

810
00:55:19,000 --> 00:55:25,360
OK, so here we have we have a 
nice application that I've made 

811
00:55:25,480 --> 00:55:32,160
with React and Git. 
Let's try something like I'm 

812
00:55:32,160 --> 00:55:39,920
looking for Nintendo related 
console. 

813
00:55:41,240 --> 00:55:45,320
Let's see extension. 
Ah, OK, OK, OK, just a small I 

814
00:55:45,320 --> 00:55:48,800
think no problem. 
I need to to change the name 

815
00:55:48,840 --> 00:55:51,960
from this to this AH. 
No problem. 

816
00:55:52,600 --> 00:55:54,400
OK, now here. 
We go. 

817
00:55:55,680 --> 00:55:58,840
Let's see what goes. 
No, nothing. 

818
00:56:01,880 --> 00:56:04,600
It's OK, Let's see what let's 
let's do a little bit of 

819
00:56:04,600 --> 00:56:09,560
troubleshooting. 
It's probably let's. 

820
00:56:09,560 --> 00:56:16,120
Do we need to restart anything 
or let's see let's let's look at

821
00:56:16,120 --> 00:56:19,280
this code and see. 
I know, I know, I think I know 

822
00:56:19,280 --> 00:56:25,520
what the problem is. 
OK, I just copy what I've done 

823
00:56:25,600 --> 00:56:29,240
earlier. 
It's probably just could be. 

824
00:56:29,920 --> 00:56:34,800
It could be a typo, yeah. 
Let's see. 

825
00:56:38,440 --> 00:56:41,720
OK, let's. 
All right, try again. 

826
00:56:44,440 --> 00:56:49,280
Nothing. 
Let's see, let's see, let's see,

827
00:56:49,920 --> 00:56:57,280
let's see fetch, let's see the 
back end, OK. 

828
00:56:58,240 --> 00:57:01,560
Looks like we're hitting the end
the endpoint. 

829
00:57:03,800 --> 00:57:09,160
Yes, it looks good. 
Yeah, this is the of course of. 

830
00:57:09,880 --> 00:57:12,360
Course, of course, of course. 
Sorry, Sorry, sorry, sorry, 

831
00:57:12,360 --> 00:57:16,680
sorry, sorry, sorry. 
OK, so I forgot one thing. 

832
00:57:16,880 --> 00:57:18,880
One thing that is very 
important. 

833
00:57:19,400 --> 00:57:21,480
So. 
So. 

834
00:57:21,880 --> 00:57:25,320
Were the embeddings created? 
To actually be indexed, get 

835
00:57:25,320 --> 00:57:27,080
indexed. 
Oh, OK. 

836
00:57:27,960 --> 00:57:33,720
So let's save them. 
So now that we save them, the 

837
00:57:33,720 --> 00:57:38,680
event handler for the products 
upsert was invoked, was 

838
00:57:38,680 --> 00:57:42,600
triggered and now we can 
actually use our. 

839
00:57:44,120 --> 00:57:48,960
We can use this let's nice. 
Yay. 

840
00:57:49,000 --> 00:57:51,120
It works. 
Related pencil. 

841
00:57:51,120 --> 00:57:53,800
Now let's change it to related 
clothing. 

842
00:57:56,200 --> 00:57:59,840
Yeah, that's pretty quick too. 
It's nice. 

843
00:58:00,320 --> 00:58:01,840
We've got it, we've got it, 
we've got it. 

844
00:58:01,840 --> 00:58:05,880
Nice. 
And it's a React application I 

845
00:58:05,880 --> 00:58:09,240
will share the code on. 
I will make a repository for 

846
00:58:09,280 --> 00:58:14,240
this on GitHub. 
Nice benefit of of more 

847
00:58:14,480 --> 00:58:17,600
developers. 
That's amazing. 

848
00:58:18,360 --> 00:58:24,840
You know, demos don't always go 
the way that you plan, but it's 

849
00:58:24,840 --> 00:58:27,360
always, you know, usually it's, 
it's something very simple. 

850
00:58:27,360 --> 00:58:30,760
So glad we figured it out and it
really is an amazing product. 

851
00:58:31,360 --> 00:58:36,080
I've tried it out and how easy 
it is to extend it and add extra

852
00:58:36,080 --> 00:58:37,960
functionality is amazing as 
well. 

853
00:58:38,960 --> 00:58:42,720
We are right at time. 
So I wanted to remind everyone 

854
00:58:43,000 --> 00:58:46,760
to to go check out Store Craft. 
So store Craft dot app, there is

855
00:58:46,760 --> 00:58:49,400
a link in the description. 
If you're on LinkedIn, there's a

856
00:58:49,400 --> 00:58:50,760
link there. 
If you're on YouTube, there's a 

857
00:58:50,760 --> 00:58:54,000
link in the description. 
So go visit store craft dot app.

858
00:58:54,320 --> 00:58:58,000
And if you want to contribute to
the open source community, go 

859
00:58:58,000 --> 00:59:00,240
check it out on GitHub and see 
where you might be able to 

860
00:59:00,240 --> 00:59:02,800
contribute. 
And we really appreciate it. 

861
00:59:02,800 --> 00:59:05,240
So before we go somewhere again,
I want to thank you. 

862
00:59:05,240 --> 00:59:08,000
Amazing product, amazing demo, 
went very well. 

863
00:59:08,440 --> 00:59:10,440
Anything. 
Any last words to the audience? 

864
00:59:11,600 --> 00:59:15,240
Yes, there's a big road map for 
Storecraft. 

865
00:59:15,280 --> 00:59:19,480
We're not going anywhere. 
We really, I'm doubling down on 

866
00:59:19,480 --> 00:59:23,720
Storecraft because it's really a
passion for me and my son. 

867
00:59:24,520 --> 00:59:28,680
And we're going to add AI and a 
chat endpoint where you can chat

868
00:59:28,680 --> 00:59:31,480
with your store and we're 
looking for contributors. 

869
00:59:31,640 --> 00:59:34,360
Please spread the word. 
Nice. 

870
00:59:34,800 --> 00:59:38,920
That's that's that's something I
haven't thought of chatting with

871
00:59:38,920 --> 00:59:44,240
or or interacting with an 
e-commerce site through chat. 

872
00:59:44,360 --> 00:59:46,880
That's that's pretty cool. 
Yeah, that's basically what you 

873
00:59:46,880 --> 00:59:48,840
just told. 
We believe it's the future 

874
00:59:48,840 --> 00:59:54,800
because my son always says that 
he wished he had some agent that

875
00:59:54,800 --> 00:59:59,520
will speak with customers, with 
some of them, most of them. 

876
01:00:01,520 --> 01:00:04,320
That that's, that's really cool.
Looking forward to that and 

877
01:00:04,320 --> 01:00:06,640
looking forward to the road map 
and the, you know, more cool 

878
01:00:06,640 --> 01:00:10,560
things to come from store craft.
So again, Tamara, thank you for 

879
01:00:10,960 --> 01:00:14,240
for joining me and audience, 
thank you for watching and we'll

880
01:00:14,240 --> 01:00:16,840
see you again next time. 
Thank you, Jesse. 

881
01:00:17,440 --> 01:00:20,640
All right, one second.
