This project provides an full stack application with a UI chatbot and RAG pipeline using google drive data to give contextual answers.
- Sample Deployment: http://20.117.106.138/
Screen.Recording.2025-06-29.at.3.mp4
- Prerequisites
- Project Structure
- Backend Setup (Credentials & Environment Variables)
- How to Install Docker
- Running the Application with Docker Compose
- Troubleshooting
- Docker Engine & Docker Compose: These will be installed via your Linux distribution's package manager.
| Layer | Technology | Why |
|---|---|---|
| Frontend | React (with Tailwind UI) | Responsive, easy integration with chatbot UI |
| Backend | FastAPI (Python) | Lightweight, async, perfect for ML workloads |
| Embedding Model | Google's models/embedding-001 | Efficient and high-quality embeddings |
| LLM for RAG | Gemini via LangChain | Versatile, works well with RAG pipelines |
| Vector Store | FAISS | Fast similarity search for embeddings |
| File Parsing | unstructured, PyMuPDF, docx, pdfplumber | Handles various file formats |
| Google Drive Integration | Google Drive API + Google Auth | Authenticated, scoped access to user files |
| Orchestration | LangChain | Makes RAG pipeline setup easier |
| Deployment | Docker + Azure | Scalable, production-grade setup |
.
├── backend/
│ ├── main.py
│ ├── requirements.txt
│ ├── credentials.json # Google Service Account JSON (user added)
│ └── .env # GOOGLE_API_KEY (user added)
│ └── ...
├── ai-assistant-ui/
│ ├── package.json
│ ├── src/
│ ├── public/
│ ├── nginx.conf # Nginx config for UI
│ └── ...
├── Dockerfile.backend # Backend Dockerfile
├── Dockerfile.ai-assistant-ui # UI Dockerfile
└── docker-compose.yml # Docker Compose config
For security, credentials.json and .env are not committed to version control.
- credentials.json:
- Obtain: From Google Cloud Console > IAM & Admin > Service Accounts > Create new key (JSON).
- Place: backend/credentials.json
- .env file:
- Create: backend/.env
- Content: GOOGLE_API_KEY=YOUR_GOOGLE_API_KEY_HERE (Obtain from Google AI Studio).
Install Docker Engine and Docker Compose for your Linux distribution.
-
For Debian/Ubuntu:
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
sudo usermod -aG docker $USER # Add user to docker group
# Log out and log back in for changes to take effect -
For other Linux distributions: Refer to the official Docker documentation:
Verify installation and user permissions:
docker --version
docker compose version
docker run hello-world # Should run without permission errors
-
Navigate: Go to the project root where docker-compose.yml is located.
cd /path/to/your/project/root -
Build & Run:
docker compose up --buildThis builds images and starts both services. Logs will appear in the terminal.
-
Access:
- AI Assistant UI: http://localhost:80
- Backend: http://localhost:8000 (accessed by UI)
-
Stop:
- Stop containers: docker compose stop
- Stop & remove: docker compose down
- Stop, remove containers & images: docker compose down --rmi all
-
Container issues: Check logs with docker compose logs <service_name>.
-
Permissions (Docker Daemon): If you get "permission denied", ensure your user is in the docker group and you've logged out/in.
sudo usermod -aG docker $USER
# Log out and back in -
AI Assistant UI: Verify npm run build completed, check browser console.
-
Backend: Check main.py entry point, GOOGLE_API_KEY in .env.