Fixes and added `menu` section

This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich 2025-01-15 13:20:11 +07:00
parent 58da87bb0e
commit 64f1a585f9

View File

@ -5,9 +5,11 @@ Basis for developing chat-robots with "Web App" technology for Telegram
### AnangoDB
1. Configure unix-socket
1. **Configure unix-socket**<br>
<br>
Edit the file `/etc/arangodb3/arangod.conf`<br>
`endpoint = tcp://127.0.0.1:8529` -> `endpoint = unix:///var/run/arangodb3/arango.sock` (this will disable the web panel)<br>
<br>
To make the web panel work, you can add this to the NGINX server settings:
```lua
server {
@ -17,7 +19,7 @@ server {
...
allow 45.159.249.167;
allow YOUR_IP_ADDRESS;
allow 192.168.1.1/24;
allow 127.0.0.1;
deny all;
@ -32,39 +34,43 @@ upstream arangodb {
server unix:/var/run/arangodb3/arango.sock;
}
```
![here is my solution for "permission denied" problem on Ubuntu (accepted by ArangoDB maintainer)](https://github.com/arangodb/arangodb/issues/17302)<br>
1. **Configure TCP (instead of unix-socket)**<br>
<br>
[here is my solution for "permission denied" problem on Ubuntu (accepted by ArangoDB maintainer)](https://github.com/arangodb/arangodb/issues/17302)<br>
<br>
OR JUST<br>
Edit the file `/etc/arangodb3/arangod.conf`<br>
`endpoint = tcp://127.0.0.1:8529` -> `endpoint = tcp://0.0.0.0:8529`<br>
Edit the file `mirzaev/huesos/system/settings/arangodb.php`
`unix:///var/run/arangodb3/arango.sock` -> `tcp://YOUR_IP_ADDRESS:8529` (it is slow and not secure)<br>
2. Create a Graph with the specified values
**Name:** catalog<br>
<br>
* Relatin 1
Edit the file `mirzaev/huesos/system/settings/arangodb.php`<br>
`unix:///var/run/arangodb3/arango.sock` -> `tcp://YOUR_IP_ADDRESS:8529` (it is slow and not secure)<br>
---
2. **Create a Graph with the specified values**<br>
<br>
**Name:** catalog<br>
* Relation 1<br>
**edgeDefinition:** entry<br>
**fromCollections:** categoy, product<br>
**fromCollections:** category, product<br>
**toCollections:** category
* Relation 2
* Relation 2<br>
**edgeDefinition:** reservation<br>
**fromCollections:** product<br>
**toCollections:** cart
3. Create a Graph with the specified values
**Name:** users<br>
---
3. **Create a Graph with the specified values**<br>
<br>
* Relation 1
**Name:** users<br>
* Relation 1<br>
**edgeDefinition:** connect<br>
**fromCollections:** cart, session<br>
**toCollections:** account, session
**toCollections:** account, session<br>
<br>
**Orphan Collections:** product
4. Create indexes for the "product" collection
---
4. **Create indexes for the "product" collection**<br>
<br>
**Type:** "Inverted Index"<br>
**Fields:** name.ru<br>
**Analyzer:** "text_ru"<br>
@ -75,9 +81,9 @@ Edit the file `mirzaev/huesos/system/settings/arangodb.php`
otherwise from the default language specified in the active settings from **settings** collection document)*<br>
<br>
*See fields in the `mirzaev/arming_bot/models/product`<br>
**name.ru**, **description.ru** and **compatibility.ru***
4. Create a View with the specified values
**name.ru**, **description.ru** and **compatibility.ru***<br>
---
5. **Create a View with the specified values**
**type:** search-alias (you can also use "arangosearch")<br>
**name:** **product**s_search<br>
**indexes:**<br>
@ -95,10 +101,10 @@ You can copy an example of view file from here: `/examples/arangodb/views/produc
### NGINX
1. Create a NGINX server
1. **Create a NGINX server**<br>
You can copy an example of server file from here: `/examples/nginx/server.conf`
2. Add support for javascript modules
2. **Add support for javascript modules**<br>
Edit the file `/etc/nginx/mime.types`<br>
`application/javascript js;` -> `application/javascript js mjs;`
@ -111,6 +117,35 @@ You can copy an example of systemd file from here: `/examples/systemd/huesos.ser
*the configuration file is very simple and you can remake it for any alternative to SystemD that you like*
## Menu
Menu inside the Web App<br>
<br>
Make sure you have a **menu** collection (can be created automatically)<br>
You can copy a clean menu documents without comments from here: `/examples/arangodb/collections/menu`
```json
{
"urn": "/", // Link
"name": {
"en": "Main page",
"ru": "Главная страница"
},
"style": { // The `style` attribute
"order": 0
},
"class": {},
"icon": { // Icon from `/themes/default/css/icons`
"style": { // The `style` attribute
"rotate": "-135deg"
},
"class": "arrow circle" // Classes of the icon
},
"image": { // Image at the background @deprecated?
"storage": null
}
}
```
## Settings
Settings of chat-robot and Web App<br>
<br>