AI-powered document analysis and chat system using Google Vertex AI Search and Gemini.
Backend: Spring Boot 3.4 (Java 21), Google Cloud Platform Frontend: Next.js 16, React, TypeScript, Tailwind CSS Infrastructure: Vertex AI Search, Firestore, Cloud Storage, Gemini 2.5 Pro
- Project Management - Organize documents into isolated projects
- Document Storage - Upload PDFs, DOCX, TXT via signed URLs to GCS
- Flexible Storage - Use managed storage or Bring Your Own Bucket (BYOB) from GCS
- RAG Chat - Context-aware chat with document grounding and citations
- Search Infrastructure - Auto-provision Vertex AI Search datastores per project
- System Instructions - Customizable AI personas/prompts
- Real-time Streaming - Server-sent events for live chat responses
- Dark Mode - Responsive UI with theme support
- Java 21+
- Node.js 18+
- Google Cloud Project with billing enabled
- gcloud CLI authenticated
Your service account needs:
roles/firestore.user
roles/storage.admin
roles/discoveryengine.admin
roles/aiplatform.user
Enable APIs:
gcloud services enable \
firestore.googleapis.com \
storage.googleapis.com \
discoveryengine.googleapis.com \
aiplatform.googleapis.comCreate .env in project root:
GOOGLE_CLOUD_PROJECT=your-project-id
GCS_BUCKET_NAME=your-bucket-name
GEMINI_API_KEY=your-api-key # Optional if using Vertex AI
GEMINI_MODEL=gemini-2.5-pro
GCP_LOCATION=us-central1Apply CORS to your bucket:
gsutil cors set gcs_cors.json gs://your-bucket-namecd api
mvn spring-boot:runBackend runs on http://localhost:8080
cd web
npm install
npm run devFrontend runs on http://localhost:3000
- Create Project - Set up a new document project (Managed or BYOB)
- Upload Documents - Add files directly or use your external bucket
- Provision Search - Automatically creates Vertex AI datastore
- Sync Index - Import documents into the search index
- Create Chat - Select a system instruction and start chatting
- Query Documents - Ask questions and get cited answers
Managed Mode:
- We host your files in our central GCS bucket.
- You upload files directly via the UI.
BYOB Mode (Bring Your Own Bucket):
- You provide your own GCS bucket name and optional prefix.
- You manage file uploads using
gsutilor the GCS Console. - Requirement: Our service account needs
Storage Object Viewerpermission on your bucket.
┌─────────────┐ ┌──────────────┐ ┌─────────────────┐
│ Next.js │────▶│ Spring Boot │────▶│ Google Cloud │
│ Frontend │ │ REST API │ │ - Firestore │
└─────────────┘ └──────────────┘ │ - GCS │
│ - Vertex AI │
└─────────────────┘
doctalk/
├── api/ # Spring Boot backend
│ └── src/main/java/ # Controllers, Services, Models
├── web/ # Next.js frontend
│ ├── src/app/ # App routes
│ └── src/components/ # React components
└── docs/ # Documentation