|
1
|
import React from "react" |
|
2
|
import { LearningPathType } from "../providers/LearningPath" |
|
3
|
import { Link } from "@/components" |
|
4
|
|
|
5
|
const paths: LearningPathType[] = [ |
|
6
|
{ |
|
7
|
name: "simple-quickstart", |
|
8
|
label: "Start Selling in 3 Steps", |
|
9
|
description: "Create and deploy a full-fledged ecommerce store.", |
|
10
|
steps: [ |
|
11
|
{ |
|
12
|
title: "Create a Next.js Starter Template", |
|
13
|
description: |
|
14
|
"Create a Next.js Starter Template and connect it to your Medusa backend.", |
|
15
|
path: "#", |
|
16
|
}, |
|
17
|
{ |
|
18
|
title: "Deploy the backend", |
|
19
|
path: "#", |
|
20
|
descriptionJSX: ( |
|
21
|
<> |
|
22
|
Deploy your backend to Railway. You can alternatively check out{" "} |
|
23
|
<Link href="/deployments/server">other deployment guides</Link> |
|
24
|
</> |
|
25
|
), |
|
26
|
}, |
|
27
|
{ |
|
28
|
title: "Deploy the storefront", |
|
29
|
description: "Deploy your storefront to your preferred hosting.", |
|
30
|
path: "#", |
|
31
|
}, |
|
32
|
], |
|
33
|
finish: { |
|
34
|
type: "rating", |
|
35
|
step: { |
|
36
|
title: "Congratulations on building your store!", |
|
37
|
description: "Please rate your experience using this recipe.", |
|
38
|
eventName: "rating_path_simple-quickstart", |
|
39
|
}, |
|
40
|
}, |
|
41
|
}, |
|
42
|
{ |
|
43
|
name: "marketplace", |
|
44
|
label: "Build a marketplace", |
|
45
|
description: |
|
46
|
"Customize the backend and handle events to build a marketplace.", |
|
47
|
steps: [ |
|
48
|
{ |
|
49
|
title: "Extend entities", |
|
50
|
descriptionJSX: ( |
|
51
|
<> |
|
52
|
Extend entities, such as <code>User</code> or <code>Product</code>{" "} |
|
53
|
entities, to associate them with the <code>Store</code> entity. |
|
54
|
</> |
|
55
|
), |
|
56
|
path: "/development/entities/extend-entity", |
|
57
|
}, |
|
58
|
{ |
|
59
|
title: "Access logged-in user", |
|
60
|
description: |
|
61
|
"Create a middleware that registers the logged-in user in the dependency container.", |
|
62
|
path: "/development/api-routes/example-logged-in-user", |
|
63
|
}, |
|
64
|
{ |
|
65
|
title: "Extend services", |
|
66
|
descriptionJSX: ( |
|
67
|
<> |
|
68
|
Extend services, such as <code>ProductService</code> to customize |
|
69
|
data management functionalities |
|
70
|
</> |
|
71
|
), |
|
72
|
path: "/development/services/extend-service", |
|
73
|
}, |
|
74
|
{ |
|
75
|
title: "Handle events", |
|
76
|
descriptionJSX: ( |
|
77
|
<> |
|
78
|
Listen to events like <code>order.placed</code> and handle them with |
|
79
|
subscribers |
|
80
|
</> |
|
81
|
), |
|
82
|
path: "/development/events/create-subscriber", |
|
83
|
}, |
|
84
|
{ |
|
85
|
title: "Add Payment Provider", |
|
86
|
path: "/plugins/payment", |
|
87
|
descriptionJSX: ( |
|
88
|
<> |
|
89
|
Add a payment provider to your Medusa backend. You can choose to |
|
90
|
install a plugin or{" "} |
|
91
|
<Link href="/modules/carts-and-checkout/backend/add-payment-provider"> |
|
92
|
create your own provider |
|
93
|
</Link> |
|
94
|
. |
|
95
|
</> |
|
96
|
), |
|
97
|
}, |
|
98
|
{ |
|
99
|
title: "Customize Admin", |
|
100
|
path: "/admin/widgets", |
|
101
|
descriptionJSX: ( |
|
102
|
<> |
|
103
|
As you add marketplace features to your store, you'll most |
|
104
|
likely need to customize the admin to provide an interface to manage |
|
105
|
these features. |
|
106
|
<br /> |
|
107
|
You can extend the admin plugin to add widgets,{" "} |
|
108
|
<Link href="/admin/routes">UI routes</Link>, or{" "} |
|
109
|
<Link href="/admin/setting-pages">setting pages</Link>. |
|
110
|
</> |
|
111
|
), |
|
112
|
}, |
|
113
|
{ |
|
114
|
title: "Implement Role-Based Access Control", |
|
115
|
path: "/modules/users/backend/rbac", |
|
116
|
description: |
|
117
|
"In your marketplace, you may need to implement role-based access control (RBAC) within stores. This will restrict some users' permissions to specified functionalities or API Routes.", |
|
118
|
}, |
|
119
|
{ |
|
120
|
title: "Create a storefront", |
|
121
|
path: "/starters/nextjs-medusa-starter", |
|
122
|
descriptionJSX: ( |
|
123
|
<> |
|
124
|
Build a storefront either using the Next.js Starter Template or{" "} |
|
125
|
<Link href="/storefront/roadmap">from scratch</Link>. |
|
126
|
</> |
|
127
|
), |
|
128
|
}, |
|
129
|
{ |
|
130
|
title: "Deploy the backend", |
|
131
|
path: "/deployments/server/deploying-on-railway", |
|
132
|
descriptionJSX: ( |
|
133
|
<> |
|
134
|
Deploy your backend to Railway. You can alternatively check out{" "} |
|
135
|
<Link href="/deployments/server">other deployment guides</Link> |
|
136
|
</> |
|
137
|
), |
|
138
|
}, |
|
139
|
], |
|
140
|
finish: { |
|
141
|
type: "rating", |
|
142
|
step: { |
|
143
|
title: "Congratulations on building your marketplace!", |
|
144
|
description: "Please rate your experience using this recipe.", |
|
145
|
eventName: "rating_path_marketplace", |
|
146
|
}, |
|
147
|
}, |
|
148
|
}, |
|
149
|
{ |
|
150
|
name: "subscriptions", |
|
151
|
label: "Build Subscription-based Purchases", |
|
152
|
description: |
|
153
|
"Customize the backend and handle events to implement subscriptions", |
|
154
|
steps: [ |
|
155
|
{ |
|
156
|
title: "Extend entities", |
|
157
|
path: "/development/entities/extend-entity", |
|
158
|
descriptionJSX: ( |
|
159
|
<> |
|
160
|
Extend entities, such as the <code>Order</code> entity, to associate |
|
161
|
them with the <code>Store</code> entity. You can also{" "} |
|
162
|
<Link href="/development/entities/create"> |
|
163
|
Create a custom entity |
|
164
|
</Link> |
|
165
|
. |
|
166
|
</> |
|
167
|
), |
|
168
|
}, |
|
169
|
{ |
|
170
|
title: "Handle events", |
|
171
|
descriptionJSX: ( |
|
172
|
<> |
|
173
|
Create a subscriber that listens to the <code>order.placed</code>{" "} |
|
174
|
event, or other{" "} |
|
175
|
<Link href="/development/events/events-list">events</Link>, and |
|
176
|
handles creating the subscription in Medusa. |
|
177
|
</> |
|
178
|
), |
|
179
|
path: "/development/events/create-subscriber", |
|
180
|
}, |
|
181
|
{ |
|
182
|
title: "Create a Scheduled Job", |
|
183
|
description: |
|
184
|
"Create a scheduled job that checks daily for subscriptions that needs renewal.", |
|
185
|
path: "/development/scheduled-jobs/create", |
|
186
|
}, |
|
187
|
{ |
|
188
|
title: "Customize Admin", |
|
189
|
path: "/admin/widgets", |
|
190
|
descriptionJSX: ( |
|
191
|
<> |
|
192
|
As you add subscription features to your store, you may need to |
|
193
|
customize the admin to provide an interface to manage these |
|
194
|
features. |
|
195
|
<br /> |
|
196
|
You can extend the admin plugin to add widgets,{" "} |
|
197
|
<Link href="/admin/routes">UI routes</Link>, or{" "} |
|
198
|
<Link href="/admin/setting-pages">setting pages</Link>. |
|
199
|
</> |
|
200
|
), |
|
201
|
}, |
|
202
|
{ |
|
203
|
title: "Create a storefront", |
|
204
|
path: "/starters/nextjs-medusa-starter", |
|
205
|
descriptionJSX: ( |
|
206
|
<> |
|
207
|
Build a storefront either using the Next.js Starter Template or{" "} |
|
208
|
<Link href="/storefront/roadmap">from scratch</Link>. |
|
209
|
</> |
|
210
|
), |
|
211
|
}, |
|
212
|
{ |
|
213
|
title: "Deploy the backend", |
|
214
|
path: "/deployments/server/deploying-on-railway", |
|
215
|
descriptionJSX: ( |
|
216
|
<> |
|
217
|
Deploy your backend to Railway. You can alternatively check out{" "} |
|
218
|
<Link href="/deployments/server">other deployment guides</Link> |
|
219
|
</> |
|
220
|
), |
|
221
|
}, |
|
222
|
], |
|
223
|
finish: { |
|
224
|
type: "rating", |
|
225
|
step: { |
|
226
|
title: "Congratulations on implementing subscription-based purchases!", |
|
227
|
description: "Please rate your experience using this recipe.", |
|
228
|
eventName: "rating_path_subscriptions", |
|
229
|
}, |
|
230
|
}, |
|
231
|
}, |
|
232
|
{ |
|
233
|
name: "b2b", |
|
234
|
label: "Build a B2B store", |
|
235
|
description: |
|
236
|
"Utilize Medusa's features and customization capabilities to build a B2B store.", |
|
237
|
steps: [ |
|
238
|
{ |
|
239
|
title: "Create a B2B Sales Channel", |
|
240
|
path: "/user-guide/sales-channels/manage", |
|
241
|
descriptionJSX: ( |
|
242
|
<> |
|
243
|
You can create a B2B sales channel that will include only your |
|
244
|
wholesale products. |
|
245
|
<br /> |
|
246
|
You can either use the Medusa admin, or the{" "} |
|
247
|
<Link href="/modules/sales-channels/admin/manage"> |
|
248
|
Admin REST APIs |
|
249
|
</Link> |
|
250
|
. |
|
251
|
</> |
|
252
|
), |
|
253
|
}, |
|
254
|
{ |
|
255
|
title: "Create a Publishable API Key", |
|
256
|
path: "/user-guide/settings/publishable-api-keys", |
|
257
|
descriptionJSX: ( |
|
258
|
<> |
|
259
|
Publishable API keys can be associated with one or more sales |
|
260
|
channels. You can then use the publishable API key in your |
|
261
|
storefront or client. |
|
262
|
<br /> |
|
263
|
You can either use the Medusa admin, or the{" "} |
|
264
|
<Link href="/development/publishable-api-keys/admin/manage-publishable-api-keys"> |
|
265
|
Admin REST APIs |
|
266
|
</Link> |
|
267
|
. |
|
268
|
</> |
|
269
|
), |
|
270
|
}, |
|
271
|
{ |
|
272
|
title: "Add Wholesale Products", |
|
273
|
path: "/user-guide/products/manage", |
|
274
|
descriptionJSX: ( |
|
275
|
<> |
|
276
|
You can add your wholesale products and make them only available in |
|
277
|
the B2B sales channel. |
|
278
|
<br /> |
|
279
|
You can use the Medusa admin to add the products. Other alternatives |
|
280
|
are: |
|
281
|
<ul> |
|
282
|
<li> |
|
283
|
<Link href="/modules/products/admin/manage-products"> |
|
284
|
Add Products Using REST APIs |
|
285
|
</Link> |
|
286
|
</li> |
|
287
|
<li> |
|
288
|
<Link href="/user-guide/products/import"> |
|
289
|
Import Products Using Medusa Admin |
|
290
|
</Link> |
|
291
|
</li> |
|
292
|
<li> |
|
293
|
<Link href="/modules/products/admin/import-products"> |
|
294
|
Import Products Using REST APIs |
|
295
|
</Link> |
|
296
|
</li> |
|
297
|
</ul> |
|
298
|
</> |
|
299
|
), |
|
300
|
}, |
|
301
|
{ |
|
302
|
title: "Create a B2B Customer Group", |
|
303
|
path: "/user-guide/customers/groups", |
|
304
|
descriptionJSX: ( |
|
305
|
<> |
|
306
|
Customer groups can be used to apply different prices for different |
|
307
|
subsets of customers, in this case B2B customers. |
|
308
|
<br /> |
|
309
|
You can either use the Medusa admin, or the{" "} |
|
310
|
<Link href="/modules/customers/admin/manage-customer-groups"> |
|
311
|
Admin REST APIs |
|
312
|
</Link> |
|
313
|
. |
|
314
|
</> |
|
315
|
), |
|
316
|
}, |
|
317
|
{ |
|
318
|
title: "Add B2B Customers", |
|
319
|
path: "/user-guide/customers/manage", |
|
320
|
descriptionJSX: ( |
|
321
|
<> |
|
322
|
You can now add B2B customers and assign them to the B2B customer |
|
323
|
group. Alternatively, if you want to allow B2B customers to register |
|
324
|
themselves, you can implement that logic within your storefront. |
|
325
|
<br /> |
|
326
|
You can either use the Medusa admin, or the{" "} |
|
327
|
<Link href="/modules/customers/admin/manage-customers"> |
|
328
|
Admin REST APIs |
|
329
|
</Link> |
|
330
|
. |
|
331
|
</> |
|
332
|
), |
|
333
|
}, |
|
334
|
{ |
|
335
|
title: "Create B2B Price Lists", |
|
336
|
path: "/user-guide/price-lists/manage", |
|
337
|
descriptionJSX: ( |
|
338
|
<> |
|
339
|
A price list allows you to set different prices on a set of products |
|
340
|
for different conditions. You can use this when building a B2B store |
|
341
|
to assign different prices for B2B customer groups. |
|
342
|
<br /> |
|
343
|
You can use the Medusa admin to add the price list. Other |
|
344
|
alternatives are: |
|
345
|
<ul> |
|
346
|
<li> |
|
347
|
<Link href="/modules/price-lists/admin/manage-price-lists"> |
|
348
|
Add Price List Using REST APIs |
|
349
|
</Link> |
|
350
|
</li> |
|
351
|
<li> |
|
352
|
<Link href="/user-guide/price-lists/import"> |
|
353
|
Import Prices Using Medusa Admin |
|
354
|
</Link> |
|
355
|
</li> |
|
356
|
<li> |
|
357
|
<Link href="/modules/price-lists/admin/import-prices"> |
|
358
|
Import Prices Using REST APIs |
|
359
|
</Link> |
|
360
|
</li> |
|
361
|
</ul> |
|
362
|
</> |
|
363
|
), |
|
364
|
}, |
|
365
|
{ |
|
366
|
title: "Create Custom Entities", |
|
367
|
path: "/development/entities/create", |
|
368
|
descriptionJSX: ( |
|
369
|
<> |
|
370
|
Your use case may be more elaborate than what is shown in this |
|
371
|
recipe. |
|
372
|
<br /> |
|
373
|
Medusa can be customized to add custom entities, API Routes, |
|
374
|
services, and more. |
|
375
|
<br /> |
|
376
|
You can find additional development resources in the{" "} |
|
377
|
<Link href="/development/overview">Medusa development section</Link> |
|
378
|
. |
|
379
|
</> |
|
380
|
), |
|
381
|
}, |
|
382
|
{ |
|
383
|
title: "Create an API Route to Check Customers", |
|
384
|
path: "/development/entities/create", |
|
385
|
descriptionJSX: ( |
|
386
|
<> |
|
387
|
On the clients communicating with your store, such as the |
|
388
|
storefront, you’ll need to check if the currently logged-in customer |
|
389
|
is a normal customer or a B2B customer. |
|
390
|
<br /> |
|
391
|
To do that, you need to create a custom API Route that handles the |
|
392
|
checking based on the custom logic you've chosen to indicate a |
|
393
|
customer is a B2B customer. |
|
394
|
</> |
|
395
|
), |
|
396
|
}, |
|
397
|
{ |
|
398
|
title: "Customize Admin", |
|
399
|
path: "/admin/widgets", |
|
400
|
descriptionJSX: ( |
|
401
|
<> |
|
402
|
As you add B2B features to your store, you may need to customize the |
|
403
|
admin to provide an interface to manage these features. |
|
404
|
<br /> |
|
405
|
You can extend the admin plugin to add widgets,{" "} |
|
406
|
<Link href="/admin/routes">UI routes</Link>, or{" "} |
|
407
|
<Link href="/admin/setting-pages">setting pages</Link>. |
|
408
|
</> |
|
409
|
), |
|
410
|
}, |
|
411
|
{ |
|
412
|
title: "Customize Storefront", |
|
413
|
path: "/starters/nextjs-medusa-starter", |
|
414
|
descriptionJSX: ( |
|
415
|
<> |
|
416
|
You may need to customize your storefront to add different |
|
417
|
interfaces for B2B and regular customers, or show products |
|
418
|
differently. |
|
419
|
<br /> |
|
420
|
You can customize the Next.js storefront, or you can{" "} |
|
421
|
<Link href="/storefront/roadmap">build a custom storefront</Link>. |
|
422
|
<br /> |
|
423
|
In your storefront, make sure to{" "} |
|
424
|
<Link href="/development/publishable-api-keys/storefront/use-in-requests"> |
|
425
|
use publishable API keys |
|
426
|
</Link>{" "} |
|
427
|
in your requests. |
|
428
|
</> |
|
429
|
), |
|
430
|
}, |
|
431
|
{ |
|
432
|
title: "Deploy the B2B store", |
|
433
|
path: "/deployments/server", |
|
434
|
descriptionJSX: ( |
|
435
|
<> |
|
436
|
Once you finish your development, you can deploy your B2B backend to |
|
437
|
your preferred hosting provider. You can also{" "} |
|
438
|
<Link href="/deployments/storefront">deploy your storefront</Link>{" "} |
|
439
|
to your preferred hosting provider. |
|
440
|
</> |
|
441
|
), |
|
442
|
}, |
|
443
|
], |
|
444
|
finish: { |
|
445
|
type: "rating", |
|
446
|
step: { |
|
447
|
title: "Congratulations on building a B2B store!", |
|
448
|
description: "Please rate your experience using this recipe.", |
|
449
|
eventName: "rating_path_b2b", |
|
450
|
}, |
|
451
|
}, |
|
452
|
}, |
|
453
|
{ |
|
454
|
name: "integrate-ecommerce-stack", |
|
455
|
label: "Integrate Ecommerce Stack", |
|
456
|
description: |
|
457
|
"Use Medusa’s architecture and functionalities to integrate third-party systems and build flows around them.", |
|
458
|
steps: [ |
|
459
|
{ |
|
460
|
title: "Connect to External Systems with Services", |
|
461
|
path: "/development/services/create-service", |
|
462
|
descriptionJSX: ( |
|
463
|
<> |
|
464
|
Medusa’s Services let you implement a client that connects and |
|
465
|
performs functionalities with your third-party system. |
|
466
|
<br /> |
|
467
|
<br /> |
|
468
|
You can then use the service to connect to your third-party system |
|
469
|
in other resources, such as a Workflow or an API Route. |
|
470
|
</> |
|
471
|
), |
|
472
|
}, |
|
473
|
{ |
|
474
|
title: "Build Flows Across Systems", |
|
475
|
path: "/development/workflows", |
|
476
|
descriptionJSX: ( |
|
477
|
<> |
|
478
|
With Medusa’s workflows, you can build flows with steps that may |
|
479
|
perform actions on different systems. Workflows can be executed from |
|
480
|
anywhere. |
|
481
|
<br /> |
|
482
|
<br /> |
|
483
|
For example, you can create a workflow that updates the product’s |
|
484
|
details in integrated systems like ERPs, WMSs, and CMSs. Then, you |
|
485
|
can listen to the |
|
486
|
<code>product.updated</code> event using a{" "} |
|
487
|
<Link href="/development/events/create-subscriber">Subscriber</Link>{" "} |
|
488
|
and execute the workflow whenever the event is triggered. |
|
489
|
</> |
|
490
|
), |
|
491
|
}, |
|
492
|
{ |
|
493
|
title: "Create Webhook Listeners", |
|
494
|
path: "/development/api-routes/create", |
|
495
|
descriptionJSX: ( |
|
496
|
<> |
|
497
|
You can provide webhook listeners that your external systems call |
|
498
|
when their data is updated. This lets you synchronize data between |
|
499
|
your systems. |
|
500
|
<br /> |
|
501
|
<br /> |
|
502
|
Webhook listeners can be created in Medusa using API Routes. |
|
503
|
</> |
|
504
|
), |
|
505
|
}, |
|
506
|
], |
|
507
|
finish: { |
|
508
|
type: "rating", |
|
509
|
step: { |
|
510
|
title: "Congratulations on integrating your ecommerce stack!", |
|
511
|
description: "Please rate your experience using this recipe.", |
|
512
|
eventName: "rating_path_integrate-ecommerce-stack", |
|
513
|
}, |
|
514
|
}, |
|
515
|
}, |
|
516
|
] |
|
517
|
|
|
518
|
// get a shallow copy |
|
519
|
export const getLearningPaths = () => [...paths] |
|
520
|
|
|
521
|
export const getLearningPath = ( |
|
522
|
pathName: string |
|
523
|
): LearningPathType | undefined => paths.find((path) => path.name === pathName) |