An end-to-end full-stack web application that helps users compare insurance policies, get personalized AI recommendations based on a 12-factor risk profile, file and track claims, and receive real-time background email notifications on status updates.
This platform was built to simplify the complex world of insurance for everyday users. Whether someone is looking for the right health, auto, home, life, or travel policy β this system analyses their personal profile and recommends the most suitable options.
Key Highlights:
- Users fill in a 12-factor risk profile (age, occupation, health, lifestyle, etc.)
- The recommendation engine scores and ranks all available policies
- Users can purchase policies and file claims with document uploads (stored on AWS S3)
- Admins review claims through a dedicated panel and update statuses
- Every status update triggers an automatic background email to the user via Celery + Redis
| Feature | Description |
|---|---|
| Authentication | Secure JWT-based login and signup |
| Dashboard | Personalized policy recommendations with scores |
| Policy Catalog | Browse Health, Auto, Home, Life, Travel policies |
| Compare Policies | Compare up to 3 policies side-by-side |
| Premium Calculator | Estimate premium based on age and coverage |
| Risk Profile | 12-factor lifestyle and financial profile editor |
| My Policies | View all purchased policies |
| File a Claim | 5-step guided claim wizard with document uploads |
| Claim Timeline | Live status history for each claim |
| Email Alerts | Auto email when admin updates claim status |
| Feature | Description |
|---|---|
| Admin Dashboard | Stats on total claims, amounts, pending actions |
| Claims Queue | Filter, search, and review all claims |
| Claim Detail Panel | View full claim info, documents, and history |
| Status Transitions | Strict workflow: Submit β Review β Approve/Reject β Pay |
| Background Emails | FastAPI triggers a Celery task (non-blocking) to email the user |
| Layer | Technology |
|---|---|
| Frontend | React + Vite + Tailwind CSS |
| Backend | FastAPI (Python) |
| Database | PostgreSQL + SQLAlchemy |
| Auth | JWT (python-jose) |
| File Uploads | AWS S3 |
| Background Tasks | Celery + Redis |
| Python smtplib (Gmail SMTP) |
- Download: https://git-scm.com/downloads
- Verify:
git --version
- Download: https://www.python.org/downloads
β οΈ During install β check "Add Python to PATH"- Verify:
python --version
- Download: https://nodejs.org β choose LTS
- Verify:
node --versionandnpm --version
- Download: https://www.postgresql.org/download/
- During install, set a password for the
postgresuser β remember it - Default port:
5432 - After install, open pgAdmin and create a database named:
insurance_db
- Download: https://www.docker.com/products/docker-desktop/
- Install and open Docker Desktop before running the app
- Verify:
docker --version
git clone https://github.com/springboardmentor053-cyber/Insurance-Comparison-Recommendation-Claim-Assistant.git
cd Insurance-Comparison-Recommendation-Claim-Assistantcd backendpython -m venv venv
venv\Scripts\activateYou should see (venv) at the start of the terminal.
pip install -r requirements.txtInside the backend/ folder, create a file named .env and paste the following β filling in your own values:
# βββ App Security ββββββββββββββββββββββ
SECRET_KEY=your-random-secret-key-here
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
# βββ PostgreSQL Database βββββββββββββββ
POSTGRES_USER=postgres
POSTGRES_PASSWORD=YOUR_POSTGRES_PASSWORD
POSTGRES_SERVER=localhost
POSTGRES_PORT=5432
POSTGRES_DB=insurance_db
# βββ AWS S3 (for document uploads) βββββ
AWS_ACCESS_KEY_ID=YOUR_AWS_KEY
AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET
AWS_S3_BUCKET_NAME=YOUR_BUCKET_NAME
AWS_REGION=ap-south-1
# βββ Email / SMTP (Gmail) ββββββββββββββ
SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_USER=your_email@gmail.com
SMTP_PASSWORD=your_16_char_gmail_app_password
EMAILS_FROM_EMAIL=your_email@gmail.com
# βββ Celery / Redis ββββββββββββββββββββ
REDIS_URL=redis://localhost:6379/0π Gmail App Password: Go to Google Account β Security β 2-Step Verification β App Passwords. Generate one for this app.
π AWS S3: Create a bucket in AWS S3 and add the credentials. Used for storing claim documents.
python ../database/create_tables.py
python seed.pypython check_config.pyThis prints all loaded settings so you can confirm everything is reading from .env properly.
Make sure Docker Desktop is open first (for Redis), then run:
.\start_backend.ps1This script will automatically:
- β
Check your
.envfile exists - β Verify and print all credentials
- β Start Redis via Docker if not already running
- β Open a new terminal window with the Celery email worker
- β
Start the FastAPI server with
uvicorn --reload
β οΈ First-time PowerShell users: If you get a script execution error, run this first:Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
β
Backend API: http://localhost:8000
β
API Docs (Swagger): http://localhost:8000/docs
Open a new terminal window:
cd frontend
npm install
npm run devβ Frontend App: http://localhost:5173
Open your browser and go to http://localhost:5173
| Role | Password | |
|---|---|---|
| User | user@example.com |
password |
| Admin | admin@example.com |
password |
Or click Sign Up to create a new account.
| Task | Command | Run in |
|---|---|---|
| Start full backend | .\start_backend.ps1 |
backend/ |
| Start frontend | npm run dev |
frontend/ |
| Check .env config | python check_config.py |
backend/ |
| Start Celery only | celery -A app.worker.celery_app worker --loglevel=info --pool=solo |
backend/ |
| API docs | http://localhost:8000/docs | Browser |
| App URL | http://localhost:5173 | Browser |
Insurance-Comparison-Recommendation-Claim-Assistant/
βββ backend/
β βββ app/
β β βββ main.py # FastAPI app entry point
β β βββ core/
β β β βββ config.py # Settings loaded from .env
β β β βββ celery_app.py # Celery application setup
β β βββ models/ # SQLAlchemy DB models
β β β βββ user.py
β β β βββ policy.py
β β β βββ claim.py # Includes ClaimStatusHistory
β β β βββ user_policy.py
β β βββ schemas/ # Pydantic request/response schemas
β β βββ crud/ # Database CRUD operations
β β βββ services/
β β β βββ recommendation_engine.py # 12-factor scoring engine
β β β βββ email_service.py # SMTP email sender
β β β βββ s3_service.py # AWS S3 file upload
β β βββ api/v1/endpoints/ # All API route handlers
β βββ worker.py # Celery background email task
β βββ seed.py # Sample data seeder
β βββ check_config.py # .env verification helper
β βββ start_backend.ps1 # One-command startup script
β βββ requirements.txt
β
βββ database/
β βββ create_tables.py # DB table creation
β
βββ frontend/
β βββ src/
β β βββ components/ # All React UI components
β β β βββ Dashboard.jsx # Recommendations + policies
β β β βββ ClaimWizard.jsx # 5-step claim filing flow
β β β βββ MyClaims.jsx # Claim list + timeline
β β β βββ AdminClaims.jsx # Admin review panel
β β β βββ AdminDashboard.jsx # Admin stats overview
β β β βββ Profile.jsx # User + risk profile editor
β β β βββ PremiumCalculator.jsx
β β β βββ ComparePolicies.jsx
β β βββ context/
β β β βββ AuthContext.jsx # JWT auth management
β β βββ App.jsx # Routing + layout
β βββ package.json
β
βββ README.md
Admin updates claim status
β
FastAPI saves status to DB
β
FastAPI calls .delay() β drops task into Redis
β
Celery worker picks up task (background)
β
Email sent to user's registered email
β The FastAPI server is never blocked. The email always sends in the background.
draft β submitted β under_review β approved β paid
β
rejected
Each transition is strictly enforced. Admins cannot skip steps β e.g., you cannot approve a claim that hasn't been reviewed first.
- Never commit your
.envfile β it contains database passwords and API keys. It is already in.gitignore. - Docker Desktop must be open before running
start_backend.ps1for Redis to work. - If you don't have AWS S3, document uploads will not work but the rest of the app functions normally.