Skip to content

abarbod/Aquila

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Aquila Pricing Engine MVP

Enterprise-Grade, Claim-Aware, Fault-Weighted Car Insurance Pricing & Underwriting Engine

Architecture

  • Backend: FastAPI (Python 3.12+)
  • Frontend: Vue 3 + TypeScript + Vite
  • Database: PostgreSQL
  • Pricing Engine: Deterministic, configuration-driven, fully auditable

Setup

Prerequisites

  • Python 3.12+
  • Node.js 18+
  • Docker & Docker Compose (optional, for PostgreSQL)

Backend Setup

cd backend
pip install -r requirements.txt

Database Setup

Option 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.py

Option 2: Using Existing PostgreSQL

  1. Create a database named aquila:

    CREATE DATABASE aquila;
  2. Create a .env file in the backend/ directory with your database credentials:

    DATABASE_URL=postgresql://username:password@localhost:5432/aquila
    
  3. Seed the rate book:

    python seed_rate_book.py

Run the Backend Server

uvicorn app.main:app --reload

Backend 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 head

Frontend Setup

cd frontend
npm install
npm run dev

Frontend will be available at http://localhost:5173

Docker Compose (Full Stack)

Start PostgreSQL only:

docker-compose up -d postgres

Start PostgreSQL + Backend:

docker-compose up

This 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.py

API Endpoints

POST /v1/quotes

Create a new insurance quote. See PRD for request/response format.

GET /v1/quotes/{quote_id}

Retrieve a quote by ID from audit logs.

GET /health

Health check endpoint.

Testing

cd backend
pytest

The test suite includes an exact simulation test matching the PRD example.

Project Structure

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

Key Features

  • 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

License

Proprietary

About

Enterprise-Grade, Claim-Aware, Fault-Weighted Car Insurance Pricing & Underwriting Engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors