Files
main-tbbank/frontend/readme.md
2026-08-18 00:59:32 +05:00

36 lines
1.0 KiB
Markdown

# Bank
```bash
# Install
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>
```