How rkomp9802-prog/matizdetail works
MATIZ Detail combines a detailing-service landing page with customer support through a website chat widget and Telegram bot. Website text questions are first handled by local intents in the browser; other questions go to the server’s shared answer flow, which checks the FAQ before using Gemini. Chats, unanswered questions, and attachments are retained for the admin panel, while Telegram can notify the owner. The README documents these capabilities; some subsystem links use documented paths whose source was not sampled, so uncertain call wiring is omitted.
Main entry points: page.tsx Admin panel · chatLog.ts Conversation storage · answer.ts Answer flow · useChat.ts Chat state
Components 26
Public site
- Landing page
app/page.tsx - Landing sections
components/landing/Services.tsx - Service defaults
data/business.ts - Feedback form
components/FeedbackForm.tsx - Feedback endpoint
app/api/feedback/route.ts
Chat and answers
- Chat widget
components/chat/ChatWidget.tsx - Chat state
hooks/useChat.ts - Local intents
lib/chatBot.ts - Website chat API
app/api/chat/route.ts - Answer flow
lib/answer.ts - FAQ matching
lib/qaMatch.ts - Telegram webhook
app/api/telegram/webhook/route.ts - Local chat logging
app/api/chat/log/route.ts
Administration
- Admin panel
app/admin/page.tsx - FAQ management
app/api/admin/questions/route.ts - Business settings API
app/api/admin/info/route.ts - Business settings
lib/businessInfo.ts - Protected media
app/api/admin/media/[id]/route.ts - Admin access
proxy.ts
Data storage
- Turso client
lib/turso.ts - Conversation storage
lib/chatLog.ts
External services
- Gemini
lib/gemini.ts - Telegram service
lib/telegram.ts
Other components
- Visitor
- Owner
- Telegram user
Connections 34
- Visitor → Landing page: visits
- Landing page → Landing sections: renders
- Landing sections → Service defaults: reads defaults
- Visitor → Chat widget: opens chat
- Chat widget → Chat state: uses
- Chat state → Local intents: checks intents
- Chat state → Website chat API: sends unresolved
- Chat state → Local chat logging: logs local replies
- Website chat API → Answer flow: requests answer
- Answer flow → FAQ matching: checks FAQ
- Answer flow → Gemini: generates answer
- Website chat API → Conversation storage: saves messages
- Website chat API → Telegram service: sends alerts/media
- Local chat logging → Conversation storage: saves messages
- Telegram user → Telegram webhook: sends updates
- Telegram webhook → Answer flow: requests answer
- Telegram webhook → Conversation storage: saves messages
- Telegram webhook → Telegram service: sends replies
- Visitor → Feedback form: submits feedback
- Feedback form → Feedback endpoint: posts message
- Feedback endpoint → Telegram service: forwards feedback
- Owner → Admin panel: manages service
- Admin panel → Admin access: requires access
- Admin panel → FAQ management: manages FAQ
- Admin panel → Business settings API: edits settings
- Admin panel → Conversation storage: views conversations
- Admin panel → Protected media: loads attachments
- FAQ management → Turso client: reads/writes FAQ
- Business settings API → Business settings: loads/saves values
- Business settings → Turso client: reads/writes settings
- Conversation storage → Turso client: stores messages/media
- Answer flow → Business settings: uses service details
- Local intents → Service defaults: reads service data
- Protected media → Conversation storage: loads attachment