Skip to content

Commit 9a12a83

Browse files
Openblocks-docsgitbook-bot
Openblocks-docs
authored andcommitted
GitBook: [lowcoder-org#97] add doc: Heroku
1 parent 535d639 commit 9a12a83

25 files changed

+133
-13
lines changed

docs/.gitbook/assets/heroku-1.png

102 KB
Loading

docs/.gitbook/assets/heroku-10.png

127 KB
Loading

docs/.gitbook/assets/heroku-11.png

101 KB
Loading

docs/.gitbook/assets/heroku-2.png

181 KB
Loading

docs/.gitbook/assets/heroku-3.png

59.9 KB
Loading

docs/.gitbook/assets/heroku-4.png

49.4 KB
Loading

docs/.gitbook/assets/heroku-5.png

2.08 MB
Loading

docs/.gitbook/assets/heroku-6.png

190 KB
Loading

docs/.gitbook/assets/heroku-7.png

106 KB
Loading

docs/.gitbook/assets/heroku-8.png

147 KB
Loading

docs/.gitbook/assets/heroku-9.png

95.6 KB
Loading

docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
* [Access local database or API](self-hosting/access-local-database-or-api.md)
66
* [DigitalOcean](self-hosting/digitalocean.md)
77
* [AWS AMI](self-hosting/aws-ami.md)
8+
* [Heroku](self-hosting/heroku.md)
89
* [Security](security.md)
910

1011
## Data sources

docs/build-apps/event-handlers.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
In Openblocks, event handlers are responsible for collecting and processing events from components and queries, and executing subsequent actions. For example, for a **Button** component, you can add an event handler to trigger the **Run query** action **** in response to the button **Click** event.
44

5-
<figure><img src="../.gitbook/assets/image (8) (1).png" alt=""><figcaption></figcaption></figure>
5+
<figure><img src="../.gitbook/assets/image (19).png" alt=""><figcaption></figcaption></figure>
66

77
Set event handlers wisely to provide a reactive and responsive user experience (UX). For example, triggering a **get-all** query after **insert-new-data** query finishes enables table automatically refresh.
88

@@ -32,7 +32,7 @@ Running a query can result in success or failure, so queries have two events: **
3232

3333
There are a number of event handler actions available in Openblocks for handling different scenarios. Set them in the **Action** dropdown list in an event handler.
3434

35-
![](<../.gitbook/assets/image (9) (1).png>)
35+
![](<../.gitbook/assets/image (1) (1).png>)
3636

3737
{% hint style="info" %}
3838
See [advanced](event-handlers.md#advanced) on this page to know advanced settings.
@@ -48,7 +48,7 @@ Trigger the selected query.
4848

4949
To control a component, select a component in the **Component** dropdown list and call one of its methods in the **Method** dropdown list.
5050

51-
![](<../.gitbook/assets/image (29).png>)
51+
![](<../.gitbook/assets/image (17).png>)
5252

5353
### Set temporary state
5454

docs/build-apps/module.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ When building an app, you want to reuse components and queries across different
44

55
<figure><img src="../.gitbook/assets/module-1.png" alt=""><figcaption><p>Build a <a href="module.md#demo-a-statistics-module">statistics module</a></p></figcaption></figure>
66

7-
<figure><img src="../.gitbook/assets/module-2 (1).png" alt=""><figcaption><p>Reuse this module anywhere</p></figcaption></figure>
7+
<figure><img src="../.gitbook/assets/module-2.png" alt=""><figcaption><p>Reuse this module anywhere</p></figcaption></figure>
88

99
## Module basics
1010

@@ -67,7 +67,7 @@ Module inputs are parameters passed to the module from external apps. The suppor
6767

6868
This section guides you through the steps to build a statistics module and reuse it in an app. &#x20;
6969

70-
<figure><img src="../.gitbook/assets/module-2 (1).png" alt=""><figcaption></figcaption></figure>
70+
<figure><img src="../.gitbook/assets/module-2.png" alt=""><figcaption></figcaption></figure>
7171

7272
1. Create module inputs:
7373

@@ -86,7 +86,7 @@ This section guides you through the steps to build a statistics module and reuse
8686
<figure><img src="../.gitbook/assets/module-17.png" alt=""><figcaption></figcaption></figure>
8787
5. Reuse the module multiple times by passing different input values.&#x20;
8888

89-
<figure><img src="../.gitbook/assets/module-2 (1).png" alt=""><figcaption></figcaption></figure>
89+
<figure><img src="../.gitbook/assets/module-2.png" alt=""><figcaption></figcaption></figure>
9090

9191
#### Input Test
9292

docs/build-apps/use-third-party-libraries.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,19 @@ https://unpkg.com/cowsay@1.5.0/build/cowsay.umd.js
7070

7171
Navigate to the left sidebar, click <img src="../.gitbook/assets/image (1).png" alt="" data-size="line"> > **Other** > **Scripts and style** > **Add a library**. Then paste the **cowsay** link here.
7272

73-
<figure><img src="../.gitbook/assets/Add a library (1) (1) (1) (2).png" alt=""><figcaption></figcaption></figure>
73+
<figure><img src="../.gitbook/assets/Add a library (1) (1) (1) (1).png" alt=""><figcaption></figcaption></figure>
7474

7575
Now you can write code in **JS query** to test its usage with `cowsay.say`:
7676

77-
<figure><img src="../.gitbook/assets/write code in JS query (1) (1) (1).png" alt=""><figcaption></figcaption></figure>
77+
<figure><img src="../.gitbook/assets/write code in JS query (1) (1) (1) (1) (1).png" alt=""><figcaption></figcaption></figure>
7878

7979
or in component **Properties**:
8080

81-
<figure><img src="../.gitbook/assets/or in Properties (1) (1) (1) (2).png" alt=""><figcaption></figcaption></figure>
81+
<figure><img src="../.gitbook/assets/or in Properties (1) (1) (1) (1).png" alt=""><figcaption></figcaption></figure>
8282

8383
And since you have set up cowsay just for **Openblocks's new application 1,** you can not use cowsay in another app.
8484

85-
<figure><img src="../.gitbook/assets/in another app (1) (1) (1).png" alt=""><figcaption></figcaption></figure>
85+
<figure><img src="../.gitbook/assets/in another app (1) (1) (1) (1) (1).png" alt=""><figcaption></figcaption></figure>
8686

8787
### Import on Workspace-level
8888

docs/data-sources/connect-to-databases/google-sheets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Navigate back to to [Google Sheets](https://docs.google.com/spreadsheets), and f
3737
1. Open the JSON file of the key.
3838
2. Copy the value of `client_email`, which is an identity used for access management of your sheet.
3939

40-
<figure><img src="../../.gitbook/assets/Google-sheets-key-client-email.jpeg" alt=""><figcaption></figcaption></figure>
40+
<figure><img src="../../.gitbook/assets/Google-sheets-key-client-email (1).jpeg" alt=""><figcaption></figcaption></figure>
4141
3. Click **Share** at the top right and paste the copied `client_email` value to add a member with access.
4242

4343
<figure><img src="../../.gitbook/assets/Google-sheets-share.jpg" alt=""><figcaption></figcaption></figure>

docs/data-sources/data-source-basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Follow the steps below:
1515
1. Click **Data Sources** on Openblocks homepage.
1616
2. Click **New data source** on the upper right. This permission is restricted to workspace admins and developers.
1717

18-
<figure><img src="../.gitbook/assets/image (31) (1).png" alt=""><figcaption></figcaption></figure>
18+
<figure><img src="../.gitbook/assets/image (12) (1).png" alt=""><figcaption></figcaption></figure>
1919
3. Select the database or API type you need to connect.&#x20;
2020

2121
<figure><img src="../.gitbook/assets/data source basics-2.png" alt=""><figcaption></figcaption></figure>

docs/queries/query-basics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Queries support you to read data from or write data to your data sources. You ca
66

77
You can connect to a data source that was already in your data source library or create a new one. For detailed information, see [data-source-basics.md](../data-sources/data-source-basics.md "mention").
88

9-
<figure><img src="../.gitbook/assets/image (12) (1).png" alt=""><figcaption></figcaption></figure>
9+
<figure><img src="../.gitbook/assets/image (31) (1).png" alt=""><figcaption></figcaption></figure>
1010

1111
## Create a query
1212

docs/self-hosting/heroku.md

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
---
2+
description: Self-host Openblocks on Heroku quickly with one-click deployment.
3+
---
4+
5+
# Heroku
6+
7+
## Deploy
8+
9+
1. [Sign up](https://signup.heroku.com/) for a new Heroku account, or [log in](https://id.heroku.com/login) to get started.
10+
2. Click to start Heroku [one-click deployment](https://heroku.com/deploy?template=https://github.com/openblocks-dev/openblocks).
11+
3. Set the **App name** which will be part of the app URL later, and choose a region.
12+
13+
<figure><img src="../.gitbook/assets/heroku-1.png" alt=""><figcaption></figcaption></figure>
14+
4. (Not required) Fill in the **Config Vars** according to descriptions. These are all optional variables used for environment-specific configuration. You can skip this step and [manage environment variables](heroku.md#manage-environment-variables) later.
15+
16+
<figure><img src="../.gitbook/assets/heroku-2.png" alt=""><figcaption></figcaption></figure>
17+
5. Click the **Deploy app** button.
18+
19+
It usually takes around three minutes to start the app.
20+
21+
<figure><img src="../.gitbook/assets/heroku-3.png" alt=""><figcaption></figcaption></figure>
22+
23+
Click the **View** button to open the new app, which should be available at **https://your\_app\_name.herokuapp.com/**.
24+
25+
<figure><img src="../.gitbook/assets/heroku-4.png" alt=""><figcaption></figcaption></figure>
26+
27+
In the welcome page, Click **Sign up** to get started. Openblocks will automatically create a workspace for you. Then you can start building your apps and invite members to your workspace.
28+
29+
<figure><img src="../.gitbook/assets/heroku-5.png" alt=""><figcaption></figcaption></figure>
30+
31+
## Configure app settings
32+
33+
On [Heroku Dashboard](https://dashboard.heroku.com/apps), go to the **Settings** tab at the top to configure app settings.
34+
35+
<figure><img src="../.gitbook/assets/heroku-6.png" alt=""><figcaption></figcaption></figure>
36+
37+
### Manage environment variables
38+
39+
You can manage environment variables of your app in the **Config Vars** section.
40+
41+
<figure><img src="../.gitbook/assets/heroku-7.png" alt=""><figcaption></figcaption></figure>
42+
43+
{% hint style="info" %}
44+
For more help, see [Managing config vars](https://devcenter.heroku.com/articles/config-vars#managing-config-vars).
45+
{% endhint %}
46+
47+
### Install SSL Certificates
48+
49+
You can configure SSL Certificates of your app in the **SSL Certificates** section. Heroku provides [Automated Certificate Management (ACM)](https://devcenter.heroku.com/articles/automated-certificate-management) and [Manual Certificate](https://devcenter.heroku.com/articles/ssl#manually-uploading-certificates-and-intermediaries) options.
50+
51+
<figure><img src="../.gitbook/assets/heroku-8.png" alt=""><figcaption></figcaption></figure>
52+
53+
Choose **Manual Certificate**, and you can install your SSL Certificates. Public certificate file usually ends in `.pem` or `.crt`.\
54+
![](../.gitbook/assets/heroku-9.png)
55+
56+
### Customize domain names
57+
58+
1. Click the **Add domain** button in the **Domains** section.
59+
60+
<figure><img src="../.gitbook/assets/heroku-10.png" alt=""><figcaption></figcaption></figure>
61+
2. Fill in your **Domain name** and click **Next**.\
62+
![](../.gitbook/assets/heroku-11.png)
63+
3. Copy and paste the **DNS Target** provided by Heroku to complete the domain setup.
64+
65+
{% hint style="info" %}
66+
For more help, see [Custom Domain Names for Apps](https://devcenter.heroku.com/articles/custom-domains).
67+
{% endhint %}
68+
69+
## Update using Heroku CLI
70+
71+
You can use [Heroku CLI](https://devcenter.heroku.com/categories/command-line) to update your Docker image to the latest version. The basic logic behind the following steps is to pull the newest code from GitHub repository, build an image locally using Docker engine, and deploy the updated image using Heroku CLI. Before you start, make sure you have [Heroku CLI](https://devcenter.heroku.com/categories/command-line) and [Docker](https://www.docker.com/) installations locally(required).
72+
73+
1\. Get the latest code by cloning the `openblocks-dev/openblocks` repository from GitHub.
74+
75+
```bash
76+
git clone https://github.com/openblocks-dev/openblocks.git
77+
```
78+
79+
2\. Move to the `heroku` folder.
80+
81+
```bash
82+
cd openblocks/deploy/heroku
83+
```
84+
85+
3\. Log in to Heroku CLI.
86+
87+
```bash
88+
heroku login
89+
```
90+
91+
4\. Make sure you have a Docker engine running locally. Then log in to Container Registry.
92+
93+
```bash
94+
heroku container:login
95+
```
96+
97+
5\. Get the app name of your Heroku account.
98+
99+
```bash
100+
heroku apps
101+
```
102+
103+
6\. Build the image and push it to Container Registry.
104+
105+
```bash
106+
heroku container:push web -a your_app_name
107+
```
108+
109+
7\. Release the image to your app.
110+
111+
```bash
112+
heroku container:release web -a your_app_name
113+
```
114+
115+
It might take a few minutes to build the new image and push it to Heroku. Then you can open the app in your browser to check if it is running.
116+
117+
```bash
118+
heroku open -a your_app_name
119+
```

0 commit comments

Comments
 (0)