ClaimCheck is an evidence-grounded insurance policy reasoning engine.
- Python 3.11+
- Docker & Docker Compose
Start PostgreSQL with pgvector:
docker compose up -d db- Navigate to the backend directory:
cd backend - Create and activate a virtual environment:
python -m venv .venv # Windows: .venv\Scripts\activate # Linux/macOS: source .venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Configure environment variables:
Generate a secure random secret key for
cp .env.example .env
JWT_SECRET_KEYin production/staging:python -c "import secrets; print(secrets.token_urlsafe(48))" - Run the FastAPI development server:
uvicorn app.main:app --reload
curl -X POST http://localhost:8000/api/auth/register \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "StrongPassword123!"}'curl -X POST http://localhost:8000/api/auth/login \
-H "Content-Type: application/json" \
-d '{"email": "user@example.com", "password": "StrongPassword123!"}'curl -X GET http://localhost:8000/api/auth/me \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"Run Alembic migration commands from the backend/ directory:
- Apply all pending migrations:
alembic upgrade head
- Roll back the latest migration:
alembic downgrade -1
- Generate a new migration revision based on ORM model changes:
alembic revision --autogenerate -m "message"
pytest -qUploaded PDFs are stored at data/uploads/<user_id>/<policy_id>/<version_id>.pdf (relative to the backend/ directory). Only PDF files are accepted; the server validates both the declared Content-Type and the file magic bytes.
curl -i -X POST http://localhost:8000/api/policies \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>" \
-F "name=My Health Plan" \
-F "provider=Acme Insurance" \
-F "policy_type=Health" \
-F "file=@/path/to/policy.pdf"curl http://localhost:8000/api/policies \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"curl http://localhost:8000/api/policies/<POLICY_ID> \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"curl -X DELETE http://localhost:8000/api/policies/<POLICY_ID> \
-H "Authorization: Bearer <YOUR_ACCESS_TOKEN>"