InsightDocs is an AI-powered document intelligence platform that lets users upload PDFs, process their contents, search through them semantically, and ask questions in natural language.
The project is built as a full-stack SaaS-style application with a React frontend, an Express backend, MongoDB persistence, and Gemini-powered AI features.
- Secure authentication with JWT
- Protected dashboard experience
- PDF upload and storage
- PDF text extraction and processing
- Text chunking for downstream retrieval
- Embedding generation for semantic search
- Semantic search over document chunks
- AI chat for document Q&A
- Persistent chat history per document
- User profile management
- Production-ready deployment configuration for Render and Vercel
- React
- Vite
- Tailwind CSS
- React Router
- Axios
- Node.js
- Express.js
- MongoDB + Mongoose
- JWT + bcrypt
- Multer
- Google Gemini API
- Render for the backend
- Vercel for the frontend
- MongoDB Atlas for data persistence
flowchart TB
Client[React client\nAuthentication · Dashboard · Upload · Chat · History · Profile]
Client -->|HTTPS / REST API| API[Express API]
subgraph Services[Backend services]
Auth[Auth service\nRegister · Login · JWT]
User[User service\nProfile · Settings]
Documents[Document service\nUpload · Extract text · Metadata]
RAG[RAG service\nChunk · Embed · Retrieve]
Chat[Chat service\nConversation · Answer · History]
end
API --> Auth
API --> User
API --> Documents
API --> RAG
API --> Chat
Documents --> RAG --> Chat
Chat --> Gemini[Google Gemini API]
RAG --> Embeddings[Gemini embedding model]
Auth --> Mongo[(MongoDB)]
User --> Mongo
Documents --> Mongo
RAG --> Mongo
Chat --> Mongo
The dashboard runs the document workflow after upload: upload → text extraction → chunking → embeddings. This keeps each document ready for semantic search and chat as soon as it appears in the document list.
InsightDocs/
├── backend/
│ ├── src/
│ │ ├── app.js
│ │ ├── server.js
│ │ ├── config/
│ │ ├── controllers/
│ │ ├── middleware/
│ │ ├── models/
│ │ └── routes/
│ ├── test/
│ ├── package.json
│ └── .env.example
├── frontend/
│ ├── src/
│ │ ├── api/
│ │ ├── components/
│ │ ├── pages/
│ │ └── App.jsx
│ ├── package.json
│ └── vite.config.js
├── DEPLOYMENT.md
├── project_plan.md
└── changelog.md
- Node.js 18+
- npm 9+
- MongoDB Atlas account
- Google Gemini API key
cd backend
npm install
cp .env.example .env
npm run devcd frontend
npm install
npm run devCreate a .env file in the backend using the values from .env.example.
Required variables:
- PORT
- NODE_ENV
- CLIENT_URL
- MONGODB_URI
- JWT_SECRET
- JWT_EXPIRES_IN
- GEMINI_API_KEY
- POST /api/auth/register
- POST /api/auth/login
- GET /api/auth/me
- POST /api/auth/logout
- POST /api/documents
- GET /api/documents
- POST /api/documents/:documentId/process
- POST /api/documents/:documentId/chunk
- POST /api/documents/:documentId/embed
- POST /api/documents/:documentId/search
- POST /api/documents/:documentId/chat
- GET /api/documents/:documentId/chat-history
- GET /api/profile
- PUT /api/profile
- GET /api/health
Placeholder screenshots will be added here after deployment:
- Dashboard overview
- PDF upload experience
- AI chat experience
- Profile settings
- Add file deletion and document management workflows
- Add richer chat history controls such as delete and rename
- Improve chunking and retrieval quality
- Add support for multi-document conversation context
- Introduce streaming AI responses
- Improve observability and analytics
Contributions are welcome.
- Fork the repository
- Create a feature branch
- Commit your changes
- Open a pull request
This project is licensed under the MIT License.