How aweretelnikov-png/small-business-demo works
This repository is a demo business-automation suite: sales data becomes PostgreSQL reporting, staff and customers get a document-grounded AI FAQ, and website leads are stored, notified, and synchronized with Twenty CRM. The graph preserves those separate workflows and the CRM status-webhook return path. AI retrieval/model wiring and some dashboard runtime details are documented capabilities; their implementation is not included in the sampled source, so those links reflect documentation rather than inspected calls.
Main entry points: main.py FastAPI · leads.py Lead services · integrations.py Integration dispatcher · docker-compose.yml Open WebUI
Components 24
Sales analytics
- ETL orchestration
analytics/etl/run_all.py - Customer loader
analytics/etl/load_customers.py - Lead and deal loaders
analytics/etl - CSV and XLSX
analytics/data/raw - Sales PostgreSQL
analytics/docker-compose.yml - Sales reporting views
analytics/sql
AI FAQ
- Client knowledge
ai-faq/knowledge - Staff knowledge
ai-faq/internal_knowledge - Retrieval and embeddings
ai-faq - Open WebUI
ai-faq/docker-compose.yml
Lead and CRM flow
- Lead form
crm-leads/frontend/app.js - FastAPI
crm-leads/backend/app/main.py - Lead services
crm-leads/backend/app/services/leads.py - CRM PostgreSQL
crm-leads/backend/app/database.py - Integration dispatcher
crm-leads/backend/app/services/integrations.py - Webhook processing
crm-leads/backend/app/services/twenty_webhook.py
Reporting surfaces
- Sales dashboards
analytics/docker-compose.yml - CRM dashboard
crm-leads/sql
Other components
- Business data
- FAQ user
- Ollama models
- Website visitor
- Telegram
- Twenty CRM
Connections 28
- Business data → CSV and XLSX: provides files
- ETL orchestration → Customer loader: runs loader
- ETL orchestration → Lead and deal loaders: runs loaders
- CSV and XLSX → Customer loader: reads customers
- CSV and XLSX → Lead and deal loaders: reads sales data
- Customer loader → Sales PostgreSQL: writes customers
- Lead and deal loaders → Sales PostgreSQL: writes sales records
- Sales PostgreSQL → Sales reporting views: feeds views
- Sales reporting views → Sales dashboards: supports dashboards
- FAQ user → Open WebUI: asks question
- Client knowledge → Retrieval and embeddings: grounds answers
- Staff knowledge → Retrieval and embeddings: grounds answers
- Retrieval and embeddings → Open WebUI: retrieves context
- Open WebUI → Ollama models: requests completion
- Open WebUI → FAQ user: returns answer
- Website visitor → Lead form: submits lead
- Lead form → FastAPI: posts lead
- FastAPI → Lead services: saves lead
- Lead services → CRM PostgreSQL: writes lead
- FastAPI → Integration dispatcher: dispatches integrations
- Integration dispatcher → Telegram: sends notification
- Integration dispatcher → Twenty CRM: syncs lead
- Integration dispatcher → Lead services: updates sync status
- Twenty CRM → FastAPI: posts stage webhook
- FastAPI → Webhook processing: verifies and processes
- Webhook processing → Lead services: updates status history
- Lead services → CRM PostgreSQL: writes status
- CRM PostgreSQL → CRM dashboard: provides analytics