How learncodewithdurgesh/docmind-rag-based-project works
DocMind is a web application for uploading documents, indexing their text, and asking questions or running semantic searches over the indexed content. The main workflow is upload → parse → chunk and index → retrieve relevant chunks → return answers with citations. Users can also register and log in, manage documents and conversations, view chunks, and stream chat responses. The upload, retrieval, and authentication paths are supported by sampled source; several frontend and persistence connections are inferred only from the module names and are therefore omitted.
Main entry points: App.tsx Application shell · DocumentMetadataService.java Document management · RagService.java RAG and search · AuthController.java Auth endpoints
Components 25
Web frontend
- Application shell
frontend/docmind-frontend/src/App.tsx - Document views
frontend/docmind-frontend/src/components/Sidebar.tsx - Upload dialog
frontend/docmind-frontend/src/components/UploadDialog.tsx - Chat view
frontend/docmind-frontend/src/components/ChatView.tsx - Search view
frontend/docmind-frontend/src/components/SearchView.tsx - Chunks view
frontend/docmind-frontend/src/components/ChunksView.tsx - Login and register
frontend/docmind-frontend/src/pages/Login.tsx
Authentication
- Auth endpoints
src/main/java/com/substring/docmind/controller/AuthController.java - User service
src/main/java/com/substring/docmind/service/UserService.java - JWT service
src/main/java/com/substring/docmind/service/JwtService.java - JWT security filter
src/main/java/com/substring/docmind/config/JwtAuthenticationFilter.java
Document indexing
- Document endpoints
src/main/java/com/substring/docmind/controller/DocumentController.java - Document management
src/main/java/com/substring/docmind/service/DocumentMetadataService.java - Document parser
src/main/java/com/substring/docmind/service/DocumentParserService.java - Chunk and index
src/main/java/com/substring/docmind/service/DocumentIngestionService.java
Retrieval and chat
- Chat endpoints
src/main/java/com/substring/docmind/controller/ChatController.java - RAG and search
src/main/java/com/substring/docmind/service/RagService.java - Chat memory
src/main/java/com/substring/docmind/service/JpaChatMemory.java
Persistence and models
- Document metadata repository
src/main/java/com/substring/docmind/repository/DocumentMetadataRepo.java - Conversation repository
src/main/java/com/substring/docmind/repository/ConversationRepository.java - Chat message repository
src/main/java/com/substring/docmind/repository/ChatMessageRepository.java - Vector store
- Relational database
Other components
- User
- Chat model
Connections 33
- User → Application shell: uses
- Application shell → Document views: renders
- Application shell → Upload dialog: opens
- Application shell → Chat view: renders
- Application shell → Search view: renders
- Application shell → Chunks view: renders
- User → Login and register: submits credentials
- Login and register → Auth endpoints: authenticates
- Auth endpoints → User service: registers users
- Auth endpoints → JWT service: creates token
- JWT security filter → JWT service: validates token
- User → Upload dialog: selects files
- Upload dialog → Document endpoints: uploads files
- Document endpoints → Document management: manages documents
- Document management → Document parser: parses file
- Document management → Chunk and index: indexes parsed text
- Document management → Document metadata repository: saves metadata
- Chunk and index → Vector store: writes chunks
- Chunk and index → Document metadata repository: updates status
- Document endpoints → Document management: lists and deletes
- User → Chat view: asks question
- Chat view → Chat endpoints: submits question
- Search view → Chat endpoints: searches chunks
- Chat endpoints → RAG and search: dispatches request
- RAG and search → Vector store: retrieves matches
- RAG and search → Chat model: generates answer
- RAG and search → Conversation repository: manages conversations
- Chat memory → Chat message repository: loads and stores messages
- RAG and search → Chat memory: uses memory
- Document metadata repository → Relational database: reads and writes
- Conversation repository → Relational database: reads and writes
- Chat message repository → Relational database: reads and writes
- Document management → Vector store: purges document vectors