A deployable FastAPI service for Precision Auto Body's Estimate parser workflow. It demonstrates typed AI outputs, deterministic fallback behavior, SQLite audit persistence, production-style JSON logging, Docker packaging, CI, Railway deployment notes, and synthetic public demo data.
This service is an assistive workflow tool. It does not make final safety, repair, insurance, financial, or outbound communication decisions.
- Local validation: complete
- GitHub remote: published at https://github.com/dkdejesus/collision-estimate-parser-api
- Railway deployment: pending dashboard deployment
- Demo data policy: synthetic only
Add Railway URLs after deployment:
- API health:
https://<railway-domain>/health - Swagger docs:
https://<railway-domain>/docs
Estimators and managers need quick visibility into labor, parts, paint, missing fields, and review risks without manually reading every line.
This service parses synthetic estimate text into a structured review summary. The public version is synthetic-first: every fixture is made-up and safe to publish.
flowchart LR
Client["Client / workflow tool"] --> API["FastAPI service"]
API --> Validation["Pydantic validation"]
Validation --> Model["OpenAI structured output or deterministic fallback"]
Model --> Assessment["Typed EstimateParseAssessment"]
Assessment --> Store["SQLite audit database"]
Store --> Response["JSON response and retrievable record"]
labor_totalsparts_totalpaint_material_totalmissing_fieldsrisk_flagsreview_checklistconfidence
A production version could reduce manual review time for this workflow by turning scattered notes into structured handoffs, missing-item checks, and human-approved next actions.
POST /v1/estimate-parsescreates a workflow assessment.GET /v1/estimate-parseslists recent assessment summaries.GET /v1/estimate-parses/{request_id}retrieves a stored assessment.GET /healthsupports deployment health checks.
curl -X POST http://localhost:8000/v1/estimate-parses \
-H 'Content-Type: application/json' \
-d @sample_data/sample_request.json{
"request_id": "demo-request-001",
"assessment": {
"labor_totals": {
"body": "14.2",
"paint": "7.8"
},
"parts_total": "$1,840",
"paint_material_total": "$420",
"missing_fields": [
"calibration requirement",
"OEM procedure attachment"
],
"risk_flags": [
"ADAS/calibration review may be needed"
],
"review_checklist": [
"Verify labor totals",
"Attach relevant OEM procedures",
"Confirm supplement status"
],
"confidence": 0.74
},
"model": "rule-based-fallback"
}python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
uvicorn app.main:app --reloadOpen Swagger UI at http://localhost:8000/docs.
docker build -t collision-estimate-parser-api .
docker run --rm -p 8000:8000 --env-file .env collision-estimate-parser-api- Push this repository to GitHub.
- Create a Railway project from the GitHub repository.
- Railway will detect the
Dockerfileand userailway.tomlfor the/healthdeployment check. - Add service variables:
APP_ENV=production
LOG_LEVEL=INFO
OPENAI_API_KEY=<your key>
OPENAI_MODEL=gpt-5-mini
REQUEST_TIMEOUT_SECONDS=30
DATABASE_PATH=/data/estimate_parse.db
- Add a volume mounted at
/dataso saved records survive redeploys. - Generate a public domain from the service Networking settings.
pytest -q
ruff check .
ruff format --check .
docker build -t collision-estimate-parser-api:ci .- Keep customer, VIN, claim, phone, email, insurer, and photo data out of public demos.
- Put the container behind HTTPS and an authenticated gateway.
- Add rate limiting before public production traffic.
- Human review remains required for safety, repair, insurance, financial, and outbound communication decisions.
- Validate CCC ONE, Gmail, Google Calendar, Google Drive, QuickBooks, vendor, and carrier access before live integrations.
- Designed a typed AI workflow API around a real collision repair operating process.
- Used synthetic fixtures so the project is public-safe.
- Implemented deterministic fallback behavior so demos and tests work without an API key.
- Added request IDs, JSON logs, persistence, health checks, validation, tests, Docker, and Railway deployment notes.

