From 65eb9d7147a30472bb0b2845824bedb37e0016c9 Mon Sep 17 00:00:00 2001 From: dev-callgent Date: Thu, 7 Nov 2024 14:15:14 +0800 Subject: [PATCH] feat: quick-start build web app Signed-off-by: dev-callgent --- .husky/prepare-commit-msg | 8 ++- docs/quick-start/build-web-app.mdx | 59 ++++++++++++++++ docs/quick-start/call-the-callgent.mdx | 93 ++++++++++++++------------ 3 files changed, 113 insertions(+), 47 deletions(-) create mode 100644 docs/quick-start/build-web-app.mdx diff --git a/.husky/prepare-commit-msg b/.husky/prepare-commit-msg index 982a62e..c2f69a4 100755 --- a/.husky/prepare-commit-msg +++ b/.husky/prepare-commit-msg @@ -1,6 +1,8 @@ +#!/bin/sh + # check 'Signed-off-by' in commit message -git_commit_message=$(cat $1) -if [[ "$git_commit_message" != *"Signed-off-by: "* ]]; then +git_commit_message=$(cat "$1") +if [ -z "$(echo "$git_commit_message" | grep 'Signed-off-by: ')" ]; then echo echo "\033[31mError\033[0m:" echo "Commit message is missing the Signed-off-by line." @@ -10,4 +12,4 @@ if [[ "$git_commit_message" != *"Signed-off-by: "* ]]; then exit 1 fi -exit 0 \ No newline at end of file +exit 0 diff --git a/docs/quick-start/build-web-app.mdx b/docs/quick-start/build-web-app.mdx new file mode 100644 index 0000000..fd2aecc --- /dev/null +++ b/docs/quick-start/build-web-app.mdx @@ -0,0 +1,59 @@ +--- +sidebar_position: 5 +description: Explanation of the difference between components and blocks on a practical example +tags: [Demo, Getting started] +--- + +# Generate a Web APP + +import CascadingMenu from "@site/src/components/tree" + +Now we come to the most interesting part, let the callgent generate a web APP on the fly, with least effort! + +## Define the APP functionalities + +Firstly, we must know what the APP need do! +There is no easier way to define APP functionalities than through Callgent. + +You have the following methods to go: + +### Import an existing 3rd-party services + +There are more than enough existing services you may import to your callgent directly, +You may find some on the [Callgent Hub](https://hub.callgent.com)! +Just find one appopriate callgent, then fork it as your own. + +:::tip +Of cause you may implement your own services, and share to others on the hub if want to. Yet this may require more programming skills. +::: + +### User as a Service + +Actually you needn't hire a programmar to code a service, you yourself can be part of the APP, to serve your users! + +Follow this example to define a job hiring callgent service. + +## Generate the Web pages + +After you've defined the callgent serivices, now let's try callgent to generate web pages: + +1. load your just defined `Job hiring callgent` by name +2. add a new `Webpage` client entry +3. open the entry, then ask some question, e.g. "" +4. wait for callgent to generate pages, + +
 
+
+
+ +## Consolidate pages into Web APP + +It's not neccessary to generate pages every time. +You may convert them into normal Web APP, just save the generated pages. +The saved web APP is deployed automatically on callgent server. +Or you may export it to deploy anywhere you like. + +:::tip +There are a default urls for callgent hosted web APPs. +You may bind your own host urls to your web APPs. +::: diff --git a/docs/quick-start/call-the-callgent.mdx b/docs/quick-start/call-the-callgent.mdx index 90cd350..56bfa6b 100644 --- a/docs/quick-start/call-the-callgent.mdx +++ b/docs/quick-start/call-the-callgent.mdx @@ -1,44 +1,49 @@ ---- -sidebar_position: 3 -description: Explanation of the difference between components and blocks on a practical example -tags: [Demo, Getting started] ---- - -# Call the Callgent - -import CreateCallgent from "@site/src/components/user-as-a-service/create-callgent" -import Email from "@site/src/components/quick-start/email" -import RestApi from "@site/src/components/quick-start/restApi" - -Now you may request the callgent for a task, in the following ways. - -## Email - -You may directly send an email to: - -then wait for reply from the callgent's [Service Entry](#connect-the-callgent-to-a-service-entry). - -:::tip -The email address and API url below, contains callgent Id, which is available after you've [created the callgent](#create-a-new-callgent). -::: - -## REST API - -You may also invoke the callgent via REST API: - - - -:::info -- `callback` parameter is essensial if you need to receive asyncronous response from callgent service. -::: - -## Web Page - -You may also generate a web page with a form or button to send a task to the callgent. - -## Embed into more systems - -For example, you may also want to connect the callgent to `Slack`, `Jira`, ..., Apps, so that colleagues can interact with the callgent in the channels; -Or connect it to your personal Apps like `WhatsApp`, `Instagram`, to let the callgent assist you anywhere seamlessly. - -This is achieved by adding more adaptive `Client Entry`s to the callgent, then do some neccessary configurations. You may learn more in the [Client Entry](../advanced-topics/callgent-entries/client-entry) section. +--- +sidebar_position: 3 +description: Explanation of the difference between components and blocks on a practical example +tags: [Demo, Getting started] +--- + +# Call the Callgent + +import CreateCallgent from "@site/src/components/user-as-a-service/create-callgent" +import Email from "@site/src/components/quick-start/email" +import RestApi from "@site/src/components/quick-start/restApi" + +Now you may request the callgent for a task, in the following ways. + +## Email + +You may directly send an email to: + +then wait for reply from the callgent's [Service Entry](#connect-the-callgent-to-a-service-entry). + +:::tip +The email address and API url below, contains callgent Id, which is available after you've [created the callgent](#create-a-new-callgent). +::: + +## REST API + +You may also invoke the callgent via REST API: + + + +:::info +- `callback` parameter is essensial if you need to receive asyncronous response from callgent services. +::: + +## Web App + +The most convenient way to interact with services, should be the [Callgentive UI](/blog/2024-06-17-generative-ui-home-cooked-software-development/generative-ui) way. +As user rquests, the callgent generates a web app which inter-weave to imported services. + +:::info +Try it in the [next section](./build-web-app)! +::: + +## Embed into more systems + +For example, you may also want to connect the callgent to `Slack`, `Jira`, ..., Apps, so that colleagues can interact with the callgent in the channels; +Or connect it to your personal Apps like `WhatsApp`, `Instagram`, to let the callgent assist you anywhere seamlessly. + +This is achieved by adding more adaptive `Client Entry`s to the callgent, then do some neccessary configurations. You may learn more in the [Client Entry](../advanced-topics/callgent-entries/client-entry) section.