How yuigod/vue-doc-qa-chat works
Project type and purpose
• This is a Vue3 + TypeScript + Vite + ElementPlus web-front-end module for a local knowledge-base Q&A application.
• It communicates with a Python FastAPI server (“py-doc-qa-deepseek-server”) that in turn uses LangChain + DeepSeek R1 for embedding and LLM inference, and stores documents, sessions, and vectors.
File structure
• Top-level:
• public/ – static assets & preview videos
• src/ – application code
• api/, http/, utils/ – service-layer abstractions & HTTP client wrappers
• components/, layout/, views/ – UI building blocks and pages
• router/, stores/ – navigation & state (Pinia)
• Patterns & frameworks:
• Composition-API Vue components (App.vue, *.vue under components & views)
• Centralized HTTP module that integrates Axios + Fetch with interceptors & cancellation
• API folder separated by domain (chat, chatSession, documents)
• Pinia stores for global state (app.ts)
• Vite build & dev config, multiple tsconfig files, linting & formatting configs
README insights
• Describes the main features: document upload & management, RAG-style chat with streaming responses, chat history management
• References the FastAPI backend and its endpoints
• Mentions markdown rendering via markdown-it and custom styling
1) Browser / Frontend SPA
– Vue3 App: router, components, views
– Pinia store
– HTTP Client module (Axios + Fetch wrappers)
– Markdown-it renderer & styling
2) Backend API Server (FastAPI)
– Endpoints: /chat, /session/*, /documents/*, /vector-all
3) Data Storage
– Document File Storage (filesystem or blob store)
– Database (sessions, document metadata, vector flags)
– Vector store (could be part of DB or external vector DB)
4) AI Model & Inference
– LangChain orchestration
– DeepSeek R1 model served via Ollama or other inference service
– User → Browser: interact with UI, triggers API calls
– Browser → HTTP Client → FastAPI server
– FastAPI → DB: CRUD sessions & documents
– FastAPI → File Store: save/read uploaded docs
– FastAPI → Vector Store / LangChain: embedding / vector-based retrieval
– FastAPI → LLM service: streaming chat completions
– FastAPI → Browser: JSON or NDJSON (stream) responses
– Browser: render text, streaming updates, markdown rendering
c. Architectural patterns & design principles:
– Separation of concerns: UI vs. service layer vs. data layer
– Domain-driven API structure (api/chat, api/session, api/documents)
– HTTP abstraction: unified Axios + Fetch with interceptors & cancellation
– State management with Pinia for cross-view state (chat history, docs list)
d. Technologies & frameworks to annotate:
– Vue3 Composition API, Vite, ElementPlus
– Pinia (stores)
– Axios & Fetch wrappers
– Markdown-it + custom plugins/styles
– FastAPI, LangChain, DeepSeek R1, Ollama
– Database (e.g., SQLite/Postgres) and file system or object storage
– Optional vector DB (e.g., Pinecone, Chroma)