Skip to content

Commit aba5869

Browse files
author
FalkWolsky
committed
Updating Readme Files for API-Service and Node-Service
1 parent 5605988 commit aba5869

File tree

6 files changed

+127
-28
lines changed

6 files changed

+127
-28
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,7 @@ client/packages/lowcoder-plugin-demo/.yarn/install-state.gz
1010
client/packages/lowcoder-plugin-demo/yarn.lock
1111
client/packages/lowcoder-plugin-demo/.yarn/cache/@types-node-npm-16.18.68-56f72825c0-094ae9ed80.zip
1212
application-dev.yml
13+
server/api-service/lowcoder-server/src/main/resources/application-lowcoder.yml
14+
server/api-service/lowcoder-server/src/main/resources/application-debug.yaml
15+
.vscode/settings.json
16+
.vscode/launch.json

server/api-service/README.md

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,42 +14,65 @@ If you don't have an available MongoDB, you can start a local MongoDB service wi
1414
docker run -d --name lowcoder-mongodb -p 27017:27017 -e MONGO_INITDB_DATABASE=lowcoder mongo
1515
```
1616

17-
Configure the MongoDB connection URI in the application-lowcoder.yml
18-
<img src="../../docs/.gitbook/assets/server-setup-image1.png"/>
17+
Configure the MongoDB connection URI in the server/api-service/lowcoder-server/src/main/resources/application-lowcoder.yml
18+
1919

2020
### Redis
2121

22-
If you don't have an available MongoDB, you can start a local Redis service with docker:
22+
If you don't have an available Redis, you can start a local Redis service with docker:
2323

2424
```shell
2525
docker run -d --name lowcoder-redis -p 6379:6379 redis
2626
```
2727

28-
Configure the Redis connection URI in the application-lowcoder.yml
29-
<img src="../../docs/.gitbook/assets/server-setup-image2.png"/>
28+
Configure the Redis connection URI in the server/api-service/lowcoder-server/src/main/resources/application-lowcoder.yml
29+
30+
## Clone the Repository
31+
32+
Now you can clone the Repository from Github: https://github.com/lowcoder-org/lowcoder
33+
34+
```shell
35+
git@github.com:lowcoder-org/lowcoder.git
36+
```
37+
38+
## Unsing VS Code
39+
40+
Create a launch.json file in the .vscode folder of your new opened workspace.
41+
The contents should look like this:
42+
43+
```JSON
44+
{
45+
"version": "0.0.1",
46+
"configurations": [
47+
{
48+
"type": "java",
49+
"name": "ServerApplication",
50+
"request": "launch",
51+
"mainClass": "org.lowcoder.api.ServerApplication",
52+
"projectName": "Lowcoder API Service",
53+
"vmArgs": "-Dpf4j.mode=development -Dpf4j.pluginsDir=lowcoder-plugins -Dspring.profiles.active=lowcoder -XX:+AllowRedefinitionToAddDeleteMethods --add-opens java.base/java.nio=ALL-UNNAMED"
54+
}
55+
],
56+
}
57+
```
3058

3159
## Build and start the Lowcoder server jar
3260

3361
1. Clone Lowcoder repository
3462
2. Next, execute the following commands in sequence
3563

3664
```shell
37-
cd server
65+
cd server/api-service
3866
mvn clean package
39-
java -Dpf4j.mode=development -Dspring.profiles.active=lowcoder -Dpf4j.pluginsDir=lowcoder-plugins -jar lowcoder-server/target/lowcoder-server-1.0-SNAPSHOT.jar
67+
java -Dpf4j.mode=development -Dspring.profiles.active=lowcoder -Dpf4j.pluginsDir=lowcoder-plugins -jar lowcoder-server/target/lowcoder-api-service.jar
4068
```
4169

42-
<img src="../../docs/.gitbook/assets/server-setup-start.gif"/>
43-
Now, you can check the status of the service by visiting http://localhost:8080 through your browser. By default, you should see an HTTP 404 error.
4470

45-
<img src="../../docs/.gitbook/assets/server-setup-image3.png"/>
71+
Now, you can check the status of the service by visiting http://localhost:8080 through your browser. By default, you should see an HTTP 404 error.
4672

47-
## Start with IntelliJ IDEA
73+
## Unsing IntelliJ IDEA
4874

49-
Configure the Run/Debug configuration as shown in the screenshot below, the version used in the screenshot is IntelliJ
50-
IDEA 2021.3.2 (Community Edition):
51-
<img src="../../docs/.gitbook/assets/server-setup-image4.png"/>
52-
<img src="../../docs/.gitbook/assets/server-setup-image5.png"/>
75+
Configure the Run/Debug configuration as shown below.
5376

5477
<table>
5578
<tr>
@@ -78,3 +101,5 @@ mvn clean package
78101
```
79102

80103
After Maven package runs successfully, you can start the Lowcoder server with IntelliJ IDEA.
104+
105+
For information on how to contribute to Lowcoder, please view our [Contribution Guide](https://docs.lowcoder.cloud/lowcoder-documentation/lowcoder-extension/opensource-contribution).

server/api-service/lowcoder-server/src/main/resources/application-debug.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ spring:
22
data:
33
mongodb:
44
authentication-database: admin
5-
uri: "mongodb://lowcoder:secret123@127.0.0.1:37017/lowcoder?authSource=admin"
5+
uri: "mongodb://lowcoder:secret123@127.0.0.1:27017/lowcoder?authSource=admin"
66
redis:
7-
url: "redis://127.0.0.1:16379"
7+
url: "redis://127.0.0.1:6379"
88

99
server:
10-
port: 18080
10+
port: 8080
1111
common:
1212
cookie-name: LOWCODER_DEBUG_TOKEN
1313
js-executor:
14-
host: "http://127.0.0.1:16060"
14+
host: "http://127.0.0.1:6060"
1515
workspace:
1616
mode: SAAS
1717

server/api-service/lowcoder-server/src/main/resources/application-lowcoder.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ spring:
33
mongodb:
44
authentication-database: admin
55
auto-index-creation: false
6-
uri: mongodb://localhost:27017/lowcoder?authSource=admin
6+
uri: mongodb://localhost:27017/secret123@mongodb/lowcoder?authSource=admin
77
redis:
88
url: redis://localhost:6379
99
main:

server/api-service/lowcoder-server/src/main/resources/application.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spring:
1111
mongodb:
1212
authentication-database: admin
1313
auto-index-creation: false
14-
uri: ${LOWCODER_MONGODB_URL:mongodb://localhost:27017/lowcoder?authSource=admin}
14+
uri: ${LOWCODER_MONGODB_URL:mongodb://lowcoder:secret123@127.0.0.1:27017/lowcoder?authSource=admin}
1515
redis:
1616
url: ${LOWCODER_REDIS_URL:redis://localhost:6379}
1717
main:

server/node-service/README.md

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,87 @@
1-
# Node Service
1+
# Welcome to Lowcoder Node Service
22

3-
Write data source plugins with TypeScript.
3+
Lowcoder Node Service is a powerful tool to develop and host data source plugins using TypeScript.
44

5-
- [How to write data source plugin](#)
5+
## Getting Started
66

7-
### Develop
7+
To start developing data source plugins, follow these simple steps:
8+
9+
1. Clone the Repository
10+
11+
You can clone the Repository from Github: https://github.com/lowcoder-org/lowcoder
12+
13+
```shell
14+
git@github.com:lowcoder-org/lowcoder.git
15+
```
16+
17+
2. Navigate to the Node Service directory in the Lowcoder Repository.
818

919
```bash
10-
yarn && yarn dev
20+
cd server/node-service
1121
```
1222

13-
### Production
23+
3. Install dependencies.
24+
25+
```bash
26+
yarn install
27+
```
28+
29+
4. Start the development server.
30+
31+
```bash
32+
yarn dev
33+
```
34+
35+
## What is a Data Source Plugin?
36+
37+
A data source plugin in Lowcoder is a JavaScript Object that defines various aspects of a data source, including its basic information, configuration form, validation logic, query configurations, and execution logic.
38+
39+
### Overall Definition of a Plugin
40+
41+
Each plugin is described by an object conforming to the `DataSourcePlugin` interface. Here's a brief overview:
42+
43+
- `id`: A unique identifier for the plugin.
44+
- `name`: Display name of the plugin.
45+
- `description`: Brief description of the plugin.
46+
- `icon`: File name of the icon representing the plugin.
47+
- `category`: Category of the data source (e.g., database, API).
48+
- `dataSourceConfig`: Configuration form of the data source.
49+
- `queryConfig`: Configuration for data source queries.
50+
- `validateDataSourceConfig`: Validation logic for the data source configuration.
51+
- `run`: Execution logic for data source queries.
52+
53+
## Developing Data Source Plugins
54+
55+
To develop a data source plugin, you'll mainly focus on:
56+
57+
- **Defining the basic information** of the plugin.
58+
- **Defining the configuration form** of the data source.
59+
- **Implementing the validation logic** for the configuration.
60+
- **Defining the action list** for data source queries.
61+
- **Implementing the execution logic** for actions.
62+
63+
### All plugins reside in the directory server/node-service/src/plugins
64+
65+
For detailed information on how to develop a plugin, refer to our [detailed Guide](https://docs.lowcoder.cloud/lowcoder-documentation/lowcoder-extension/develop-data-source-plugins).
66+
67+
For information on how to contribute to Lowcoder, please view our [Contribution Guide](https://docs.lowcoder.cloud/lowcoder-documentation/lowcoder-extension/opensource-contribution).
68+
69+
70+
## Testing Your Plugin
71+
72+
Before publishing your plugin, it's crucial to test it thoroughly. Follow these steps:
73+
74+
1. Ensure your plugin is added to the plugin list in `src/plugins/index.ts`.
75+
2. Start the `node-service` server by executing `yarn dev`.
76+
3. Modify the backend configuration using the provided commands in the testing section of the guide.
77+
78+
---
79+
80+
Feel free to modify this readme according to your needs. If you have any questions or need further assistance, don't hesitate to reach out!
81+
82+
## Run the Node Service in Production
1483

1584
```bash
16-
yarn && yarn build && yarn start
85+
yarn build
86+
yarn start
1787
```

0 commit comments

Comments
 (0)