An insurance claim processing platform with Python FastAPI backend and Next.js frontend.
- DEPLOYMENT.md - Complete deployment and running guide
- SUPABASE_MIGRATION.md - Supabase database setup and migration guide
- STRUCTURE.md - Detailed project structure and commands reference
- API-TESTING.md - API testing examples and scenarios
- SUPABASE_QUICKSTART.md - Quick start guide for Supabase
- Python Backend README - Backend API documentation
InsureScan/
├── backend/ # Python FastAPI backend
│ ├── api/ # FastAPI application & routers
│ │ ├── main.py # Main FastAPI app
│ │ ├── config.py # Configuration settings
│ │ └── routers/ # API route handlers
│ ├── lib/ # Backend utilities (database)
│ ├── services/ # ML service implementations
│ ├── models/ # ML models storage
│ ├── utils/ # Python utilities
│ ├── pyproject.toml # Python dependencies (uv)
│ └── .venv/ # Python virtual environment
├── frontend/ # Next.js frontend application
│ ├── src/
│ │ ├── app/ # Next.js app router pages
│ │ ├── components/ # React components
│ │ └── lib/ # Frontend utilities and API client
│ ├── package.json
│ └── next.config.ts
├── uploads/ # File storage directory
└── Makefile # Main development commands
- FastAPI - Modern async Python web framework
- Supabase (PostgreSQL) - Cloud database with psycopg3
- OpenAI - LLM integration for OCR and queries
- PIL/OpenCV - Image processing
- PyTorch/Transformers - ML models
- uvicorn - ASGI server
- Next.js 15 - React framework with App Router
- React 19 - UI library
- TypeScript - Type safety
- Tailwind CSS - Styling
- Three.js - 3D visualizations
- Node.js (v18 or higher)
- Python (v3.11 or higher)
- Supabase account and project (free tier available)
- uv (Python package manager)
-
Install all dependencies:
make install
Or manually:
# Install Node.js dependencies npm install # Install Python dependencies cd backend uv sync
-
Set up environment variables:
# Backend environment cp backend/.env.example backend/.env # Frontend environment cp frontend/.env.example frontend/.env
Update the
.envfiles with your database credentials, API keys, and other configuration.
Quick Start - Run Everything:
make devThis starts:
- Frontend on
http://localhost:3000 - Python Backend API on
http://localhost:8000
Or run services individually:
# Backend only
make backend
# Frontend only
make frontendAvailable Make Commands:
make help # Show all available commands
make install # Install all dependencies
make clean # Clean build artifacts and cachesOnce running, you can access:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs (Swagger UI)
- API Health Check: http://localhost:8000/health
/api/claims- CRUD operations for insurance claims/api/documents- Document management/api/images- Image upload and processing/api/videos- Video upload and analysis/api/upload- File upload endpoint/api/llm-query- LLM queries/api/ocr- Optical character recognition/api/ml/*- ML damage detection/api/fraud- Fraud detection
# Build frontend
cd frontend
npm run build
npm startFor Python backend, use production ASGI server:
cd backend
uv run uvicorn api.main:app --host 0.0.0.0 --port 8000- Next.js 15 with App Router
- React 19 with TypeScript
- Tailwind CSS styling
- Radix UI components
- Three.js 3D visualization
- Responsive design
- RESTful API with async support
- Supabase PostgreSQL database (psycopg3)
- File upload handling
- OCR with Vision LLM
- LLM integration (Qwen models)
- ML damage detection
- Fraud analysis
- CORS middleware
- Auto-generated API docs (Swagger/ReDoc)
See SUPABASE_MIGRATION.md for detailed setup instructions.
SUPABASE_PROJECT_REF=
SUPABASE_URL=
SUPABASE_ANON_KEY=your_anon_key
# API Keys
DASHSCOPE_API_KEY=your_api_key
BASE_URL=http://localhost:8000
# Server
PORT=8000
HOST=0.0.0.0NEXT_PUBLIC_BACKEND_URL=http://localhost:8000MIT
For more detailed information, see:
- DEPLOYMENT.md - Deployment guide
- STRUCTURE.md - Project structure
- API-TESTING.md - API testing examples
- Make changes in the appropriate package (frontend, backend, or shared)
- Update types in the shared package if needed
- Test both frontend and backend functionality
- Update documentation as necessary
- All API routes have been converted from Next.js API routes to Express.js routes
- Frontend now uses an API client to communicate with the backend
- Database connections are handled exclusively by the backend
- File uploads now go through the Express.js backend
- Shared types are available in the
sharedpackage for consistency