ch prefix
This commit is contained in:
26
frontend/readme.md
Executable file → Normal file
26
frontend/readme.md
Executable file → Normal file
@@ -7,3 +7,29 @@ npm i
|
||||
# Production build
|
||||
npx tailwindcss -i assets/css/app.css -o src/css/app.css --minify
|
||||
```
|
||||
|
||||
## Chatbot (Sorag-jogap)
|
||||
|
||||
Q&A bot with curated question buttons, backed by a SQLite database on the backend. Answers are auto-generated from [tbbank.gov.tm](http://tbbank.gov.tm) content. Embedded as a floating widget on the homepage — click **Soraglar** (bottom-right) to open the chat panel.
|
||||
|
||||
### Run locally
|
||||
|
||||
```bash
|
||||
# Terminal 1 — API (Node 18)
|
||||
cd ../backend && npm i && npm start
|
||||
|
||||
# Terminal 2 — static site (serve src/ with your usual tool)
|
||||
cd frontend && npm i
|
||||
npx tailwindcss -i assets/css/app.css -o src/css/app.css --minify
|
||||
```
|
||||
|
||||
Open `/` and click **Soraglar**. Pick a question button or type your own. Russian UI: `/?lang=ru`. Old `/chatbot.html` links redirect to `/?chat=open`.
|
||||
|
||||
### Production API URL
|
||||
|
||||
If the API is not on `localhost:3001`, set the base URL before loading the chat script:
|
||||
|
||||
```html
|
||||
<script>window.CHATBOT_API = 'https://your-api.example.com';</script>
|
||||
<script src="/js/chatbot.js"></script>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user