Skip to content

Commit

Permalink
Merge pull request #19 from web-tech-tw/docs
Browse files Browse the repository at this point in the history
Merge docs branch
  • Loading branch information
supersonictw authored Jul 16, 2024
2 parents 85d8273 + 4bc5a3e commit 57eb36b
Show file tree
Hide file tree
Showing 29 changed files with 644 additions and 20 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Docs workflow

on:
push:
branches:
- main

permissions:
contents: write

jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Specific Node.js version 🦄
uses: actions/setup-node@v3
with:
node-version: 20

- name: Checkout 🛎️
uses: actions/checkout@v4

- name: Install and Build 📎
run: |
npm install
npm run docs:build
- name: Deploy Docs 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: gh-pages
folder: docs/.vitepress/dist
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ node_modules
/data
/static/file_*
config.yaml
docs/.vitepress/dist
docs/.vitepress/cache

# Log files
npm-debug.log*
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
# Arona

The perfectest bridging for every messenger.
A simple bridge for every messenger.

[Bridge](https://matrix.org/bridges/) is the idea makes **[Matrix](https://matrix.org)** cross connecting every Instant Message Providers.

![Arona](icon.min.png)
![Arona](docs/statics/icon.min.png)

## Documentation

Expand Down
2 changes: 1 addition & 1 deletion app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const {
app.listen(bindPort, bindHost, () => {
console.info("Arona");
console.info("===");
console.info("The perfectest bridging for every messenger.");
console.info("A simple bridge for every messenger.");
console.info(`Listening on http://${bindHost}:${bindPort}`);
checkHeartCode();
});
97 changes: 97 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
title: "Arona",
description: "A simple bridge for every messenger.",
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
nav: [{
text: "Home",
link: "/",
}, {
text: "Docs",
link: "/introduction",
}],
sidebar: [
{
text: "🌟 Introduction",
link: "/introduction",
},
{
text: "😎 Prerequisites",
link: "/prerequisites",
},
{
text: "✨ Get Started",
link: "/get-started",
},
{
text: "🪄 Configuration",
link: "/configuration",
},
{
text: "🎯 Usage",
link: "/usage",
},
{
text: "🏁 Commands",
link: "/commands",
},
{
text: "❓ FAQ",
link: "/faq",
},
{
text: "🔱 Integrations",
link: "/integrations",
items: [
{
text: "LINE",
link: "/integrations/line",
},
{
text: "Matrix",
link: "/integrations/matrix",
},
{
text: "Discord",
link: "/integrations/discord",
},
{
text: "Telegram",
link: "/integrations/telegram",
},
{
text: "OpenAI",
link: "/integrations/openai",
}
],
},
{
text: "🔮 About",
link: "/about",
},
],
socialLinks: [
{
icon: 'github',
link: 'https://github.com/web-tech-tw/arona',
}
],
footer: {
message: "MIT Licensed",
copyright: "Copyright © 2024 Taiwan Web Technology Promotion Organization (Web Tech TW)"
}
},
locales: {
root: {
label: 'English',
lang: 'en'
},
"zh-tw": {
label: '正體中文',
lang: 'zh-tw',
}
}
})
11 changes: 0 additions & 11 deletions docs/README.md

This file was deleted.

15 changes: 15 additions & 0 deletions docs/about.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 🔮 About

Hello!

This is the bridge for LINE and Matrix,

to communicate with the chat room which belongs to both of the different providers.

![logo](statics/icon.min.png)

The bridge is using [line-bot-sdk-python](https://github.com/line/line-bot-sdk-python) and [matrix-nio](https://github.com/poljar/matrix-nio) for transporting.

[Instruction of Matrix Bridges](https://matrix.org/bridges/)

This is the documentation for Arona, the perfectest bridging for every messenger.
16 changes: 16 additions & 0 deletions docs/commands.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 🏁 Commands

The following commands are available in the chat:

| Command | Description |
| ---------------- | ------------------------- |
| `/aiLink` | Link with AI chat |
| `/aiUnlink` | Unlink with AI chat |
| `/setLocaleCode` | Set locale |
| `/datetime` | Get current date and time |
| `/chatId` | Get chat ID |
| `/pair` | Pair with another chat |
| `/pairStatus` | Get pairing status |
| `/pairLink` | Link with another chat |
| `/pairUnlink` | Unlink with another chat |
| `/help` | Show the help message |
154 changes: 154 additions & 0 deletions docs/configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# 🪄 Configuration

To configure the Arona, you need to create a configuration file named `config.yaml` in the root directory of the project.

## Configuration File

The configuration file is a YAML file that contains the configuration for the Arona.

```yaml
deviceName: "Arona"

http:
bindHost: 127.0.0.1
bindPort: 3000
baseUrl: "http://example.com"

bridge:
public: true

bridgeProvider:
# OpenAI
openai:
enable: true
# https://github.com/ai-tech-tw/openai
baseUrl: "https://web-tech-tw.eu.org/openai/v1"
apiKey: "YourGeminiApiKey"
chatModel: "gpt-3.5-turbo"

# LINE
line:
enable: true
channelAccessToken: "YourChannelAccessToken"
channelSecret: "YourChannelSecret"
useNotify: true
notifyClientId: "YourClientID"
notifyClientSecret: "YourClientSecret"

# Matrix
matrix:
enable: true
homeserverUrl: "https://matrix.org"
accessToken: "YourSecretAccessToken"

# Discord
discord:
enable: false
appId: "YourAppId"
botToken: "YourBotToken"

# Telegram
telegram:
enable: false
botToken: "YourBotToken"
```
## Configuration Options
The configuration file contains the following options:
| Option | Description |
| ---------------- | ---------------------------------- |
| `deviceName` | The name of the device. |
| `http` | The HTTP configuration. |
| `bridge` | The bridge configuration. |
| `bridgeProvider` | The bridge provider configuration. |

### `deviceName`

The `deviceName` option is used to specify the name of the device.

### `http`

The `http` option is used to configure the HTTP server.

| Option | Description |
| ---------- | ------------------------ |
| `bindHost` | The host to bind to. |
| `bindPort` | The port to bind to. |
| `baseUrl` | The base URL of the API. |

### `bridge`

The `bridge` option is used to configure the bridge.

| Option | Description |
| -------- | ------------------------------------ |
| `public` | Whether the bridge is public or not. |

### `bridgeProvider`

The `bridgeProvider` option is used to configure the bridge provider.

#### OpenAI

The `openai` option is used to configure the OpenAI provider.

| Option | Description |
| ----------- | --------------------------------------- |
| `enable` | Whether the provider is enabled or not. |
| `baseUrl` | The base URL of the OpenAI API. |
| `apiKey` | The API key of the OpenAI API. |
| `chatModel` | The chat model to use. |

Details of OpenAI integration can be found [here](integrations/openai.md).

#### LINE

The `line` option is used to configure the LINE provider.

| Option | Description |
| -------------------- | ----------------------------------------- |
| `enable` | Whether the provider is enabled or not. |
| `channelAccessToken` | The channel access token of the LINE API. |
| `channelSecret` | The channel secret of the LINE API. |
| `useNotify` | Whether to use LINE Notify or not. |
| `notifyClientId` | The client ID of the LINE Notify API. |
| `notifyClientSecret` | The client secret of the LINE Notify API. |

Details of LINE integration can be found [here](integrations/line.md).

#### Matrix

The `matrix` option is used to configure the Matrix provider.

| Option | Description |
| --------------- | --------------------------------------- |
| `enable` | Whether the provider is enabled or not. |
| `homeserverUrl` | The homeserver URL of the Matrix API |
| `accessToken` | The access token of the Matrix API. |

Details of Matrix integration can be found [here](integrations/matrix.md).

#### Discord

The `discord` option is used to configure the Discord provider.

| Option | Description |
| ---------- | --------------------------------------- |
| `enable` | Whether the provider is enabled or not. |
| `appId` | The application ID of the Discord API. |
| `botToken` | The bot token of the Discord API. |

Details of Discord integration can be found [here](integrations/discord.md).

#### Telegram

The `telegram` option is used to configure the Telegram provider.

| Option | Description |
| ---------- | --------------------------------------- |
| `enable` | Whether the provider is enabled or not. |
| `botToken` | The bot token of the Telegram API. |

Details of Telegram integration can be found [here](integrations/telegram.md).
5 changes: 5 additions & 0 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# ❓ FAQ

## What is Arona?

Arona is a bridge for LINE and Matrix, to communicate with the chat room which belongs to both of the different providers.
Loading

0 comments on commit 57eb36b

Please sign in to comment.