A production-ready, multi-tenant Retrieval-Augmented Generation (RAG) platform that ingests enterprise documents (PDF, DOCX, TXT, MD), indexes them using vector embeddings into PostgreSQL (pgvector), and generates high-precision, hallucination-resistant answers with clickable source citations, executive summaries, and LaTeX mathematical rendering.
π Live Application Β· π API Documentation Β· π System Architecture Β· π Getting Started
|
Instant file acceptance with non-blocking vector processing in the background.
|
Hardened rate-limit architecture designed to survive free-tier cloud quotas without errors.
|
|
Sub-millisecond similarity retrieval powered by pgvector on Neon Cloud.
|
Split-engine architecture combining specialized embedding with extreme inference speed.
|
|
High-polish React 19 frontend engineered for developer and research workflows.
|
Isolated data segregation and stateless security out-of-the-box.
|
flowchart TD
subgraph Client ["π₯οΈ Frontend β Vercel CDN"]
UI["React 19 + Vite SPA\nTailwind CSS + Lucide"]
end
subgraph CloudBackend ["βοΈ Backend β Render.com"]
API["Spring Boot 4.1.2 (Java 25)\nDocker Runtime"]
SEC["Spring Security + JWT Filter"]
ASYNC["Async Ingestion Service\n(@Async Thread Pool)"]
RAG["RAG Orchestration Engine"]
end
subgraph DataStore ["ποΈ Database β Neon Cloud"]
PG[("PostgreSQL 18")]
VEC[("pgvector HNSW Index\n768 Dimensions")]
end
subgraph AIProviders ["π§ External AI Services"]
GEMINI["Google Gemini API\nbatchEmbedContents β 768d"]
GROQ["Groq Cloud\nQwen 3.8-27b Ultra-Fast LLM"]
end
UI -->|"HTTPS REST + JWT"| API
API --> SEC
SEC --> ASYNC
SEC --> RAG
ASYNC -->|"Batch Embeddings"| GEMINI
ASYNC -->|"Store Vectors"| VEC
RAG -->|"Cosine Similarity"| VEC
RAG -->|"Context + Prompt"| GROQ
GROQ -->|"Streamed Reasoning"| RAG
RAG -->|"Structured Answer"| UI
| Layer | Technology | Purpose |
|---|---|---|
| ποΈ Backend | Spring Boot 4.1.2 Β· Java 25 | Enterprise microservice runtime |
| π§ AI Layer | Spring AI 2.0.1 | Vector store abstraction & model orchestration |
| ποΈ Database | PostgreSQL 18.6 (Neon Cloud) | Serverless relational storage |
| π Vectors | pgvector 0.8.6 | HNSW cosine similarity (768 dimensions) |
| π₯οΈ Frontend | React 19 Β· TypeScript Β· Vite 8 | High-performance reactive SPA |
| π¨ Styling | Tailwind CSS v4 | Futuristic dark glassmorphic design |
| π³ Container | Docker (eclipse-temurin:25-jre) |
Multi-stage production build |
| βοΈ Hosting | Render + Vercel + Neon | Globally distributed deployment |
docu-mind-ai/
β
βββ π¦ docu-mind-ai-backend/ # Spring Boot 4 (Java 25) REST API
β βββ src/main/java/com/documind/
β β βββ config/ # AiConfig, SecurityConfig, CorsConfig
β β βββ controller/ # Auth, Document, Chat, Search Controllers
β β βββ dto/ # Request/Response records
β β βββ entity/ # JPA Entities (User, DocumentMetadata)
β β βββ repository/ # Spring Data Repositories
β β βββ service/ # Document Parsing, Ingestion, RAG Services
β β βββ filter/ # JWT Authentication Filter
β βββ src/main/resources/
β β βββ application.yaml # Profile router
β β βββ application-dev.yml # Local development config
β β βββ application-prod.yml # Production configuration
β βββ Dockerfile # Multi-stage container build
β βββ pom.xml
β
βββ π¨ docu-mind-ai-frontend/ # React 19 + Vite + Tailwind Client
β βββ src/
β β βββ components/ # ChatWindow, UploadModal, Navbar, Sidebar
β β βββ context/ # AuthContext, ChatContext
β β βββ hooks/ # useDocuments, useChat
β β βββ pages/ # Dashboard, Chat, Documents, Search, Login
β β βββ services/ # Axios API clients
β βββ vercel.json # SPA routing configuration
β βββ package.json
β
βββ π README.md
| Requirement | Version | Link |
|---|---|---|
| Java JDK | 25+ | Adoptium Temurin |
| Node.js | 20+ | nodejs.org |
| PostgreSQL | 16+ with pgvector |
postgresql.org |
| Groq API Key | β | Groq Console |
| Gemini API Key | β | Google AI Studio |
CREATE DATABASE documind;
\c documind;
CREATE EXTENSION IF NOT EXISTS vector;cd docu-mind-ai-backend
# Set environment variables (or configure in application-dev.yml)
export GROQ_API_KEY="your-groq-key"
export GEMINI_API_KEY="your-gemini-key"
export JWT_SECRET="your-256-bit-jwt-secret-string"
# Build and run
./mvnw clean spring-boot:runBackend starts at
http://localhost:8080
Swagger UI athttp://localhost:8080/swagger-ui.html
cd docu-mind-ai-frontend
npm install
npm run devFrontend launches at
http://localhost:5173
Backend β application-prod.yml
| Variable | Description | Example |
|---|---|---|
SPRING_PROFILES_ACTIVE |
Active Spring profile | prod |
SPRING_DATASOURCE_URL |
PostgreSQL JDBC URL | jdbc:postgresql://host:5432/documind?sslmode=require |
SPRING_DATASOURCE_USERNAME |
Database username | neondb_owner |
SPRING_DATASOURCE_PASSWORD |
Database password | β’β’β’β’β’β’β’β’ |
GROQ_API_KEY |
Groq LLM API Key | gsk_... |
GEMINI_API_KEY |
Google Gemini API Key | AIzaSy... |
JWT_SECRET |
JWT signing secret | min-64-character-secret |
PORT |
Server port (Render injected) | 8080 / 10000 |
Frontend β .env
| Variable | Description | Example |
|---|---|---|
VITE_API_BASE_URL |
Backend API base URL | https://docu-mind-ai-l4nr.onrender.com |
| Method | Endpoint | Auth | Description |
|---|---|---|---|
POST |
/api/v1/auth/register |
π | Register new user account |
POST |
/api/v1/auth/login |
π | Authenticate & issue JWT |
POST |
/api/v1/documents/upload |
π | Upload document & start async ingestion |
GET |
/api/v1/documents |
π | List all user-owned documents |
GET |
/api/v1/documents/{id} |
π | Get document status & metadata |
DELETE |
/api/v1/documents/{id} |
π | Delete document & vector chunks |
POST |
/api/v1/chat |
π | RAG conversational query |
POST |
/api/v1/search/similarity |
π | Direct vector similarity search |
flowchart LR
A["π¨ Frontend\nVite Build"] -->|"Deploy"| B["β² Vercel\nEdge CDN"]
C["βοΈ Backend\nDocker Image"] -->|"Deploy"| D["π’ Render.com\nSingapore"]
D -->|"JDBC"| E["π Neon Cloud\nap-southeast-1"]
| Component | Platform | Region | Notes |
|---|---|---|---|
| Frontend | Vercel | Edge (Global) | Vite build + SPA rewrites |
| Backend | Render.com | Singapore | Docker, unprivileged spring:spring user |
| Database | Neon.tech | ap-southeast-1 | Serverless PostgreSQL 18 + pgvector |
Built with β€οΈ by Sagar Sharma