You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 6.2 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. <h1 align="center" style="border-bottom: none;">📦⚡️ Casibase</h1>
  2. <h3 align="center">A pioneering customizable open-source Domain Knowledge Base (DKB)
  3. powered by ChatGPT, Casbin, and Casdoor.</h3>
  4. <p align="center">
  5. <a href="#badge">
  6. <img alt="semantic-release" src="https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg">
  7. </a>
  8. <a href="https://hub.docker.com/r/casbin/casibase">
  9. <img alt="docker pull casbin/casibase" src="https://img.shields.io/docker/pulls/casbin/casibase.svg">
  10. </a>
  11. <a href="https://github.com/casbin/casibase/actions/workflows/build.yml">
  12. <img alt="GitHub Workflow Status (branch)" src="https://github.com/casdoor/casdoor/workflows/Build/badge.svg?style=flat-square">
  13. </a>
  14. <a href="https://github.com/casibase/casibase/releases/latest">
  15. <img alt="GitHub Release" src="https://img.shields.io/github/v/release/casbin/casibase.svg">
  16. </a>
  17. <a href="https://hub.docker.com/repository/docker/casbin/casibase">
  18. <img alt="Docker Image Version (latest semver)" src="https://img.shields.io/badge/Docker%20Hub-latest-brightgreen">
  19. </a>
  20. <!-- waiting for changing -->
  21. <!-- <a href="https://hub.docker.com/r/casbin/casibase"> -->
  22. <!-- <a href="https://github.com/casbin/casibase/actions/workflows/build.yml"> -->
  23. <!-- <a href="https://github.com/casibase/casibase/releases/latest"> -->
  24. <!-- <a href="https://hub.docker.com/repository/docker/casbin/casibase"> -->
  25. </p>
  26. <p align="center">
  27. <a href="https://goreportcard.com/report/github.com/casbin/casibase">
  28. <img alt="Go Report Card" src="https://goreportcard.com/badge/github.com/casbin/casibase?style=flat-square">
  29. </a>
  30. <a href="https://github.com/casbin/casibase/blob/master/LICENSE">
  31. <img src="https://img.shields.io/github/license/casbin/casibase?style=flat-square" alt="license">
  32. </a>
  33. <a href="https://github.com/casbin/casibase/issues">
  34. <img alt="GitHub issues" src="https://img.shields.io/github/issues/casbin/casibase?style=flat-square">
  35. </a>
  36. <a href="#">
  37. <img alt="GitHub stars" src="https://img.shields.io/github/stars/casbin/casibase?style=flat-square">
  38. </a>
  39. <a href="https://github.com/casbin/casibase/network">
  40. <img alt="GitHub forks" src="https://img.shields.io/github/forks/casbin/casibase?style=flat-square">
  41. </a>
  42. <a href="https://crowdin.com/project/casibase">
  43. <img alt="Crowdin" src="https://badges.crowdin.net/casibase/localized.svg">
  44. </a>
  45. <a href="https://discord.gg/devUNrWXrh">
  46. <img alt="Discord" src="https://img.shields.io/discord/1022748306096537660?logo=discord&label=discord&color=5865F2">
  47. </a>
  48. </p>
  49. ## Architecture
  50. casibase contains 4 parts:
  51. | **Name** | **Description** | **Language** |
  52. |----------------|---------------------------------------------------|-----------------------------------------|
  53. | Frontend | User interface for the casibase application | JavaScript + React |
  54. | Backend | Server-side logic and API for casibase | Golang + Beego + Python + Flask + MySQL |
  55. | AI Model | Artificial intelligence model | Python + OpenAI |
  56. | Knowledge Base | Storage for casibase application domain knowledge | pgvector |
  57. ![0-Architecture-casibase](assets/0-Architecture-casibase.png)
  58. ## Demo Installation
  59. casibase uses Casdoor to manage members. So you need to create an organization and an application for casibase in a Casdoor instance.
  60. ### Casdoor configuration
  61. ```shell
  62. git clone https://github.com/casdoor/casdoor.git
  63. ```
  64. refer to: https://casdoor.org/docs/basic/server-installation
  65. Follow these steps to setup Casdoor for casibase:
  66. - Create an **Organization**![1-Add-organization](assets/1-Add-organization.png)
  67. - Configure information about the **Organization**![2-Configure-information-organization](assets/2-Configure-information-organization.png)
  68. - Add a member to a newly created organization![3-Check-user](assets/3-Check-user.png)![4-Add-member-to-organization](assets/4-Add-member-to-organization.png)
  69. - Configure member information (remember its **Name** as well as **Password**)![5-Configure-new-user](assets/5-Configure-new-user.png)
  70. - Create a new **Application**![6-Add-application](assets/6-Add-application.png)
  71. - Configuring **Application** Information (Remember **Name, ClientID** and **ClientSecret**. Change **RedirectURLs** to http://localhost:14000/callback) ![7-Configure-new-application](assets/7-Configure-new-application.png)
  72. ### casibase configuration
  73. #### Get the code
  74. ```shell
  75. git clone https://github.com/casbin/casibase.git
  76. ```
  77. #### Setup database
  78. casibase will store its users, nodes and topics informations in a MySQL database named: `casibase`, will create it if not existed. The DB connection string can be specified at: https://github.com/casbin/casibase/blob/master/conf/app.conf
  79. ```ini
  80. dataSourceName = root:123@tcp(localhost:3306)/
  81. ```
  82. Casnode uses XORM to connect to DB, so all DBs supported by XORM can also be used.
  83. #### Custom config
  84. - #### Backend (`casibase\conf\app.conf`)
  85. ```ini
  86. casdoorEndpoint = <Your_Casdoor_endpoint>
  87. clientId = <Your_clientId_in_Casdoor_configuration>
  88. clientSecret = <Your_clientSecret_in_Casdoor_configuration>
  89. casdoorOrganization = "casibase"
  90. casdoorApplication = "app-casibase"
  91. ```
  92. - #### Frontend (`casibase\web\src\Conf.js`)
  93. ```ini
  94. export const AuthConfig = {
  95. ......
  96. clientId: <Your_clientId_in_Casdoor_configuration>,
  97. ......
  98. };
  99. ```
  100. #### Run casnode
  101. - #### Backend (`casibase`)
  102. ```shell
  103. go run main.go
  104. ```
  105. - #### Frontend (`casibase\web`)
  106. ```shell
  107. yarn install
  108. yarn start
  109. ```
  110. #### Preview
  111. Access the login view via the following link:
  112. ```shell
  113. http://localhost:13001
  114. ```
  115. ![8-Preview-base-wordsets](assets/8-Preview-base-wordsets.png)
  116. ![9-Preview-casibase-stores](assets/9-Preview-casibase-stores.png)
  117. The **casibase** demo is shown above, and in the future users can upload various **knowledge** files, **wordsets**, and **factorsets** to achieve a **customized domain knowledge base**.