How mohdzain98/docschat works
Project type and purpose
• Docschat is a full-stack, microservices-based web application that lets users upload and conversationally interact with various document types (PDF, TXT, CSV, PPTX, etc.) using Large Language Models (LLMs) and specialized retrieval tools.
File structure
• Top-level “Microservices” directory containing:
• LLM service (Python Flask) – handles document parsing, LLM queries, SQL execution, text extraction.
• User_auth service (Node.js/Express) – manages registration, login, JWT auth, user data models (Mongo or similar).
• “src” and “public” directories – React front-end application with Components, Context, State folders.
• “build” – production output of the React app.
• Configs: package.json, requirements.txt, GitHub Actions workflows for CI/CD per microservice.
README for additional insights
• Architecture description confirms microservices: Authentication, LLM processing, and a Tools service for Exa Search, Google Trends, Scholar, PubMed.
• Workflow: user logs in → uploads document → redirected to chat UI → front end sends queries to LLM service with auth token → LLM service orchestrates extraction and third-party tool calls.
a. Main components:
• Client (web browser)
• Front-end React application
• API Gateway or Front-end proxy
• User Authentication Microservice (Node.js/Express)
• LLM Microservice (Python Flask + bicycle.db)
• Tools Microservice / External Tools (SerpApi for Trends, Google Scholar API, PubMed API, Exa Search engine)
• Data stores: user database (MongoDB or similar), bicycle.db (SQLite), file storage (local or cloud)
• External LLM provider (OpenAI, Hugging Face)
b. Relationships and interactions:
1. User → React UI → Auth service (login/register) → issues JWT
2. React UI (with JWT) → API Gateway → routes to LLM service for document upload & chat queries
3. LLM service reads document from file storage, extracts text (pdf, pptx, spreadsheet modules), queries external LLM or internal chain logic, queries Tools service endpoints as needed
4. LLM service returns response to React UI
5. Auth service and LLM service persist data in their respective databases
c. Architectural patterns and design principles:
• Microservices: each service has its own repo, CI/CD, and runtime
• Stateless front-end communicates over REST/HTTP with backend services
• Token-based authentication (JWT) for API security
• Separation of concerns: Auth, LLM processing, and Tools retrieval in distinct services
• Externalized configuration (requirements.txt, package.json, GitHub workflows)
d. Key technologies and frameworks:
• Front-end: React, Context API, Redux-like state management
• Auth service: Node.js, Express, Mongoose (Mongo)
• LLM service: Python, Flask, SQLite (bicycle.db), custom document parsers
• Tools: SerpApi, Google Trends API, Scholar scraping modules, PubMed API
• CI/CD: GitHub Actions workflows per microservice