This commit is contained in:
Arsen Mirzaev Tatyano-Muradovich 2024-10-11 11:23:05 +03:00
parent af48d505bf
commit 8de9a0b158

View File

@ -7,49 +7,49 @@ Basis for developing chat-robots with "Web App" technology for Telegram
### AnangoDB ### AnangoDB
1. Create a Graph with the specified values 1. Create a Graph with the specified values
**Name:** catalog **Name:** catalog<br>
<br>
**edgeDefinition:** entry **edgeDefinition:** entry<br>
**fromCollections:** categoy, product **fromCollections:** categoy, product<br>
**toCollections:** category **toCollections:** category
2. Create a Graph with the specified values 2. Create a Graph with the specified values
**Name:** sessions **Name:** sessions<br>
<br>
**edgeDefinition:** connect **edgeDefinition:** connect<br>
**fromCollections:** account **fromCollections:** account<br>
**toCollections:** session **toCollections:** session
3. Create indexes for the "product" collection 3. Create indexes for the "product" collection
**Type:** "Inverted Index" **Type:** "Inverted Index"<br>
**Fields:** name.ru **Fields:** name.ru<br>
**Analyzer:** "text_ru" **Analyzer:** "text_ru"<br>
**Search field:** true **Search field:** true<br>
**Name:** name_ru **Name:** name_ru<br>
<br>
*Add indexes for all search parameters and for all languages (search language is selected based on the user's language, *Add indexes for all search parameters and for all languages (search language is selected based on the user's language, <br>
otherwise from the default language specified in the active settings from **settings** collection document)* 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` *See fields in the `mirzaev/arming_bot/models/product`<br>
**name.ru**, **description.ru** and **compatibility.ru*** **name.ru**, **description.ru** and **compatibility.ru***
4. Create a View with the specified values 4. Create a View with the specified values
**type:** search-alias (you can also use "arangosearch") **type:** search-alias (you can also use "arangosearch")<br>
**name:** **product**s_search **name:** **product**s_search<br>
**indexes:** **indexes:**
` ```json
"indexes": [ "indexes": [
{ {
"collection": "product", "collection": "product",
"index": "title_ru" (THIS IS AN EXAMPLE) "index": "title_ru" # THIS IS AN EXAMPLE
} }
] ]
` ```
### NGINX ### NGINX
1. Example of NGINX server file 1. Example of NGINX server file
` ```nginx
location / { location / {
try_files $uri $uri/ /index.php; try_files $uri $uri/ /index.php;
} }
@ -62,35 +62,35 @@ location ~ /(?<type>categories|products) {
location ~ \.php$ { location ~ \.php$ {
... ...
} }
` ```
### SystemD (or any alternative you like) ### SystemD (or any alternative you like)
1. Execute: `sudo cp telegram-huesos.service /etc/systemd/system/telegram-huesos.service` 1. Execute: `sudo cp telegram-huesos.service /etc/systemd/system/telegram-huesos.service`
*before you execute the command think about **what it does** and whether the **paths** are specified correctly* *before you execute the command think about **what it does** and whether the **paths** are specified correctly*<br>
*the configuration file is very simple and you can remake it for any alternative to SystemD that you like* *the configuration file is very simple and you can remake it for any alternative to SystemD that you like*
## Settings ## Settings
Settings of chat-robot and Web App Settings of chat-robot and Web App<br>
<br>
Make sure you have a **settings** collection (can be created automatically) and at least one document with the "status" parameter set to "active" Make sure you have a **settings** collection (can be created automatically) and at least one document with the "status" parameter set to "active"
` ```json
{ {
"status": "active" "status": "active"
} }
` ```
### language ### language
Language for system messages if user language could not be determined Language for system messages if user language could not be determined<br>
<br>
**Value:** en **Value:** en
## Suspensions ## Suspensions
System of suspensions of chat-robot and Web App System of suspensions of chat-robot and Web App<br>
<br>
Make sure you have a **suspension** collection (can be created automatically) Make sure you have a **suspension** collection (can be created automatically)
` ```json
{ {
"end": 1726068961, "end": 1726068961,
"targets": { "targets": {
@ -106,4 +106,4 @@ Make sure you have a **suspension** collection (can be created automatically)
"en": "I am developing a catalog, search and cart" "en": "I am developing a catalog, search and cart"
} }
} }
` ```