DocFlow is a full-stack document intelligence platform for uploading files, extracting text, running OCR, chatting with documents, generating summaries, and performing PDF operations from one workspace.
- Frontend: React, React Router, Zustand, Axios, Tailwind CSS
- Backend: Node.js, Express, Mongoose, Multer
- Database: MongoDB
- Storage: Supabase Storage
- AI/OCR: local AI service, Hugging Face fallback, Tesseract OCR, PDF/DOCX/XLSX/PPTX parsing
- User authentication with JWT
- Upload support for
PDF,DOCX,TXT,PNG,JPG,XLSX, andPPTX - Text extraction and OCR for scanned/image-based documents
- RAG-style document chat
- Key-information document summarization
- PDF compress, merge, and split tools
- Search inside processed document text
- User history and admin dashboard
docfloe/
├── backend/
│ ├── controllers/
│ ├── middleware/
│ ├── models/
│ ├── routes/
│ ├── services/
│ └── server.js
└── frontend/
├── public/
└── src/
- A user signs up or logs in.
- The frontend stores the JWT and calls protected backend routes.
- A document is uploaded through the backend using Multer.
- The backend detects file type and extracts readable text.
- If needed, OCR is used for scanned PDFs or images.
- Extracted text is chunked and stored with document metadata.
- The original file is uploaded to Supabase Storage.
- AI features use the processed chunks for chat and summary generation.
From backend/:
npm install
node server.jsRequired environment variables in backend/.env:
PORT=5000
MONGODB_URI=your_mongodb_connection_string
JWT_SECRET=your_jwt_secret
SUPABASE_URL=your_supabase_url
SUPABASE_ANON_KEY=your_supabase_anon_key
LOCAL_AI_SERVICE_URL=http://localhost:5001
AI_SERVICE_TOKEN=your_internal_ai_service_token
HF_API_KEY=your_huggingface_api_key
HF_FALLBACK_MODEL=your_huggingface_model
FRONTEND_URL=http://localhost:3000Optional local AI service:
python ai_service.pySet the same AI_SERVICE_TOKEN for the Node backend and the local Python service. The backend first tries the local AI service and then falls back to Hugging Face if needed.
From frontend/:
npm install
npm startIf needed, define:
REACT_APP_API_URL=http://localhost:5000/api/api/authfor register, login, and current user/api/documentsfor upload, list, search, and delete/api/aifor summarize, chat, logs, and summary download/api/pdffor compress, merge, split, and document fetch/api/adminfor admin stats, user management, and document management
- Upload pipeline extracts and normalizes document text
- Text is split into chunks
- Chat retrieves relevant chunks and answers from that context
- Summarization retrieves key chunks and generates a concise structured summary
- Fallback logic is used only when AI output is weak or unavailable
- Uploaded files are temporarily stored in
backend/uploads/before processing - Supabase stores the original or generated file
- MongoDB stores document metadata, extracted text, chunk data, chat history, and summaries
Backend:
npm run dev
npm run start
npm run ai-serviceFrontend:
npm start
npm run build