How hlong24082k/doc-mind works
This repository implements a document-oriented chat web app: users sign in, manage documents, and can enter a chat flow, with the server exposing API routes and a Gemini-backed streaming service. The sampled client code confirms routing, authentication state, and API service calls; the sampled server code confirms router mounting, MongoDB connection setup, and LLM streaming. Endpoint internals and several page implementations were not sampled, so uncertain wiring is left out.
Main entry points: router.tsx App routes · routers API routes · main.py HTTP API · apiClient.ts API client
Components 26
Web client
- App routes
client/src/router.tsx - Login page
client/src/pages/LoginPage.tsx - Signup page
client/src/pages/SignupPage.tsx - Chat page
client/src/pages/ChatPage.tsx - Documents page
client/src/pages/DocumentsPage.tsx - Auth state
client/src/store/authStore.ts - Auth service
client/src/api/services/auth.service.ts - Document service
client/src/api/services/document.service.ts - API client
client/src/api/apiClient.ts
API server
- HTTP API
server/src/app/main.py - API routes
server/src/app/routers - Auth endpoints
server/src/app/routers/auth/endpoint.py - Document endpoints
server/src/app/routers/document/endpoint.py - Conversation endpoints
server/src/app/routers/conversation/endpoint.py - Chat stream service
server/src/app/routers/conversation/services.py
Persistence
- Mongo session
server/src/app/db/session.py - Document CRUD
server/src/app/cruds/document.py - User CRUD
server/src/app/cruds/user.py - Data models
server/src/app/models
Chat generation
- LLM interface
server/src/app/core/llm/base.py - Gemini provider
server/src/app/core/llm/gemini_provider.py - Prompt templates
server/src/app/core/prompt/prompt_templates.py - Response processing
server/src/app/core/llm/post_processor.py
Other components
- User
- MongoDB
- Gemini API
Connections 19
- User → App routes: uses
- App routes → Login page: routes
- App routes → Signup page: routes
- App routes → Chat page: routes
- App routes → Documents page: routes
- App routes → Auth state: checks access
- Auth state → Auth service: calls
- Auth service → API client: requests
- Document service → API client: requests
- API client → HTTP API: sends HTTP
- HTTP API → API routes: mounts
- HTTP API → Mongo session: initializes
- API routes → Auth endpoints
- API routes → Document endpoints
- API routes → Conversation endpoints
- Mongo session → MongoDB: connects
- Chat stream service → LLM interface: uses
- Chat stream service → Gemini provider: defaults to
- Gemini provider → Gemini API: generates from