Enterprise-Grade, Claim-Aware, Fault-Weighted Car Insurance Pricing & Underwriting Engine
- Backend: FastAPI (Python 3.12+)
- Frontend: Vue 3 + TypeScript + Vite
- Database: PostgreSQL
- Pricing Engine: Deterministic, configuration-driven, fully auditable
- Python 3.12+
- Node.js 18+
- Docker & Docker Compose (optional, for PostgreSQL)
cd backend
pip install -r requirements.txtOption 1: Using Docker Compose (Recommended)
# Start PostgreSQL
docker-compose up -d postgres
# Wait a few seconds for PostgreSQL to start, then seed the database
python seed_rate_book.pyOption 2: Using Existing PostgreSQL
-
Create a database named
aquila:CREATE DATABASE aquila;
-
Create a
.envfile in thebackend/directory with your database credentials:DATABASE_URL=postgresql://username:password@localhost:5432/aquila -
Seed the rate book:
python seed_rate_book.py
uvicorn app.main:app --reloadBackend will be available at http://localhost:8000
Note: The seed script will create the necessary database tables automatically. If you want to use Alembic migrations instead, you can run:
alembic upgrade headcd frontend
npm install
npm run devFrontend will be available at http://localhost:5173
Start PostgreSQL only:
docker-compose up -d postgresStart PostgreSQL + Backend:
docker-compose upThis will start:
- PostgreSQL on port 5432 (user:
postgres, password:postgres, database:aquila) - Backend API on port 8000 (if included in docker-compose)
- Frontend should be run separately with
npm run dev
After starting PostgreSQL, seed the database:
cd backend
python seed_rate_book.pyCreate a new insurance quote. See PRD for request/response format.
Retrieve a quote by ID from audit logs.
Health check endpoint.
cd backend
pytestThe test suite includes an exact simulation test matching the PRD example.
aquila/
├── backend/
│ ├── app/
│ │ ├── api/ # API endpoints
│ │ ├── engine/ # Pricing engine core
│ │ ├── models/ # Database models
│ │ ├── schemas/ # Pydantic schemas
│ │ └── config/ # Configuration & rate books
│ ├── tests/ # Test suite
│ └── alembic/ # Database migrations
├── frontend/
│ ├── src/
│ │ ├── components/ # Vue components
│ │ ├── services/ # API services
│ │ └── types/ # TypeScript types
└── docker-compose.yml
- Fault-Weighted Claims Modeling: DAFR/VAFR/IAFR calculations
- Deterministic Pricing: Same input → same output
- Full Explainability: Breakdown of all factors
- Audit Trail: Every quote is logged and replayable
- Configuration-Driven: Rate books stored in database
Proprietary