How quynit/connect-work works
Project Type and Purpose
• This is a hybrid monorepo combining:
a) A full-stack enterprise management system (“ConnectWork”) built with a NestJS backend and a Vite/React frontend, plus Firebase for real-time chat/notifications.
b) A standalone Python “ragchatbox” microservice that uses a Retrieval-Augmented Generation (RAG) pipeline (Streamlit UI, FAISS, LangChain, Gemini LLM) to analyze and query internal documents (.docx/.pdf).
Main Components
• Frontend (React + TypeScript + Vite + Tailwind + Redux + Firebase)
• Backend API (NestJS + TypeScript + MongoDB + JWT auth + Google Drive integration)
• AI Microservice (“ragchatbox”) (Python + Streamlit UI + FAISS vector store + Gemini 1.5 Pro + LangChain)
• Datastores:
• MongoDB – primary application data (users, projects, tasks, attendance, payroll, etc.)
• Firebase Firestore – real-time chat & notifications
• Firebase Storage – user-uploaded files/images
• Local or cloud file storage – processed documents for RAG service
• External Services:
• Google Generative AI (Gemini) – LLM for answer generation
• FAISS – vector index for similarity search
• Google Drive API – optional file storage/integration
Relationships & Data Flows
• User’s browser ↔ Frontend: HTTP(S) for UI, WebSockets (or Firestore listeners) for real-time chat/notifications
• Frontend ↔ Backend REST API:
• Auth endpoints → JWT tokens
• CRUD for recruitment, projects, attendance, payroll, tasks
• File uploads (CVs, attachments)
• Frontend ↔ Firebase Firestore/Storage: real-time chat messages, notifications, image uploads
• Backend ↔ MongoDB: persistent storage via NestJS repositories (Repository pattern)
• Backend ↔ Google Drive (google-drive.service): optional storage of assets
• Frontend or Backend ↔ AI Microservice: HTTP or HTTP-based Streamlit interface for document Q&A
• AI Microservice ↔ FAISS: vector index read/write for document chunks
• AI Microservice ↔ Gemini LLM via LangChain: prompt → model → response
Architectural Patterns & Design Principles
• Backend:
• Modular structure (NestJS modules per entity: user, project, task, etc.)
• Controller → Service → Repository layers (standard NestJS / MVC)
• DTOs for input validation and shaping
• Frontend:
• Component hierarchy (layouts, pages, UI components)
• Global state via Redux slices (notifications, auth)
• Contexts for auth
• Microservice:
• RAG pipeline split into extraction, chunking, indexing, query
• Caching via functools.lru_cache for repeated queries
• Separation of Concerns: UI vs business logic vs data access vs AI logic