Skip to content

Commit

Permalink
feat: add walkthrough guides
Browse files Browse the repository at this point in the history
feat: add translation button at bottom of doc page (#12)

casdoor/casdoor-website#564

docs: Complete installation documentation for casibase (#11)

* docs: Complete installation documentation for casibase

* docs: Complete installation documentation for casibase

feat: complete guides
  • Loading branch information
kv-chiu committed Sep 13, 2023
1 parent 56822fe commit 7433bea
Show file tree
Hide file tree
Showing 64 changed files with 668 additions and 57 deletions.
46 changes: 25 additions & 21 deletions docs/basic/casdoor-sso.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,45 @@
---
title: Casdoor-SSO
description: Introduction of casdoor in casibase
description: Setup Casdoor for casibase
keywords: [Casdoor, SSO, Security, Authentication, Authorization]
authors: [kv-chiu]
authors: [uestc-wxy]
---

```mdx-code-block
import styles from '.././styles.module.css';
import CasdoorCard from "@site/src/components/CasdoorCard";
```

## Introduction
Casibase uses Casdoor as its backend service,so make sure to deploy it in advance.

Casdoor is a powerful and lightweight open-source [Identity Access Management (IAM)](https://en.wikipedia.org/wiki/Identity_management) / [Single-Sign-On (SSO)](https://en.wikipedia.org/wiki/Single_sign-on) server. It's developed and maintained by [**Casbin**](https://casbin.org).
Please refer to: <https://casdoor.org/docs/basic/server-installation> to install and configure Casdoor.

```mdx-code-block
<div className={styles.gradientborder}>
<CasdoorCard src="https://door.casdoor.com/login" />
</div>
```
Follow these steps to setup Casdoor for casibase:

- Create an Organization

![create-organization](/img/create-organization.png)

- Configure information about the Organization

![configure-organization](/img/configure-organization.png)

- Create a new Application

![create-application](/img/create-application.png)

Casdoor serves both the web UI and the login requests from the application users.
- Configuring Application Information (Remember Name, ClientID and ClientSecret)

## Features
![configure-application](/img/configure-application.png)

- **Single-Sign-On (SSO)**: Sign in to multiple applications with one set of login credentials.
- **Social Login**: Sign in with GitHub, Google, etc.
- **Integrated Provider Management**: Manage all your providers in one place.
- **Authentication**: Verify the identity of your users.
- Add a member to the newly created organization

![Principle](/img/principles.gif)
![add-user](/img/add-user-1.png)

:::tip
![add-user](/img/add-user-2.png)

Casibase manages third-party service providers through Casdoor:
- Configure member information (remember its Name as well as Password)

- **Storage**: Manage your storage providers, such as AWS, Azure, etc.
- **AI**: Manage your chat providers, such as OpenAI, ChatGLM, etc.
![configure-user](/img/configure-user-1.png)

:::
![configure-user](/img/configure-user-2.png)
2 changes: 1 addition & 1 deletion docs/basic/core-concepts.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Core Concepts
description: Casibase core concepts
keywords: [core concepts, provider, storage, chat, vector]
keywords: [Core concepts, Provider, Storage, Chat, Vector]
authors: [kv-chiu]
---

Expand Down
55 changes: 40 additions & 15 deletions docs/basic/server-installation.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Server Installation
description: Install and configure Casdoor server
keywords: [Casibase server, installation, configuration]
authors: [kv-chiu]
keywords: [Casibase server, Installation, Configuration]
authors: [kv-chiu, uestc-wxy]
---

## Requirements
Expand Down Expand Up @@ -65,6 +65,12 @@ git clone https://github.com/casbin/casibase

## Configuration

### Configure Casdoor

Please refer to: <https://casibase.org/docs/basic/casdoor-sso> to configure Casdoor.

Remember your `clientId``clientSecret``organization``application` and so on in Casdoor configuration, we will use them later.

### Configure Database

Casibase supports mysql, mssql, sqlite3, postgres. Casibase uses mysql by default.
Expand All @@ -76,7 +82,7 @@ Casibase will store its users, nodes and topics information in a MySQL database
```ini
driverName = mysql
dataSourceName = root:123456@tcp(localhost:3306)/
dbName = casdoor
dbName = casibase
```

#### PostgreSQL
Expand Down Expand Up @@ -123,6 +129,29 @@ dataSourceName = "file:casibase.db?cache=shared"
dbName = casibase
```

### Custom configuration

Casibase supports custom configuration, you can modify the configuration file `conf/app.conf` to change the configuration.

- Backend (casibase\conf\app.conf)

```ini
casdoorEndpoint = http://localhost:8000
clientId = <Your_clientId_in_Casdoor_configuration>
clientSecret = <Your_clientSecret_in_Casdoor_configuration>
casdoorOrganization = casibase
casdoorApplication = app-casibase
```

- Frontend (casibase\web\src\Conf.js)

```js
serverUrl: "http://localhost:7001"
clientId: "<Your_clientId_in_Casdoor_configuration>"
appName: "app-casibase"
organizationName: "casibase"
```

## Run

There are currently two methods to start, you can choose one according to your own situation.
Expand Down Expand Up @@ -159,13 +188,6 @@ yarn install
yarn start
```

Visit: `http://localhost:13001` in your browser. Log into Casibase dashboard with the default global admin account: `built-in/admin`

```bash
admin
123
```

### Production mode

#### Backend
Expand Down Expand Up @@ -196,12 +218,15 @@ yarn install
yarn build
```

Visit: `http://localhost:14000` in your browser. Log into Casibase dashboard with the default global admin account: `built-in/admin`
## Preview

```bash
admin
123
```
Visit: `http://localhost:13001` in your browser. Login into Casibase dashboard with the user account you have just registered in Casdoor:

![login](/img/login-casibase.png)

Then you will go to the home page of Casibase:

![home](/img/casibase-home.png)

:::tip

Expand Down
65 changes: 65 additions & 0 deletions docs/walkthrough-guides/add-a-embedding-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
title: Add an Embedding Provider
description: Explore how to integrate an embedding provider with Casibase.
keywords: [Casibase, Embedding Provider, Integration]
authors: [kv-chiu]
---

This document is a step-by-step tutorial designed for beginners. It will guide you through the process of integrating an embedding provider with Casibase, our powerful knowledge base system.

## Introduction

Embedding is a technique used to represent words and documents as vectors. Embedding providers allow you to analyze and process data within your knowledge base system, making it more intelligent and efficient.

Refer to the [Core Concepts](../basic/core-concepts) section of our previous documentation for more information about embedding.

In Casibase, you can add an embedding provider by following these steps:

### Step 1: Deploy Casdoor and Casibase

Before you can add an embedding provider, make sure you have Casdoor and Casibase deployed. If you haven't done this yet, please refer to the [Deploy Casdoor and Casibase](./deploy-casdoor-and-casibase) tutorial in our previous documentation.

### Step 2: Add a New Embedding Provider

Embedding providers are used to integrate embedding into Casibase. You can add them by following these steps:

Click the `Providers` button on the home page.

![Casibase-home-providers](/img/walkthrough-guides/casibase-home-providers.png)

#### Step 2.1: Add an Embedding Provider

Click the `Add` button to add an embedding provider.

![Casibase-providers-add](/img/walkthrough-guides/casibase-providers-add.png)

#### Step 2.2: Fill in Embedding Provider Details

Fill in the embedding provider details and click the `Save & Exit` button.

![Casibase-embedding](/img/walkthrough-guides/casibase-embedding-form.png)

:::tip

Same as the [Model Provider](./add-a-model-provider) section, Casibase supports many embedding providers, including:

- [OpenAI](https://openai.com/)
- AdaSimilarity
- DavinciSimilarity
- AdaEmbedding2
- ......
- [Hugging Face](https://huggingface.co/)
- sentence-transformers/paraphrase-MiniLM-L6-v2
- ......

:::

Return providers list page:

![Casibase-embedding-view](/img/walkthrough-guides/casibase-embedding-view.png)

Now, you can use the embedding provider to convert text to vectors.

After adding an embedding provider, you can use it to retrieve similar documents in Casibase. For more information, please refer to the [Core Concepts](../basic/core-concepts) section of our previous documentation.

In the next chapter, we will learn how to integrate storage providers, model providers, and embedding providers with Casibase.
94 changes: 94 additions & 0 deletions docs/walkthrough-guides/add-a-model-provider.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
---
title: Add a Model Provider
description: Learn how to add a model provider to enhance Casibase functionality.
keywords: [Casibase, Model Provider, Integration]
authors: [kv-chiu]
---

This document is a step-by-step tutorial designed for beginners. It will guide you through the process of integrating a model provider with Casibase, our powerful knowledge base system.

## Introduction

Adding a model provider to Casibase enables you to enhance its functionality by incorporating machine learning models and AI capabilities. Model providers allow you to analyze and process data within your knowledge base system, making it more intelligent and efficient.

If you're new to integrating model providers, don't worry. We've broken down the process into simple steps that anyone can follow.

### Step 1: Deploy Casdoor and Casibase

Before you can add a model provider, make sure you have Casdoor and Casibase deployed. If you haven't done this yet, please refer to the [Deploy Casdoor and Casibase](./deploy-casdoor-and-casibase) tutorial in our previous documentation.

### Step 2: Add a New Model Provider

Model providers are used to integrate LLM into Casibase. You can add them by following these steps:

Click the `Providers` button on the home page.

![Casibase-home-providers](/img/walkthrough-guides/casibase-home-providers.png)

#### Step 2.1: Add a Model Provider

Click the `Add` button to add a model provider.

![Casibase-providers-add](/img/walkthrough-guides/casibase-providers-add.png)

#### Step 2.2: Fill in Model Provider Details

Fill in the model provider details and click the `Save & Exit` button.

![Casibase-model-openai](/img/walkthrough-guides/casibase-model-openai.png)

:::tip

Casibase supports many model providers, including:

- [Hugging Face](https://huggingface.co/)
- meta-llama/Llama-2-7b
- THUDM/chatglm2-6b
- baichuan-inc/Baichuan2-13B-chat
- gpt2
- ......
- [OpenRouter](https://openrouter.ai/)
- anthropic/claude-2
- palm-2-chat-bison
- palm-2-codechat-bison
- openai/gpt-4
- ......
- [OpenAI](https://openai.com/)
- text-davinci-003
- gpt-3.5-turbo
- gpt-4
- ......

:::

:::caution

- Category: The first-level category of the model provider. For example, `Model` and `Embedding`.
- Type: The second-level category of the model provider. For example, `OpenAI` and `Hugging Face`.
- SecretKey: The secret key of your OpenAI account.

**Example**

##### Add a OpenAI model provider

![Casibase-model-select](/img/walkthrough-guides/casibase-model-select.png)

:::

:::caution

Some models don't support **streaming-output**. Known models that support streaming-output include:

- `gpt-3.5-turbo-0613`

:::

After adding a model provider, you can use it to analyze and process data in Casibase using chatbots, question answering, and other AI capabilities.

Return model provider list page:

![Casibase-providers-view](/img/walkthrough-guides/casibase-model-view.png)

Now that you've added a model provider, you can use it to analyze and process data in Casibase using chatbots, question answering, and other AI capabilities.

In the next chapter, we'll learn how to add an embedding provider to Casibase.
Loading

0 comments on commit 7433bea

Please sign in to comment.