How hjariwala25/intellivault works
IntelliVault is a team-scoped document knowledge base: users upload and manage files, documents move through review and processing, and users search or chat with cited answers. The Next.js frontend calls a Hono API; API services coordinate PostgreSQL, Gemini, file storage, and email. The graph includes documented admin, audit, analytics, team, and user-management capabilities. Some subsystem links rely on the README because their implementation files were not sampled; no unsampled source behavior is assumed.
Main entry points: hooks API client hooks · documents.controller.ts Document handling · document-processor.ts Document processor · rag.service.ts RAG orchestration
Components 29
Web application
- Knowledge UI
apps/web/src/app - Document workspace
apps/web/src/components/documents - Chat interface
apps/web/src/components/chat - Search interface
apps/web/src/components/search - Admin console
apps/web/src/app/(dashboard)/admin - API client hooks
apps/web/src/hooks
API workflows
- Hono API
apps/api/src/app.ts - Authentication
apps/api/src/services/auth.service.ts - Document handling
apps/api/src/controllers/documents.controller.ts - Document service
apps/api/src/services/document.service.ts - Document processor
apps/api/src/workers/document-processor.ts - Text extraction
apps/api/src/workers/extractors - Text chunking
apps/api/src/workers/chunking/text-chunker.ts
Search and AI
- RAG endpoints
apps/api/src/controllers/rag.controller.ts - RAG orchestration
apps/api/src/services/rag.service.ts - Semantic search
apps/api/src/services/search.service.ts - Embedding service
apps/api/src/services/embedding.service.ts - Answer generation
apps/api/src/services/llm.service.ts
Teams and governance
- Approval workflow
apps/api/src/services/approval.service.ts - Team and user management
apps/api/src/controllers/users.controller.ts - Analytics and audit
apps/api/src/services/audit.service.ts
Persistence and integrations
- PostgreSQL and pgvector
apps/api/src/db/index.ts - Domain tables
apps/api/src/db/schema - File storage
apps/api/src/lib/uploadthing.ts - Email notifications
apps/api/src/services/email.service.ts - Google Gemini
- Resend
- Shared types and validators
packages/shared/src
Other components
- Employee or admin
Connections 38
- Employee or admin → Knowledge UI: uses
README.md - Knowledge UI → API client hooks: requests data
- Document workspace → API client hooks: requests document APIs
- Chat interface → API client hooks: requests RAG APIs
- Search interface → API client hooks: requests search APIs
- Admin console → API client hooks: requests admin APIs
- API client hooks → Hono API: REST / JSON
README.md - Hono API → Authentication: authenticates
- Hono API → Document handling: routes requests
apps/api/src/app.ts - Document handling → Document service: calls
apps/api/src/controllers/documents.controller.ts - Document handling → Document processor: starts processing
apps/api/src/controllers/documents.controller.ts - Document handling → File storage: uses file storage
apps/api/src/controllers/documents.controller.ts - Document processor → Text extraction: extracts text
apps/api/src/workers/document-processor.ts - Document processor → Text chunking: chunks text
apps/api/src/workers/document-processor.ts - Document processor → Embedding service: generates vectors
apps/api/src/workers/document-processor.ts - Document handling → Analytics and audit: records actions
apps/api/src/controllers/documents.controller.ts - Document workspace → Approval workflow: review workflow
README.md - Approval workflow → Email notifications: sends notifications
README.md - Email notifications → Resend: delivers email
README.md - Admin console → Analytics and audit: views metrics and audit
README.md - Admin console → Team and user management: manages users and teams
README.md - RAG endpoints → RAG orchestration: calls
apps/api/src/controllers/rag.controller.ts - RAG orchestration → Semantic search: retrieves context
apps/api/src/services/rag.service.ts - RAG orchestration → Answer generation: generates answer
apps/api/src/services/rag.service.ts - Semantic search → Embedding service: embeds query
apps/api/src/services/search.service.ts - Embedding service → Google Gemini: requests embeddings
apps/api/src/services/embedding.service.ts - Answer generation → Google Gemini: generates response
apps/api/src/services/llm.service.ts - RAG endpoints → Chat interface: returns cited answers
README.md - Semantic search → Search interface: serves semantic results
README.md - Document service → PostgreSQL and pgvector: reads and writes
apps/api/src/services/document.service.ts - Document service → Domain tables: queries tables
apps/api/src/services/document.service.ts - Embedding service → PostgreSQL and pgvector: stores vectors
apps/api/src/services/embedding.service.ts - RAG orchestration → PostgreSQL and pgvector: stores conversations
apps/api/src/services/rag.service.ts - PostgreSQL and pgvector → Domain tables: uses schema
apps/api/src/db/index.ts - Authentication → Analytics and audit: records auth events
apps/api/src/services/auth.service.ts - Team and user management → Analytics and audit: records actions
apps/api/src/controllers/users.controller.ts - API client hooks → Shared types and validators: uses shared contracts
- RAG endpoints → Shared types and validators: uses shared types
apps/api/src/controllers/rag.controller.ts