Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InsightDocs

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.

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

Tech Stack

Frontend

  • React
  • Vite
  • Tailwind CSS
  • React Router
  • Axios

Backend

  • Node.js
  • Express.js
  • MongoDB + Mongoose
  • JWT + bcrypt
  • Multer
  • Google Gemini API

Deployment

  • Render for the backend
  • Vercel for the frontend
  • MongoDB Atlas for data persistence

Project Architecture

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
Loading

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.

Folder Structure

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

Installation Guide

Prerequisites

  • Node.js 18+
  • npm 9+
  • MongoDB Atlas account
  • Google Gemini API key

Backend

cd backend
npm install
cp .env.example .env
npm run dev

Frontend

cd frontend
npm install
npm run dev

Environment Variables

Create 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

API Documentation

Authentication

  • POST /api/auth/register
  • POST /api/auth/login
  • GET /api/auth/me
  • POST /api/auth/logout

Documents

  • 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

Profile

  • GET /api/profile
  • PUT /api/profile

Health

  • GET /api/health

Screenshots

Placeholder screenshots will be added here after deployment:

  • Dashboard overview
  • PDF upload experience
  • AI chat experience
  • Profile settings

Future Improvements

  • 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

Contributing

Contributions are welcome.

  1. Fork the repository
  2. Create a feature branch
  3. Commit your changes
  4. Open a pull request

License

This project is licensed under the MIT License.

About

AI-powered document intelligence platform built with the MERN stack, Google Gemini API, and Retrieval-Augmented Generation (RAG) for intelligent document question answering.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages