This is the Next.js frontend for PolicyPal, an AI-powered insurance assistant that analyzes policies, extracts key fields, and provides smart recommendations — powered by Gemini (Google Generative AI).
- 📄 Upload insurance documents (PDF, PNG, etc.)
- ✨ Extract key fields (premium, vehicle, insurer, etc.)
- 💬 Chat with an AI agent using LangChain + Gemini
- 📊 Get recommendations, summaries, and claim eligibility insights
git clone https://github.com/your-username/policypal-frontend.git
cd policypal-frontendnpm installInside the project root, create a .env.local file and add the following:
MONGODB_URI=""
NODE_ENV=development
NEXT_RUNTIME=edge
GEMINI_API_KEY=""
NEXT_PUBLIC_BACKEND_URL="http://localhost:8000"
GEMINI_MODEL=""Note: Make sure your backend (FastAPI) is running on
http://localhost:8000.
If you haven't done this yet (only needed once):
npx shadcn-ui@latest initThen select Tailwind and configure paths if prompted.
npm run devYour app will be live at: http://localhost:3000
components/
FileUploader.tsx
Navbar.tsx
...
pages/
index.tsx
upload.tsx
hooks/
useUpload.ts
.env.local
Ensure the backend FastAPI server is running on http://localhost:8000. This frontend will poll:
/upload/result/extract/summary
Make sure CORS is enabled in your FastAPI app.
- Next.js 15
- TailwindCSS
- LangChain
- Google Gemini API
- shadcn/ui