RAG WEB APP
# π± CropSense - Agricultural Guidance Platform
CropSense is an AI-powered agricultural guidance platform that provides farmers with evidence-based answers to their farming questions using RAG (Retrieval-Augmented Generation) technology.
## π Table of Contents
- Overview
- Architecture
- Tech Stack
- Project Structure
- Getting Started
- Development
- Deployment
- Documentation
## π― Overview
CropSense combines trusted agricultural resources with advanced AI to deliver:
- **Context-aware answers** grounded in verified agricultural documents
- **Source citations** for every response
- **Mobile-friendly** chat interface
- **Real-time** query processing
## ποΈ Architecture
```
ββββββββββββββββ
β Web App β
β (React+Vite) β
ββββββββ¬ββββββββ
β
βΌ
ββββββββββββββββ
β Firebase β
β Auth+Hosting β
ββββββββ¬ββββββββ
β
βΌ
ββββββββββββββββ ββββββββββββββββ
β Functions ββββββΆβ RAG Backend β
β (Node.js) β β (FastAPI) β
ββββββββββββββββ ββββββββ¬ββββββββ
β
βΌ
ββββββββββββββββ
β Vertex AI β
β Embeddings + β
β Gemini β
ββββββββββββββββ
```
## π οΈ Tech Stack
### Frontend
- **React 18** - UI library
- **Vite** - Build tool
- **TypeScript** - Type safety
- **Tailwind CSS** - Styling
- **Framer Motion** - Animations
- **React Router** - Navigation
- **TanStack Query** - Data fetching
- **React Hook Form + Zod** - Form handling
### Backend
- **Firebase** - Auth, Hosting, Firestore, Functions
- **FastAPI** (Python) - RAG backend
- **Vertex AI** - Embeddings & Generation
- **Firestore** - Vector storage (MVP)
### Tooling
- **PNPM** - Package manager
- **ESLint + Prettier** - Code quality
- **Vitest** - Testing
- **GitHub Actions** - CI/CD
## π Project Structure
```
.
βββ apps/
β βββ web/ # React frontend application
β βββ src/
β β βββ components/ # React components
β β β βββ ui/ # Base UI components
β β β βββ layouts/ # Layout components
β β βββ pages/ # Page co β¦