Skip to content

Commit

Permalink
feat: quick-start build web app
Browse files Browse the repository at this point in the history
Signed-off-by: dev-callgent <dev@callgent.com>
  • Loading branch information
dev-callgent committed Nov 7, 2024
1 parent 5953936 commit 65eb9d7
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 47 deletions.
8 changes: 5 additions & 3 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -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."
Expand All @@ -10,4 +12,4 @@ if [[ "$git_commit_message" != *"Signed-off-by: "* ]]; then
exit 1
fi

exit 0
exit 0
59 changes: 59 additions & 0 deletions docs/quick-start/build-web-app.mdx
Original file line number Diff line number Diff line change
@@ -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 <a href="/solutions/showcase/user-as-a-service/service-design" target="_blank">this example</a> 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,

<pre>
<CascadingMenu name="Recruitment" placeholder="Please enter the callgent name you just defined services" />
</pre>

## 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.
:::
93 changes: 49 additions & 44 deletions docs/quick-start/call-the-callgent.mdx
Original file line number Diff line number Diff line change
@@ -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:<Email />

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:
<RestApi/>


:::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:<Email />

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:
<RestApi/>


:::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.

0 comments on commit 65eb9d7

Please sign in to comment.