Skip to content

Commit 045bccc

Browse files
authored
Fixes on App documentation + example of CRM backoffice on landing (windmill-labs#154)
1 parent 5e47fec commit 045bccc

File tree

3 files changed

+41
-30
lines changed

3 files changed

+41
-30
lines changed

docs/apps/7_app_e-commerce.md

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# E-commerce CRM app
1+
# Example: E-commerce CRM app
22

33
We will now use the Windmill app builder to build a simple E-commerce backoffice app. It is a simple CRM app that allows you to manage your products, customers and orders of a e-commerce store.
44

@@ -11,20 +11,28 @@ We will now use the Windmill app builder to build a simple E-commerce backoffice
1111
src="/videos/app-ecomm-demo.mp4"
1212
/>
1313

14+
<br/>
15+
1416
It showcases a variety of features that are available in the Windmill app builder, such as:
1517

16-
- [Runnables](/docs/apps/app-runnable/)
17-
- [Components](/docs/apps/app_component_library/)Components Library
18+
- [Runnables](/docs/apps/app-runnable/): scripts or flows that are executed on demand.
19+
- [Components](/docs/apps/app_component_library/): pre-built, reusable building blocks that encapsulate specific functionalities or design elements.
20+
21+
:::tip
22+
23+
This app is available on the [Hub](https://hub.windmill.dev/apps/14/) and can be used on our [Demo workspace](https://app.windmill.dev/user/login) with the proper Supabase integration.
24+
25+
:::
1826

1927
## Features
2028

21-
We use Supabase as a backend for this app. It is a great alternative to Firebase and it is free to use. It is a great way to get started with building your app. You can read more about Supabase [here](https://supabase.io/). Windmill has a [Supabase integration](/docs/integrations/supabase/) on the HUB that allows you to easily connect your app to Supabase, and integrate it with your app.
29+
We use [Supabase](https://supabase.com/) as a backend for this app. It is a great alternative to Firebase and it is free to use. It is a great way to get started with building your app. You can read more about Supabase [here](https://supabase.com/docs). Windmill has a [Supabase integration](/docs/integrations/supabase/) on the [Hub](https://hub.windmill.dev/) that allows you to easily connect your app to Supabase, and integrate it with your app.
2230

2331
We will use the following scripts from the Hub:
2432

25-
- [Fetch data from Supabase](https://hub.windmill.dev/scripts/supabase/1512/fetch-data-supabase)
26-
- [Create a new record in Supabase](https://hub.windmill.dev/scripts/supabase/1513/insert-data-supabase)
27-
- [Update a record in Supabase](https://hub.windmill.dev/scripts/supabase/1514/update-data-supabase)
33+
- [Fetch data from Supabase](https://hub.windmill.dev/scripts/supabase/1512/fetch-data-supabase).
34+
- [Create a new record in Supabase](https://hub.windmill.dev/scripts/supabase/1513/insert-data-supabase).
35+
- [Update a record in Supabase](https://hub.windmill.dev/scripts/supabase/1514/update-data-supabase).
2836

2937
We will structure the app as follows:
3038

@@ -53,7 +61,7 @@ We will structure the app as follows:
5361

5462
### Products Tab
5563

56-
We will split the product view into two parts, with the vertical split. The left part will be a list of products, and the right part will be a form to edit the currently selected product.
64+
We will split the product view into two parts, with the [vertical split](../apps/4_app_component_library.md#vertical-split-panes). The left part will be a list of products, and the right part will be a form to edit the currently selected product.
5765

5866
<video
5967
className="border-2 rounded-xl object-cover w-full h-full"
@@ -75,11 +83,11 @@ A product has the folowing fields:
7583
- **price** - the price of the product
7684
- **quantity** - the quantity of the product
7785

78-
First we need to configure the data source for the Table component. We will pick the "Fetch data (supabase)" script, available in the hub.
86+
First we need to configure the data source for the Table component. We will pick the [Fetch data (supabase)](https://hub.windmill.dev/scripts/supabase/1512/fetch-data-supabase) script, available in the Hub.
7987

8088
This script has multilpe input, but we only need to specify the table name and the auth token.
8189

82-
Normally the component has now thrown an error: The Table component is expecting an array but got an object. This is because the script returns an object with the data in the `data` field. We can use a transformer to fix this.
90+
Normally the component has now thrown an error: The Table component is expecting an array but got an object. This is because the script returns an object with the data in the `data` field. We can use a **transformer** to fix this.
8391

8492
```js
8593
return result.data;
@@ -108,6 +116,8 @@ Now we can add the form to the right side of the split. We will use Text and inp
108116
src="/videos/app-builder-ecomm-step2.mp4"
109117
/>
110118
119+
<br/>
120+
111121
One powerful feature of Windmill is the ability to connect an output of one component to the input of another component. This allows us to connect the default value of an input to a value of the selected row of the table.
112122
113123
Now we need to add a button that will save the changes to the product. For the sake of demonstration, we will write our own script to update the product.
@@ -162,6 +172,8 @@ but we will use a different transformer to remove the fields that we don't need.
162172
src="/videos/app-builder-ecomm-step4.mp4"
163173
/>
164174
175+
<br/>
176+
165177
Like the products, we need to add a transformer to the Table component to remove the fields that we don't need.
166178
167179
```js
@@ -316,7 +328,7 @@ export async function main(users: any[]) {
316328
317329
#### Product selection
318330
319-
We will use a table to display the list of products. This is the same list of products that we used in the products tab. But we need to add a table action to the products table to add the selected product to the cart
331+
We will use a table to display the list of products. This is the same list of products that we used in the products tab. But we need to add a table action to the products table to add the selected product to the cart.
320332
321333
We can now use the concept of frontent script. Frontend scripts are scripts that are executed in the browser. We can use frontend scripts to interact with the local state of the app. Given that the id of the table is `ao`:
322334

docs/integrations/supabase.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ You'll find the URL and 2 keys here.
2121

2222
As the description says, the access level of the `public` key will be controlled
2323
by the policies you add and the `secret` key will bypass all of them. You can
24-
safely use the `secret` key in Windmill because it'll never be sent to users
24+
safely use the `service_rolesecret` `secret` key in Windmill because it'll never be sent to users
2525
directly.
2626

2727
## Create a resource

src/landing/AppSection.jsx

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,10 @@ const tabs = [
9898

9999
const examples = [
100100
{
101-
name: <span>Issue tracker</span>,
101+
name: <span>E-Commerce Back-Office</span>,
102102
description: (
103103
<>
104-
Create an Issue Tracker App with{' '}
104+
Build a comprehensive CRM to monitor your products, customers and orders data hosted on {' '}
105105
<a
106106
href="https://hub.windmill.dev/integrations/supabase"
107107
target="_blank"
@@ -111,49 +111,48 @@ const examples = [
111111
Supabase
112112
</mark>
113113
</a>{' '}
114-
in 15 Minutes
114+
.
115115
</>
116116
),
117-
href: 'https://hub.windmill.dev/apps/7/issue-tracker'
117+
href: 'https://docs.windmill.dev/docs/apps/app_e-commerce'
118118
},
119119
{
120-
name: <span>Admin CRM</span>,
120+
name: <span>MongoDB Admin</span>,
121121
description: (
122122
<>
123-
See all of your customers, statistics and send e-mails using Admin panel for the sample
124-
Customers dataset of{' '}
123+
Admin panel for the sample Customers dataset of{' '}
125124
<a
126-
href="https://hub.windmill.dev/integrations/gmail"
125+
href="https://hub.windmill.dev/integrations/mongodb"
127126
target="_blank"
128127
className="!no-underline"
129128
>
130129
<mark className="leading-none bg-red-100 hover:bg-red-200 px-2 rounded whitespace-nowrap text-red-800 font-semibold">
131-
Gmail
130+
MongoDB
132131
</mark>
133132
</a>{' '}
134-
directly from the app
133+
Cloud
135134
</>
136135
),
137-
href: 'https://hub.windmill.dev/apps/3/crm'
136+
href: 'https://hub.windmill.dev/apps/5/mongodb-admin'
138137
},
139138
{
140-
name: <span>MongoDB Admin</span>,
139+
name: <span>Issue tracker</span>,
141140
description: (
142141
<>
143-
Admin panel for the sample Customers dataset of{' '}
142+
Create an Issue Tracker App with{' '}
144143
<a
145-
href="https://hub.windmill.dev/integrations/mongodb"
144+
href="https://hub.windmill.dev/integrations/supabase"
146145
target="_blank"
147146
className="!no-underline"
148147
>
149-
<mark className="leading-none bg-green-100 hover:bg-green-200 px-2 rounded whitespace-nowrap text-green-800 font-semibold">
150-
MongoDB
148+
<mark className="leading-none bg-green-100 text-green-600 px-2 rounded font-semibold whitespace-nowrap">
149+
Supabase
151150
</mark>
152151
</a>{' '}
153-
Cloud
152+
in 15 Minutes
154153
</>
155154
),
156-
href: 'https://hub.windmill.dev/apps/5/mongodb-admin'
155+
href: 'https://hub.windmill.dev/apps/7/issue-tracker'
157156
}
158157
];
159158

0 commit comments

Comments
 (0)