- Python 3.11+
- Docker and Docker Compose
- Gemini API Key:
- Go to Google AI Studio.
- Click Create API Key.
- Copy the key (starts with
AIza...).
- Tesseract OCR: (Optional, for OCR support)
- Ubuntu:
sudo apt-get install tesseract-ocr - macOS:
brew install tesseract - Windows: Installation Guide
- Ubuntu:
git clone https://github.com/HarshilMaks/InsightDocs.git
cd InsightDocscp .env.example .env
# Edit .env and add your GEMINI_API_KEYdocker-compose up -dThis starts:
- PostgreSQL database
- Redis message broker
- MinIO object storage
- FastAPI application (port 8000)
- Celery worker
- API: http://localhost:8000
- API Documentation: http://localhost:8000/api/v1/docs
- MinIO Console: http://localhost:9001 (minioadmin/minioadmin)
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install dependencies
uv pip install -r requirements.txt
# Terminal 1: Start API
uvicorn backend.api.main:app --reload
# Terminal 2: Start worker
celery -A backend.workers.celery_app worker --loglevel=infoNote: Run
python cli.py loginfirst to authenticate.
# Login
python cli.py login --email user@example.com --password secret
# Check system health
python cli.py health
# Upload document
python cli.py upload document.pdf
# Query documents
python cli.py query "What is this about?"
# List documents
python cli.py list-documents
# Check task status
python cli.py status <task-id>Note: All endpoints require authentication. First, obtain a token via
/api/v1/auth/login.
Login & Get Token:
curl -X POST "http://localhost:8000/api/v1/auth/login" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "username=user@example.com&password=yourpassword"Upload Document:
curl -X POST "http://localhost:8000/api/v1/documents/upload" \
-H "Authorization: Bearer <your_token>" \
-F "file=@document.pdf"Query Documents:
curl -X POST "http://localhost:8000/api/v1/query/" \
-H "Authorization: Bearer <your_token>" \
-H "Content-Type: application/json" \
-d '{"query": "What is this about?", "top_k": 5}'Summarize Document:
curl -X POST "http://localhost:8000/api/v1/documents/{document_id}/summarize" \
-H "Authorization: Bearer <your_token>"Generate Quiz:
curl -X POST "http://localhost:8000/api/v1/documents/{document_id}/quiz" \
-H "Authorization: Bearer <your_token>" \
-H "Content-Type: application/json" \
-d '{"num_questions": 5}'Create Mind Map:
curl -X POST "http://localhost:8000/api/v1/documents/{document_id}/mindmap" \
-H "Authorization: Bearer <your_token>"- Text files (.txt)
- PDF documents (.pdf)
- Word documents (.docx)
- PowerPoint presentations (.pptx)
- Maximum file size: 50MB
- Port conflicts: Ensure ports 8000, 5432, 6379, 9000 are available
- Service startup: Check logs with
docker-compose logs - Environment: Verify
.envfile contains validGEMINI_API_KEY
# View all service logs
docker-compose logs
# Check specific service
docker-compose logs api
docker-compose logs worker