How abhishek4852/docsense works
DocSense is a multi-tenant document knowledge assistant. Users register and sign in, upload documents or text, then query an organization’s indexed knowledge through dashboard chat; WhatsApp offers a second documented access channel. Ingestion and answer generation are distinct RAG stages, with retrieval and re-ranking between them. The graph includes account, document, chat, and WhatsApp capabilities from the README; WhatsApp configuration and several frontend-to-API connections are only partially evidenced in the excerpts, so uncertain links are dashed.
Main entry points: axios.js API client · whatsapp/views.py Webhook and message handling · documents/views.py Document endpoints · chat/views.py Chat endpoints
Components 25
Web experience
- Landing page
frontend/src/pages/LandingPage.jsx - Registration
frontend/src/pages/auth/RegisterPage.jsx - Sign in
frontend/src/pages/auth/LoginPage.jsx - Dashboard shell
frontend/src/pages/dashboard/DashboardLayout.jsx - Document upload UI
frontend/src/pages/dashboard/UploadPage.jsx - Chat interface
frontend/src/pages/dashboard/ChatPage.jsx - WhatsApp settings UI
frontend/src/pages/dashboard/WhatsAppSettingsPage.jsx - API client
frontend/src/api/axios.js
Accounts and tenancy
- Organization and users
backend/accounts/models.py - Account endpoints
backend/accounts/views.py
Knowledge ingestion
- Document records
backend/documents/models.py - Document endpoints
backend/documents/views.py - Document parsing
backend/rag/parser.py - Type-aware chunking
backend/rag/chunking.py
RAG and chat
- Text embeddings
backend/rag/embedding.py - Organization vector store
backend/rag/vector_store.py - Retrieval and reranking
backend/rag/retriever.py - Prompt construction
backend/rag/prompt.py - Answer generation
backend/rag/generator.py - Chat endpoints
backend/chat/views.py - Chat sessions and messages
backend/chat/models.py
- Webhook and message handling
backend/whatsapp/views.py - WhatsApp configuration and history
backend/whatsapp/models.py
Other components
- User
- Meta WhatsApp
Connections 33
- User → Landing page: opens
- Landing page → Registration: links to
frontend/src/pages/LandingPage.jsx - Landing page → Sign in: links to
frontend/src/pages/LandingPage.jsx - Registration → API client: submits registration
frontend/src/pages/auth/RegisterPage.jsx - Sign in → API client: sends credentials
frontend/src/pages/auth/LoginPage.jsx - API client → Account endpoints: calls API
- Account endpoints → Organization and users: reads and writes
- Dashboard shell → Document upload UI: routes to
frontend/src/App.jsx - Dashboard shell → Chat interface: routes to
frontend/src/App.jsx - Dashboard shell → WhatsApp settings UI: routes to
frontend/src/App.jsx - Document upload UI → API client: uploads documents
frontend/src/pages/dashboard/UploadPage.jsx - Chat interface → API client: requests chat
frontend/src/pages/dashboard/ChatPage.jsx - WhatsApp settings UI → API client: configures channel
frontend/src/pages/dashboard/WhatsAppSettingsPage.jsx - API client → Document endpoints: calls API
- API client → Chat endpoints: calls API
- API client → Webhook and message handling: calls API
- Document endpoints → Document records: creates and lists
backend/documents/views.py - Document endpoints → Document parsing: extracts text
backend/documents/views.py - Document endpoints → Type-aware chunking: chunks text
backend/documents/views.py - Document endpoints → Text embeddings: embeds chunks
backend/documents/views.py - Document endpoints → Organization vector store: indexes chunks
backend/documents/views.py - Chat endpoints → Chat sessions and messages: reads and writes
backend/chat/views.py - Chat endpoints → Retrieval and reranking: retrieves context
backend/chat/views.py - Chat endpoints → Prompt construction: builds prompt
backend/chat/views.py - Chat endpoints → Answer generation: generates answer
backend/chat/views.py - Retrieval and reranking → Text embeddings: embeds query
backend/rag/retriever.py - Retrieval and reranking → Organization vector store: searches chunks
backend/rag/retriever.py - Webhook and message handling → WhatsApp configuration and history: reads and writes
backend/whatsapp/views.py - Webhook and message handling → Retrieval and reranking: retrieves context
backend/whatsapp/views.py - Webhook and message handling → Prompt construction: builds prompt
backend/whatsapp/views.py - Webhook and message handling → Answer generation: generates answer
backend/whatsapp/views.py - Webhook and message handling → Meta WhatsApp: sends replies
backend/whatsapp/views.py - Meta WhatsApp → Webhook and message handling: delivers webhook